---
updatedAt: 2026-03-01T17:17:24.000Z
agentTools:
  siteIndex: https://techdocs.akamai.com/llms.txt
  projectIndex: https://techdocs.akamai.com/amp2-bitmovin/llms.txt
---

# Migrate Android SDK

Use this guide to migrate your Player Android SDK from AMP1 to AMP2.

The guide lists specific player features and functions, their AMP1 implementation, and how you should implement them in AMP2 for successful migration.

For a detailed AMP1 vs. AMP2 feature and function mapping with examples, see the following tables:

* [Event mapping for Android SDK](https://techdocs.akamai.com/amp2-bitmovin/docs/event-mapping-android)
* [Player method mapping for Android SDK](https://techdocs.akamai.com/amp2-bitmovin/docs/player-method-mapping-android)

Additional reference:

* AMP2 Bitmovin Android:
  * [User documentation](https://developer.bitmovin.com/playback/docs/getting-started-android)
  * [API reference docs](https://cdn.bitmovin.com/player/android/3/docs/index.html)
  * [Code Samples](https://github.com/bitmovin/bitmovin-player-android-samples)
* AMP1 Android:
  * [User documentation](https://docs.player.akamai.com/amp-android-sdk/latest/getting-started.html)
  * [API reference docs](https://docs.player.akamai.com/static/amp-android-sdk/index.html)
  * [Code Samples](https://mdtp-a.akamaihd.net/amp-android-sdk/)

# 1. Set up a project

**AMP1 implementation**:

1. With AMP1, you had to add multiple .jar and .aar files into your project. Remove those dependencies.
2. Remove `com.akamai.amp.AmpPlayerView` from the desired Activity's XML layout.

**AMP2 implementation**:

1. Add a link to the player SDK repository and add the dependency to the project. See the [Bitmovin tutorial](https://developer.bitmovin.com/playback/docs/getting-started-android#step-1-add-the-sdk-to-your-project)  for more details.
2. Add  `com.bitmovin.player.PlayerView` to the desired Activity's XML layout.

# 2. Instantiate the player

**AMP1 implementation** ([docs](https://docs.player.akamai.com/amp-android-sdk/latest/amp-basic-integration/index.html#_integration)):

```java
private VideoPlayerContainer videoPlayerContainer;
private VideoPlayerView videoPlayerView;
@Override protected void onCreate(Bundle savedInstanceState) {
	videoPlayerContainer = findViewById(R.id.playerViewCtrl);
	videoPlayerContainer.setApiKey(API_KEY);
}
```

**AMP2 implementation** ([docs](https://developer.bitmovin.com/playback/docs/getting-started-android#instantiate-the-player-advanced-setup)):

```java
val playerConfig = PlayerConfig()
val analyticsConfig = AnalyticsConfig(licenseKey = "<ANALYTICS_LICENSE_KEY>")
val player = Player(context, playerConfig, AnalyticsPlayerConfig.Enabled(analyticsConfig))
val playerView = this.findViewById(R.id.playerView)
playerView.player = player

```

# 3. Load an asset

**AMP1 implementation** ([docs](https://docs.player.akamai.com/amp-android-sdk/latest/amp-basic-integration/index.html#_mediaresource_object)):

```java
videoPlayerContainer.prepareResource(HLS_VOD);

@Override public void onResourceReady(MediaResource mediaResource) {
videoPlayerView = videoPlayerContainer.getVideoPlayer();
videoPlayerView.play(mediaResource);
}
```

**AMP2 implementation** ([doc](https://developer.bitmovin.com/playback/docs/getting-started-android#instantiate-the-player-advanced-setup)):

```kotlin
val sourceConfig = SourceConfig.fromUrl(HLS_VOD)
val sourceMetadata = SourceMetadata(title = "Art of Motion", customData1 = "sample data")
val source = Source(sourceConfig, AnalyticsSourceConfig.Enabled(sourceMetadata))
player.load(source)
```

# 4. Set up DRM content

**AMP1 implementation** ([docs](https://docs.player.akamai.com/amp-android-sdk/latest/amp-features-drm/index.html)):

```java
videoPlayerContainer.prepareResource(WIDEVINE_VIDEO_URL, DrmScheme.WIDEVINE, WIDEVINE_LICENSE_URL);
```

**AMP2 implementation** ([doc](https://developer.bitmovin.com/playback/docs/drm-providers-setup-android)):

```kotlin
val sourceConfig = SourceConfig(
	url = TODO("CONTENT_MANIFEST_URL"),
	type = SourceType.Dash,
	drmConfig = WidevineConfig(
		licenseUrl = TODO("LICENSE_URL")
	),
)
```

# 5. Set up ad playback

**AMP1 implementation** ([docs](https://docs.player.akamai.com/amp-android-sdk/latest/amp-ads-google-ima/index.html)):

```java
private AmpIMAManager csaiManager;
csaiManager.setAdsUrl(ADS_URL);
videoPlayerContainer.prepareResource(HLS_VOD);
```

**AMP2 implementation** ([docs](https://developer.bitmovin.com/playback/docs/setting-up-ads-with-the-bitmovin-android-sdk)):

```kotlin
val sourceConfig = SourceConfig(
	url = TODO("CONTENT_MANIFEST_URL"),
	type = SourceType.Dash,
	drmConfig = WidevineConfig(
		licenseUrl = TODO("LICENSE_URL")
	),
)
```

# 6. Set up a downloader for offline playback

**AMP1 implementation** ([docs](https://docs.player.akamai.com/amp-android-sdk/latest/amp-downloader/index.html)):

```java
AmpDownloadManager downloadManager = AmpDownloader.create(ctx,maxParallelDownloads);
ampDownloadManager.startDownload(String name);
ampDownloadManager.deleteDownload(Uri uri);
videoPlayerview.setDownloadRequestProvider(DownloadRequestProvider provider);
```

**AMP2 implementation** ([docs](https://developer.bitmovin.com/playback/docs/working-with-offline-playback-android)):

```kotlin
val offlineContentManager = OfflineContentManager.getOfflineContentManager( sourceConfig = SourceConfig.fromUrl(path),
location = getDir("offline", ContextWrapper.MODE_PRIVATE).path,
id = "uniqueID", listener = listener, context = androidContext
)
offlineContentManager.process(offlineContentOptions);
bitmovinPlayer.load(offlineContentManager.offlineSourceConfig);
```

# 7. Set up a Google cast support

**AMP1 implementation** ([docs](https://docs.player.akamai.com/amp-android-sdk/latest/amp-chromecast/index.html)):

```java
ampCastManager = new AmpCAF.Builder(Context).build();
ampCastManager.initCastButton(Context, Menu, MenuItemId);
ampCastManager.showIntroductoryOverlay(Context, MessageString, ColorResLayout);
ampCastManager.getQueueManager();
```

**AMP2 implementation** ([docs](https://developer.bitmovin.com/playback/docs/setting-up-basic-google-caf-support)):

```java
BitmovinCastManager.initialize()
BitmovinCastManager.updateContext(context)
```

# 8. Set up player events

**AMP1 implementation** ([docs](https://docs.player.akamai.com/amp-android-sdk/latest/amp-player-events/index.html)):

```java
videoPlayerView.addEventsListener(new IPlayerEventsListener() {
	@Override
	public boolean onPlayerEvent(int eventID) {
		Log.i(TAG, "AMP Event: " + PlayerEvents.toString(eventID));
		if (PlayerEvents.matches(eventID, IPlayerEventsListener.PLAYER_EVENT_APP_SENT_TO_FOREGROUND)) {
			/* handle app foregrounding */
		}
		return false;
	}

	@Override
	public boolean onPlayerExtendedEvent(int i, int i1, int i2) {
		/* handle extended event */
		return false;
	}
});
```

**AMP2 implementation** ([docs](https://cdn.bitmovin.com/player/android/3/docs/player-core/com.bitmovin.player.api.event/-event/index.html)):

```java
player?.on(PlayerEvent::class.java) { event ->
	when (event) {
		is PlaybackFinished -> { /* handle playback end */ }
		is Error -> { /* handle error */ }
		is TimeChanged -> { /* update progress bar */ }
		// etc.
	}
}
```

> 📘
>
> See [Event mapping for Android SDK](https://techdocs.akamai.com/amp2-bitmovin/docs/event-mapping-android) for a complete list of AMP1 vs. AMP2 event mapping.

# Sub pages

* [Event mapping for Android SDK](https://techdocs.akamai.com/amp2-bitmovin/docs/event-mapping-android.md)
* [Player method mapping for Android SDK](https://techdocs.akamai.com/amp2-bitmovin/docs/player-method-mapping-android.md)

# Sibling pages

* [Migration guide](https://techdocs.akamai.com/amp2-bitmovin/docs/migration-guide.md)
* [Migrate Web SDK](https://techdocs.akamai.com/amp2-bitmovin/docs/migrate-web.md)
* [Migrate iOS SDK](https://techdocs.akamai.com/amp2-bitmovin/docs/migrate-ios.md)
* [Validate your migration](https://techdocs.akamai.com/amp2-bitmovin/docs/validate-migration.md)

# What’s Next

* [Validate your migration](https://techdocs.akamai.com/amp2-bitmovin/docs/validate-migration.md)