Android SDK Integration

Step 1. Add the whitemobi library to Your Project

For Manual Download:

Download the SDK here; unzip it and drop the whitemobi_xxx.jar into the libs folder in your Project.

If you use gradle, make sure you add the following to your Gradle build file under the dependencies section:

compile fileTree(dir: 'libs', include: ['*.jar'])
compile 'com.google.code.gson:gson:2.6.2'

Step 2. Update AndroidManifest.xml

To update your AndroidManifest.xml, please complete the following steps:

  1. Manifest Permissions
    Add the following permissions to your Application Descriptor.xml file inside the manifestAdditions tag but outside the <application> tag:
    <uses-permission android:name="android.permission.INTERNET" />
    <uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
    
  2. Manifest Activities
    Add the following activities inside the <application> tag on your manifestAdditions:
    <activity android:name="com.white.mobi.sdk.WMOfferWall"> </activity>
    

Step 3. Initializing library.

Override the onPause(), onResume() methods in each of your activities to call the corresponding methods as follows:

protected void onResume() {
      super.onResume();
      WMManager.onResume(this);
}

protected void onPause() {
      super.onPause();
      WMManager.onPause();
}

For implemention server-to-client callback you shuold to set RewardLIstener:

WMManager.setRewardListener(new IRewardsListener() {
      @Override
      public void onRewarded(int amount) {
          Toast.makeText(MainActivity.this, "Got Credits: " + amount,
          Toast.LENGTH_LONG).show();

}
});

For showing offerWall you can call:

WMManager.showOfferWall(application_key);

or:

WMManager.showOfferWall(application_key, user_id);

For ProGuard Users Only

If you are using ProGuard with the SDK, you must add the following code to your ProGuard file (Android Studio: proguard-rules.pro or Eclipse: proguard-project.txt)

-keepattributes Signature
-keep class com.white.mobi.** { *; }