Step 1. Setup and Initialize SDK
Install the SDK
The CrystalExpress SDK is available through AAR or JAR :
AAR (Recommend)
Copy ce-xx-xx-x.x.aar to the libs folder of your app project
Add following line to your app build.gradle. (You don't need to do add v4 support library if you already had v7 in your project)
apply from: 'https://raw.githubusercontent.com/intowow/ce-sdk-android-config/master/aar-config.gradle' ... dependencies { ... compile 'com.android.support:support-v4:+' }
Declare Crystal ID received from your Intowow account manager in your Android Manifest.
<meta-data android:name="CRYSTAL_ID" android:value="crystalidforandroidtestdontuseit" />
JAR
Copy ce-xx-xx-x.x.jar to the libs folder of your app project.
Add Android v4 Support Library to your app project. (You don't need to do this step if you already added v7 support library in your project)
dependencies { ... compile 'com.android.support:support-v4:XX.X.X' }
Setup Your Android Manifest
Declare permissions
<uses-permission android:name="android.permission.INTERNET" /> <uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" /> <uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
Declare
Activity
<activity android:name="com.intowow.sdk.WebViewActivity" android:configChanges="orientation|screenSize" android:theme="@android:style/Theme.NoTitleBar.Fullscreen"> </activity>
Declare
Receiver
<receiver android:name="com.intowow.sdk.ScheduleReceiver" android:exported="false"> <intent-filter > <action android:name="com.intowow.sdk.prefetch"/> </intent-filter> </receiver>
Declare Crystal ID received from your Intowow account manager.
<meta-data android:name="CRYSTAL_ID" android:value="crystalidforandroidtestdontuseit" />
Initialize The SDK
1.Declare your Application
in the AndroidManifest.xml
.
<application android:name="Your Application">
...
...
</application>
2.Add method to your Application
's onCreate
import android.app.Activity;
import android.app.Application;
import android.os.Build;
import android.os.Bundle;
import com.intowow.sdk.I2WAPI;
public class BaseApplication extends Application {
@Override
public void onCreate() {
super.onCreate();
// TODO
// init SDK
//
// production mode
//I2WAPI.init(activity);
// Test Mode
//I2WAPI.init(activity, true);
// or open verbose log with test mode
I2WAPI.init(activity);
}
}
Last updated