Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
Android sdk native
1. 1 | P a g e
ANDROID INTEGRATION GUIDE (14.04.06.ANDROID)
appnext mobile solution allows you to display ads of other apps and games to your users, earn money, and provide your users a game discovery service. To monetize your users with appnext, the product must be integrated into your game or app. This document will guide you through the integration process.
Integration consists of the following parts:
•Integrating appnext to your Android game or app
•Configuring your account on the appnext admin panel
Integrating appnext interstitial to your Android Game
Note: If you haven’t done so already, download the appnext SDK by clicking here.
The process of integrating appnext is fairly straightforward and does not require heavy programming. The process of using appnext in your applications is described below in outlined steps:
Add the appnextSDK.jar to your project
Edit your manifest
Initialize the SDK with your app ID
Show Ads
The actual code-level integration is described in the sections below. Should you have any problems integrating the product, log a ticket with us by emailing support@appnext.com.
Step 1: Add the appnext SDK to Your Project
Add the appnextSDK.jar to your project build. Right-click on your project and select “Properties”. In the properties dialog select “Java Build Path and then select the “Libraries” tab and click to add jars. Find the appnextSDK.jar file and click OK. This will copy the appnextSDK.jar file to the libs directory in your project.
Step 2: Edit the AndroidManifest.xml File
To properly use appnext, you need to make sure you allow the following permissions in your manifest
<uses-permission android:name="android.permission.INTERNET" /> <uses-permission android:name="android.permission.ACCESS_WIFI_STATE" /> <uses-permission android:name="android.permission.GET_ACCOUNTS" /> <uses-permission android:name="android.permission.READ_PHONE_STATE" />
2. 2 | P a g e
ANDROID INTEGRATION GUIDE (14.04.06.ANDROID)
Permissions explanation: android.permission.INTERNET
Mandatory
Used to get the ads information.
android.permission.READ_PHONE_STATE
Optional
Used to get the device IMEI in order to attribute installs better.
android.permission.ACCESS_WIFI_STATE
Optional
Used to get the device MAC address in order to attribute installs better.
android.permission.GET_ACCOUNTS
Optional (but highly recommended)
Used to get the user's email. Lets the user send the app offer to his email.
And add this service declaration in your application tag <service android:name="com.appnext.appnextsdk.DownloadService"/>
Step 3: Initialize appnext
Create class member: Appnext appnext;
We recommend showing the popup when app is starting. To do so, add the following code to the onCreate function in your Activity: appnext = new Appnext(this); appnext.setAppID("<PlacementID>"); // Set your AppID appnext.showBubble(); // show the interstitial
You can override the back button to close the popup by adding the following to your code: appnext.hideBubble();
You can alternatively show the interstitial using a triggering event:
appnext.showBubble();
3. 3 | P a g e
ANDROID INTEGRATION GUIDE (14.04.06.ANDROID)
Step 4: Callbacks (optional)
In case you want to get notified about appnext's events we offer you a few callbacks. You can decide which callback to implement.
1. Ad load callback appnext.setAdLoadInterface(new OnAdLoadInterface() { @Override public void adLoaded() { Log.v("appnext", "on ad load"); } });
2. Ad failed to load callback appnext.setNoAdsInterface(new NoAdsInterface() { @Override public void noAds() { Log.v("appnext", "no ads"); } });
3. Popup opened callback appnext.setPopupOpenedInterface(new PopupOpenedInterface() { @Override public void popupOpened() Log.v("appnext", "popup opened"); } });
4. Click callback appnext.setPopupClickedCallback(new PopupClickedInterface() { @Override public void popupClicked() { Log.v("appnext", "popup clicked"); } });
5. Popup closed callback appnext.setPopupClosedCallback(new PopupClosedInterface() { @Override public void popupClosed() { Log.v("appnext", "popup closed"); } });
4. 4 | P a g e
ANDROID INTEGRATION GUIDE (14.04.06.ANDROID)
Step 5: Caching (optional)
To cache an ad use the following line appnext.cacheAd();
To show ClickTag Ads using a “more apps” button:
1. Select one of the following: appnext.addMoreAppsLeft("<PlacementID>");
or appnext.addMoreAppsRight("<PlacementID>");
We suggest using a different Placement ID in the “more apps” button. you can generate new Placements at “My Apps” page in appnext’s website: https://selfservice.appnext.com/Apps/Manage.aspx
To get the library version: Appnext.getVersion();
Integration Support
Should you have any problems integrating the product, log a ticket with us by emailing support@appnext.com.