Importing the OpenX Mobile Android SDK

Last updated on August 23, 2018

You can use Gradle and Android Studio to import the OpenX Mobile Android SDK into your app.

  1. Extract the content from the SDK zip file.

    Extracted Android zip file

  2. Open your project in your file explorer.
  3. Android SDK importing

  4. Create a libs directory in your project if it does not already exist.

    Android SDK libs folder

  5. Copy AndroidSDK-X.X.X.aar from the extracted OpenX_Mobile_SDK_Android folder into libs.

    Android SDK copied to libs

  6. Change the project build.gradle file to include the libs directory.

    build.gradle (Project: MyApp)

    allprojects {
    	repositories {
    		flatDir {
    			dirs 'libs'

    Android SDK import to project gradle

  7. Change the module build.gradle file (not the project build.gradle file) as follows:
    1. Add ' (or the latest version) as a dependency.
    2. Add 'compile '' as a dependency.

    3. Add the OpenX Mobile Android SDK .aar file as a dependency.

      build.gradle (Module: app)

      dependencies {
      	compile ''
      	compile ''
      	compile(name: 'AndroidSDK-x.x.x', ext:'aar')

      Change module build.gradle file

  8. In Android Studio, select Tools > Android > Sync Project with Gradle files.

    The OpenX Mobile Android SDK library is now successfully added to your project.

  9. Select Build > Rebuild project. Android Studio uses the Gradle build system, which refers to the build.gradle files in each of the projects you imported.

  10. Select Run > app to launch your app integrated with OpenX Mobile Android SDK on a connected device or on an emulator.

You are now ready to integrate the SDK with your project.

See also

Fill out my online form.