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'
To update your AndroidManifest.xml, please complete the following steps:
<uses-permission android:name="android.permission.INTERNET" />
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
<activity android:name="com.white.mobi.sdk.WMOfferWall"> </activity>
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.** { *; }