Android
This page provides instructions for integrating the Vessel SDK into your Android App.
- Download Vessel SDK
- Unzip the downloaded file and drag to your Eclipse project.
Step 1: Open AndroidManifest.xml and Add internet permission
Your App must request the "INTERNET" and "ACCESS_NETWORK_STATE" permissions. If your App already requests these permissions, skip to the next step.
<uses-permission android:name="android.permission.INTERNET"></uses-permission>
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE"></uses-permission>
Step 2: Initialize Vessel SDK, open your Application class or Activity class in your App. Import Vessel SDK in your Activity before setContentView or in Application Context
// Initialize Vessel
VesselSDK sdk = VesselSDK.getInstance(getApplicationContext);
sdk.initializeSDK("secretKey")
Step 3: Configure activities. Add Vessel onStart, onStop in all or in base activity as shown bellow.
@Override
protected void onStop() {
VesselSDK.onStop(SecondActivity.this);
super.onStop();
}
@Override
protected void onStart() {
VesselSDK.onStart(SecondActivity.this);
super.onStart();
}
Step 4: ProGuard Configuration (Optional)
If you are using ProGuard for your App, then add following lines in your proguard.cfg file. The file will be located within your project folder. Adding this code will exclude the Vessel SDK from obfuscation process.
-dontwarn com.vessel.*
-dontnote com.vessel.*
-keep class com.vessel.** { *; }
Updated less than a minute ago