Android SDK Integration

You have two options two integrate our Android SDK. You can use either the .jar or the .aar files. Please, follow the instructions below.

Installation

➜ Option 1

Download the .zip file and extract the .aar files. Create a libs folder at the root of your project and copy it here. Now, on your Gradle configuration file (build.gradle), add: // Adstronomic SDK compile(name: 'adstronomic-debug', ext: 'aar') implementation 'com.android.volley:volley:1.1.1' implementation 'com.squareup.picasso:picasso:2.71828' implementation 'androidx.core:core-ktx:1.3.2' Update your Gradle project.

🧙 Tips: Having an error message saying ‘Failed to resolve :my_library’? Click here

➜ Option 2

Download the .zip file and extract the .jar file. Create a libs folder at the root of your project and copy it here. Now, on your Gradle configuration file (build.gradle), add: implementation files('libs/AdstronomicSDK.jar') implementation 'com.android.volley:volley:1.1.1' implementation 'com.squareup.picasso:picasso:2.71828' implementation 'androidx.core:core-ktx:1.3.2' Update your Gradle project.

Setup

Open your MainActivity.java and add the following include code import com.adstronomic.sdk.Adstronomic;. Now, initialize Adstronomic in the onCreate methods of your Activity with this line Adstronomic.init(this, "CAMPAIGN ID"); and replace CAMPAIGN ID with your ID available on your dashboard.

You're now ready to load and show Ads.

How to use

You can load all Ads after the setup with this method Adstronomic.loadAdsData();.

Last updated