Preparing Your Apps for Android M
If you plan on building your app against the Android M APIs, we advise you to take the following steps:
- Update to the latest MoPub SDK v3.13
- Update your permissions model
Apps built for older versions of Android will not be impacted. Read on for more details.
Updating your SDK
Google has removed a library that our SDK used to make network connections called HttpClient. As a result of this change, publishers who build their app against API Level 23 AND are using our open source SDK will experience compile errors. Apps that are running the AAR downloaded from jCenter will continue running smoothly.
If you are building your app for Android M, please update your MoPub SDK to v3.13 to avoid compile errors. We’ve updated our latest SDK to use a new library for network connections called HttpURLConnection.
Updating your permissions model
In Android M, Google is introducing a new permissions model that requires apps to ask the user for each protected permission (i.e. calendar, camera, contacts) as it is needed rather than requesting all permissions on download. While the user is in the app, the system shows a dialog to the user asking for the permission. Google expects developers to gracefully handle cases where the user declines to provide the permission.
If you are building your app for Android M, please update your permissions model to ensure your app functions properly.

Certain permissions are granted to the app by default (see the full list here). However, this does not include two optional permissions for MoPub — Location and External Storage. Here’s what you should know:
Location:
Location isn’t required for MoPub to work. However, sharing location with MoPub can increase your revenue. If you want to share location, you need to make sure your app asks for the permission for a legitimate reason per Google’s Best Practices. Best Practices. For example, apps should only ask for this permission if it’s needed for an app’s functionality. MoPub will never prompt your users to share location information.
External storage:
This is an optional permission that our SDK uses for MRAID 2.0 store picture ads.
Working with Android 6.0 Runtime Permissions
If your app’s target SDK is 23 or higher and the user’s device is running Android 6.0 or higher, you are responsible for supporting runtime permissions, one of the changes introduced in Android 6.0 (API level 23). In addition to listing any dangerous permissions your app needs in the manifest, your app also has to explicitly request the dangerous permission(s) during runtime by calling method requestPermissions() in the ActivityCompat class.
Specifically for the MoPub SDK:
Dangerous permission ACCESS_COARSE_LOCATION is needed to pass network location data to MoPub.
Dangerous permission ACCESS_FINE_LOCATION is needed to pass GPS location data to MoPub.
Granting ACCESS_FINE_LOCATION also allows network location data to be passed to MoPub without the need to also grant ACCESS_COARSE_LOCATION.
Dangerous permission READ_EXTERNAL_STORAGE is needed for exoplayer to play native video.
Dangerous permission WRITE_EXTERNAL_STORAGE is needed for MRAID 2.
Note: The user can deny granting any dangerous permissions during runtime, so please make sure your app can handle this properly.
Note: The user can revoke any permissions granted previously by going to your app’s Settings screen, so please make sure your app can handle this properly.
For more information, you can review our GitHub page.