Android SDK: Getting started

Integrating myTarget SDK for Android

Minimum supported Android version - 4.0 (API Level 14).

We recommend you to connect to the project Google Play Services library (module Ads Identifier com.google.android.gms:play-services-ads-identifier), it will allow better to target Ads on Google Advertising ID.

Using Gradle:

Add dependence in build.gradle file of your project:

dependencies {
    //... other dependences
    implementation 'com.my.target:mytarget-sdk:5.6.+'
}

Manual:

  1. Download latest version of mytarget-sdk.aar.
  2. Copy mytarget-sdk.aar to your project's libs directory.
  3. Add mytarget-sdk.aar to your project as a library.
  4. Add RecyclerView component from Android Support Library to your project as a library.
  5. Add ExoPlayer-core and ExoPlayer-hls components.
  6. If you are using Proguard add an exception:



-keep class com.my.target.** {*;} 

AndroidManifest.xml

Declare INTERNET and ACCESS_NETWORK_STATE permissions in the manifest section:

<manifest xmlns:android="http://schemas.android.com/apk/res/android"
        ...
        >
        ...
        <uses-permission android:name="android.permission.INTERNET" />
        <uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
...
</manifest>
Declare MyTargetActivity in the application section:

<application ....>
...
<activity android:name="com.my.target.common.MyTargetActivity" android:configChanges="keyboard|keyboardHidden|orientation|screenLayout|uiMode|screenSize|smallestScreenSize"/>
</application>
Was this article helpful?
Yes
No