Skip to content

Android SDK Setup

Somya Arora edited this page Mar 20, 2017 · 48 revisions

We are still working on setting up our Nexus Repositories. Please download our AAR bundles to integrate our SDK.

Step 1

Download Core Library

Download AppsFlyCore.AAR

Core is library have all the libraries to run Appsfly Plugins.

Step 2

Download MicroApp Library

Download AppsFlyMicroApps.AAR

This library has the dependency on Core Library. This will enable developer to fly in MicroApps into the user's context of his application.

Note: if you are not gonna use MicroApps in your application you can skip Step 2.

Step 3

Add Dependencies to your gradle

compile 'com.squareup.duktape:duktape-android:0.9.6'
compile 'net.steamcrafted:materialiconlib:1.0.9'
compile 'com.google.android:flexbox:+'
compile 'com.android.support:design:+'
compile 'com.android.support:appcompat-v7:+'
compile 'com.google.android.gms:play-services-maps:+'
compile 'com.google.android.gms:play-services-places:+'
compile 'net.steamcrafted:materialiconlib:1.0.9'

You can skip step 3 if you are not including MicroApp SDK. Note: Sorry for the inconvenience due to these extra dependencies. There is no need to manage these dependencies once our Nexus repos are in place.

Step 4

Initialize runtime with microApp configurations

Override your Application Instance's

@Override
public void onCreate() {
	super.onCreate();
	String repoUrl = "REPO_URL"; // Current repo url is 'http://s3-ap-southeast-1.amazonaws.com/repo.appsfly.io'
	String projectId = "PROJECT_ID"; // Project under which MicroApp is created
	String microAppId = "MICROAPP_ID"; // MicroApp Id
	String associationKey = "YOUR_ASSOCIATION_KEY"; // Association key created on the dashboard
	ArrayList<AppsFlyClientConfig> appsFlyClientConfigs = new ArrayList<AppsFlyClientConfig>();
	AppsFlyClientConfig appsflyConfig = new AppsFlyClientConfig(projectId, microAppId,  associationKey, repoUrl);
	appsFlyClientConfigs.add(appsflyConfig);
	AppsFlyProvider.getInstance().initialize(appsFlyClientConfigs, this);
}

Note: This will start the process of syncing MicroApp Metadata required to run MicroApp in your application. PROJECT_ID, MICROAPP_ID & ASSOCIATION_KEY can be obtained from MicroApp Service Provider.

Step 4

Fly in MicroApp into context of user

You can present the MicroApp by running the following snippet anywhere you want.

AppsFlyProvider.getInstance().presentApp("MICROAPP_ID", "ASSOCIATION_ID", "INTENT", new JSONObject("USER_CONTEXT_IN_JSON_FORMAT"), context);

Note: This step will create a overlay activity showing the MicroApp.

Note:

Currently, this documentation is in beta phase and is being updated regularly. It aims to ensure a smooth integration of AppsFly SDK into your projects. For any suggestions or to report any issues with the information mentioned here, please contact [email protected]

-Team AppsFly.io

Clone this wiki locally