Introduction

Prerequisites

  • Java Development Kit (JDK) 1.6.

  • Android SDK.

  • This library currently supports Android 2.3.3 and higher.

  • An IDE (like Eclipse or Android Studio), with ADT installed.

Get an Application Key

Request a new application key to the Kiwi Team

Import the library

Using gradle

Include the import on your build.gradle file:

compile ('com.movile.kiwi:kiwi-sdk-android:VERSION@aar') {
    transitive = true
}

Using jar

Get the lastest version of jar:

Put the jar on your project's library folder and add to the classpath.

When using jar, you need to resolve the dependencies manually:

  • com.google.android.gms:play-services-gcm:8.1.0 (or newer)

  • com.google.android.gms:play-services-ads:8.1.0 (or newer)

  • com.android.support:support-v4:23.1.0 (or newer)

Enabling debug logs

Proguard

If you are using proguard into your app, add the following configuration:

Create the file named proguard-kiwi.pro and add the following content:

Configure Android Manifest

You can use the follow template to configure your app. Note: Remember to replace the values:

  • <APPLICATION_KEY> with the provided Kiwi Application Key;

  • <BACKUP_KEY> that must be generated on https://developer.android.com/google/backup/signup.html?&csw=1

  • <PACKAGE_NAME> your app package name;

Initialize the Library

You must initialize the library on your application, as following:

You must store the KiwiSDK instance to use in your app. You can build a new instance if needed.

Warnings

  • Every callback method will run on an isolated thread, other than the thread that initially called the method. For example, when the application calls kiwiSDK.services().discoverCurrentCountry(new MyDiscoverGeolocationListener()); on the main Thread, the onSucess() callback will run on a different Thread, so the application cannot directly perform an UI operation inside it.

What's next

You are now ready to start using kiwi! Next we recommend read the Analytics guide or User guide to learn more about kiwi.

Last updated