---
metadata:
  - name: generator
    content: Diplodoc Platform v5.52.0
alternate:
  - https://ads.yandex.com/helpcenter/en/dev/android/release/7-0-0-migration.md
  - https://ads.yandex.com/helpcenter/ru/dev/android/release/7-0-0-migration.md
  - https://ads.yandex.com/helpcenter/zh/dev/android/release/7-0-0-migration.md
  - href: zh/dev/android/release/7-0-0-migration.md
    type: text/markdown
    title: Markdown version
  - href: ../llms.txt
    type: text/markdown
    title: llms.txt
---
> **Documentation Index:** Fetch the complete configuration index at https://ads.yandex.com/helpcenter/zh/llms.txt

# 版本 7 迁移指南

## 生成竞价者令牌的新方法

### SDK 6

{% list tabs %}

- Kotlin

  ```kotlin
  BidderTokenLoader.loadBidderToken(context, bidderTokenLoadListener)
  ```
  
- Java

  ```java
  BidderTokenLoader.loadBidderToken(context, bidderTokenLoadListener);
  ```

{% endlist %}

### SDK 7

{% list tabs %}

- Kotlin

  ```kotlin
  BidderTokenLoader.loadBidderToken(context, bidderTokenRequestConfiguration, bidderTokenLoadListener)
  ```
  
- Java

  ```java
  BidderTokenLoader.loadBidderToken(context, bidderTokenRequestConfiguration, bidderTokenLoadListener);
  ```

{% endlist %}

`BidderTokenRequestConfiguration` 包含获取竞价者令牌所需的信息，并使用 `BidderTokenRequestConfiguration$Builder` 创建。创建时，需传递所请求广告的格式。如果格式为横幅广告，请同时传递尺寸。

## 评级界面

在 Kotlin 的 `Rating` 界面中使用方法而不是属性。

### SDK 6

   ```kotlin
   val value = ratingImpl.rating
   ratingImpl.rating = 2
   ```

### SDK 7

   ```kotlin
   val value = ratingImpl.getRating()
   ratingImpl.setRating(2)
   ```

## VideoPlayer 界面

在 Kotlin 的 `VideoPlayer` 实施中覆盖属性而不是方法。

### SDK 6

   ```kotlin
   class VideoPlayerImpl : VideoPlayer {

       //...

       override fun getVideoPosition(): Long = TODO()

       override fun getVideoDuration(): Long = TODO()

       override fun getVolume(): Float = TODO()

       //...

   }
   ```

### SDK 7

   ```kotlin
   class VideoPlayerImpl : VideoPlayer {

       //...

       override val videoPosition: Long
           get() = TODO()

       override val videoDuration: Long
           get() = TODO()

       override val volume: Float
           get() = TODO()

       //...

   }
   ```

## MobileAds 版本获取

在 Kotlin 中获取 MobileAds 版本时使用属性而不是方法。

### SDK 6

  ```kotlin
  MobileAds.getLibraryVersion()
  ```

### SDK 7

  ```kotlin
  MobileAds.libraryVersion
  ```

