AppLift SDK

Report 15 Downloads 181 Views
AppLift SDK V1

AppLift SDK 5 minutes Android Integration Guide

Prepared by the AppLift Engineering Team © 2012-2013 AppLift GmbH. All rights reserved.

AppLift SDK V1

Introduction and Table of Contents

Android SDK The AppLift Android SDK provides the integration of the engagement interstitials. It is provided in the form of a framework that you may simply include in your Android project. Our SDK is compatible with Android devices based on the platforms 2.2 and higher.

Contents 1.

Getting Started

2.

SDK Integration

3.

Launching the Interstitials

AppLift SDK V1

Getting Started Requirements: 

Runs only on devices with Android platforms 2.2 or higher



AppID and Secret Token (provided by AppLift)

Getting Started Distributive package consists of two essential containers -

AppLiftSDKRes folder with Android library assistance project

-

appliftsdk.jar

Integrating the AppLift SDK takes the following steps:

1. Import your existing Android project into your Eclipse workspace

2. Import the necessary resources by choosing the AppLiftSDKRes folder included with the SDK.

AppLift SDK V1

3. Click finish. 4. Go to the your project’s properties, open Android category and add reference to the AppLiftSDKRes project in the Library section. Click Apply.

5. Copy appliftsdk.jar into you project’s libs folder.

AppLift SDK V1

SDK Integration Find a place where your activity (from where you’re planning to open

1.

Interstitial screens) starts or resumes to initialize the AppLift SDK.

- it is strongly recommended to initialize it as early as possible in your application, to accomplish the initialization process before any Ad triggering. - for example, the onCreate(Bundle savedInstanceState) method in your activity. This activity should implement AppLiftSDKDelegate interface.

2.

Make sure the import section contains appliftsdk related entries from the

appliftsdk.jar package:

import com.hf.appliftsdk.android.AppLiftSDK; import com.hf.appliftsdk.android.AppLiftSDKDelegate;

3.

Initialize your AppLiftSDK:

AppLiftSDK.init(Context context, this, APP_ID, APP_SECRET); where context - current Context; this – your current activity, the implementor of the AppLiftSDKDelegate interface; APP_ID, APP_SECRET - AppID and Secret Token (provided by AppLift).

AppLift SDK V1 4.

Update your Manifest with next entries:

Permissions: <uses-permission <uses-permission <uses-permission <uses-permission <uses-permission

android:name="android.permission.INTERNET" /> android:name="android.permission.ACCESS_NETWORK_STATE" /> android:name="android.permission.ACCESS_WIFI_STATE" /> android:name="android.permission.WRITE_EXTERNAL_STORAGE" /> android:name="android.permission.READ_PHONE_STATE" />

Activities:

AppLift SDK V1

Launching the Interstitials Our Ad-Units are launched through a smart interstitial which is a screen presenting the one of four (Gifts, Scratch, Slots Machine or Game List) interstitials. The interstitial to be displayed next is defined according to the server side logic. The following code line creates a smart interstitial activity: InterstitialActivity mSmartActivity = AppLiftSDK.getInterstitialActivity(AppLiftInterstitialType.TYPE_SMART);

The following code line shows a Smart interstitial activity:

InterstitialActivity.startActivity(this,mSmartActivity.getParams());

All interstitial activities inherit from it and the usage is always the same for each interstitial. You can present the activity however you want.