Setting Up the SDK

The purpose of this section is to explain the components of the Koupon Media SDK and to help you configure it for use with an existing Android app. We assume that you have already downloaded the Koupon Media SDK (or our starter Eclipse project if you do not have an existing app), and if applicable, the Gimble SDK.

Add the Koupon Media jar File to your Android Application

If you are also using the Gimbal SDK, refer to the documentation included in the Gimbal SDK package for instructions on adding requisite jar files.

Configure properties File

In order for your Android app to use the Koupon Media SDK (and, optionally, the Gimbal APIs), it must authenticate using your API key, name, and desired capabilities. To configure the Koupon Media SDK properties file, follow the steps below.

If it doesn’t already exist, create a folder named properties and place it in your Android project’s assets folder (so your path should be /assets/properties).

Create a file named kouponconfiguration.properties and place it in assets/properties.

This is your channel that will sort offers only available for that channel.

Optional

domain

Specify if testing on a non-production server

Optional

appEventDomain

Specify if testing on a non-production server

Optional

gcmSenderId

Specify for GCM

Optional

geofenceEnabled

Specify for geofencing

The Koupon Media SDK supports production and non-production environments. During the integration and testing phases of application development, it is necessary to ensure the proper endpoint URL is used for the intended environment. If this value is not set, then the SDK will default to using the production environment.

(Optional) Configuring your Properties File for Gimbal

If you are also utilizing the Gimbal SDK, you need to create a second properties file within assets/properties and name it usercontext.properties. Inside this file, you must add the following entries:

Tells Gimbal that you will be using its geofencing capabilities (this is case-sensitive)

By default, when you enable the SDK using enable(), a Gimbal branded dialog containing the end user consent, privacy notice and terms of service will be presented to the end user. However, you have the choice to display your own privacy notice and end user opt-in consent in lieu of the Gimbal branded dialog. Important You will be bound by the “White Label Mode” terms within the Gimbal Developer Agreement.

To use this feature, simply add the property custom.opt.in.flow=true to usercontext.properties file.

Please refer to the documentation included in the Gimbal SDK package for additional information.

Update the AndroidManifest.xml File

To allow Koupon Media and related push notifications to function in your Android application, you’ll need to add the following elements to your AndroidManifest.xml file (between the <application> </application> tags).

Please refer to the documentation included in the Gimbal SDK package for additional information.

Obtaining a Consumer Identity

Next, you need to update MainActivity.java (src/com.companyname.applicationname/MainActivity.java), which should have been generated automatically when you created your Android project. There are two options for obtaining a consumer’s identity. Please refer to the use cases below and add the corresponding code inside your onCreate method.