|
Project Information
|
Super Rewards Android SDK
Android SDK Documentation 1. Prerequisites:Before you can use the Android SDK, please make sure the following tasks have been completed:
(NOTE: if you have an application on our regular offerwall, you will need to create a new one) Unique App Identifier: The unique app identifier (h) is the encrypted string that identifies your application. This identifier is created when you sign up for a Super Rewards Publisher account and create an app; if you have an app already, the unique app identifier (h) has already been created for you. 2. Android Setup:There are three important items that are needed before the Offerwall can be displayed within your Android application. These items and their specific instructions are outlined below.
If you don't have your Unique App Identifier, please view the instructions above under 1. Prerequisites
The Super Rewards Android SDK consists of a library and resources that will be needed to display the offerwall within your game. Once the Super Rewards Android SDK is located in the correct location, the classes can be imported and referenced when needed. SDK Location: http://code.google.com/p/superrewards-android-sdk/downloads/list
The Android SDK download contains a .jar file and a folder called "resources". The resources folder will need to be merged into your existing project's "res" directory. The .jar file can be easily installed into your app by importing it into your project and including it in your Java Build Path. For Eclipse users, the following steps apply:
Next, The following lines should be added to your AndroidManifest.xml inside the <application> tag: <activity android:name="com.adknowledge.superrewards.ui.activities.SRPaymentMethodsActivity" android:screenOrientation="portrait"/>
<activity android:name="com.adknowledge.superrewards.ui.activities.SRDirectPaymentActivity" android:screenOrientation="portrait"/>
<activity android:name="com.adknowledge.superrewards.ui.activities.SROfferPaymentActivity" android:screenOrientation="portrait"/>
<activity android:name="com.adknowledge.superrewards.ui.activities.SRWebViewActivity" android:screenOrientation="portrait"/>
<activity android:name="com.zong.android.engine.web.ZongWebView"
android:screenOrientation="portrait"
android:theme="@android:style/Theme.NoTitleBar.Fullscreen">
<intent-filter >
<action android:name="com.adknowledge.superrewards.ui.activities.SRZongPaymentActivity"/>
<category android:name="android.intent.category.DEFAULT"/>
</intent-filter>
</activity >
<service android:enabled="true" android:exported="false"
android:name="com.zong.android.engine.process.ZongServiceProcess"/>The following lines should be added to your AndroidManifest.xml before the closing <manifest> tag: <uses-permission android:name="android.permission.INTERNET"/> <uses-permission android:name="android.permission.ACCESS_NETWORK_STATE"/> <uses-permission android:name="android.permission.READ_PHONE_STATE"/> <uses-permission android:name="android.permission.RECEIVE_SMS"/> <uses-permission android:name="android.permission.READ_SMS"/> <uses-permission android:name="android.permission.WRITE_SMS"/> Lastly, you will need to import the Super Rewards packages into the activity where you intend to launch a wall. import com.adknowledge.superrewards.SuperRewards; import com.adknowledge.superrewards.SuperRewardsImpl; import com.adknowledge.superrewards.Utils;
We offer a test postback that can award points to test functionality. This works with both the Server Postback and SR SDK methods of point retrieval. To enable this functionality, add an admin user id in your app settings under "Admin" and make sure that user id is used when launching an offerwall. The test postback offer should be the first offer available under the "Earn" tab.
The following is a demonstration of launching an Offer Wall within an app by binding it to an OnClickListener. private OnClickListener getButtonOnCLickListener() {
return new OnClickListener() {
@Override
public void onClick(View arg0) {
SuperRewards sr = new SuperRewardsImpl(R.class);
sr.showOffers(TestActivity.this, "xxxxx.xxxxxxxxxxx", "[USER ID]", Utils.getCountryCode(), "1", "2", null, null);
}
};
}
For those publishers that do not use their own servers to track user points, we offer a serverless method to retrieve both new and total points awarded for a specific user. This uses the same UID you defined in sr.showOffers(). Note: these requests are not threaded; we leave this decision up to the individual developer. SRUserPoints user = new SRUserPoints(getApplicationContext()); user.updatePoints(hparam, uid); int newpoints = user.getNewPoints(); int totalpoints = user.getTotalPoints();
For your Android-based CPI campaign to work, you must send us install information whenever a user installs your app. This can be accomplished via our Server-to-Server method or you can use our SDK to send this information. The correct way to send an install hit looks like this: SRAppInstallTracker tracker = SRAppInstallTracker.getInstance(getApplicationContext(), "your app identifier here"); tracker.track(); This request uses an AsyncTask to avoid blocking the UI thread. If a user loads an offerwall, we also receive install tracking information. If you want to run a CPI campaign with Super Rewards but do not want to use our offerwall, we offer an Advertiser-Only SDK which is the InstallTracker packaged by itself. 3. Respository Location:For Developers, the Super Rewards Android SDK project is available for you to check out and modify to meet your needs. http://code.google.com/p/superrewards-android-sdk/source/checkout 4. Javadoc:A full HTML format API reference is also available. http://www.superrewards-offers.com/docs/javadoc/index.html 5. Demo Application:If you would like to quickly see an example of the offerwall implementation on your Android device you can click the link for this demonstration .apk file in your Android browser and install it. Please do not make payments on this app, as points will only be awarded to a test user on our test app. http://superrewards-android-sdk.googlecode.com/files/SRAndroidSDK.apk 6. Additional Help:For more help regarding the setup of the Android SDK, please contact your Account Manager. © Copyright 2010. Super Rewards™. All rights reserved. Terms - Privacy |