ForeSee Developer Portal

Everything you need to configure and optimize your ForeSee products. Home of developer documentation, implementation guides, and release notes.

Blueprint

Getting Started

This guide explains the functionality provided by ForeSee for the Android Software Development Kit (SDK) and shares information on the concepts this SDK leverages. This SDK includes functionality for ForeSee’s base trigger library and Replay.

Basic invite

Basic invite

To add the SDK remotely using Gradle:

  1. Add the following code to your build.gradle file(s):
allprojects {
    repositories {
        jcenter()
    }
}

dependencies {
    implementation 'com.foresee.sdk:sdk:+'
    implementation 'com.foresee.sdk:feedback:+'  // Add this line if you wish to use the Feedback Survey feature
    implementation 'com.google.code.gson:gson:2.6.2'
    implementation 'com.android.support:appcompat-v7:26.1.0'
}

Instrumenting Your Code:

  1. If the application does not have a custom Application class, i.e., a class that extends android.app.Application, you must create one. Ensure that the AndroidManifest.xml file is updated appropriately.
  2. Prepare a foresee_configuration.json file, which contains the configurations of the ForeSee® Android SDK. Check the Configuration article for details on how to set up the Android SDK.

Configuration Tips!

Verify important configuration items, i.e., appName and logo, are defined correctly in the foresee_configuration.json file.

  1. Add the foresee_configuration.json file to the res/raw directory (if there is no directory called raw in the resources directory, you must create that directory). Separate configurations can be specified on a per-locale basis by using the resource folder suffixes, e.g., res/raw-fr. Be sure to include a default res/raw folder as per Android requirements.
  2. Within the onCreate method of the custom Application class, initialize the ForeSee® SDK by invoking ForeSee.start(this). For example, the onCreate() method might look something like the following:
@Override
public void onCreate() {
  super.onCreate();
  ForeSee.start(this);
}
  1. At the point the survey is to be displayed, invoke ForeSee.checkIfEligibleForSurvey() to perform a survey eligibility check. This is usually done on application start and should therefore be placed in the ”entry point” Activity (typically this would be the Activity with the intent filter action of android.intent.action.MAIN and intent filter category of android.intent.category.LAUNCHER). For example, this might be implemented in the onResume() method as follows:
@Override
public void onResume() {
  super.onResume();
  ForeSee.checkIfEligibleForSurvey();
}

To add the SDK locally using Gradle:

  1. Add foresee-sdk-android-core-5.3.0.aar and foresee-sdk-android-sdk-5.3.0.aar to the project libs directory.
    1.1. Optional: If you wish to use the Feedback Survey feature, add foresee-sdk-android-feedback-5.3.0.aar to the project libs directory.

  2. Add the following lines to your build.gradle file(s):

allprojects {
    repositories {
        flatDir{
            dirs 'libs'
        }
    }
}
dependencies {
    implementation (name:'foresee-sdk-android-core-5.3.0', ext:'aar')
    implementation (name:'foresee-sdk-android-sdk-5.3.0', ext:'aar')
    implementation (name:'foresee-sdk-android-feedback-5.3.0', ext:'aar')  // Add this line if you wish to use the Feedback Survey feature
    implementation 'com.google.code.gson:gson:2.6.2'
    implementation 'com.android.support:appcompat-v7:26.1.0'
}

To add the SDK remotely using Maven:

  1. Add the following to your settings.xml file:
<profiles>
    <profile>
        <repositories>
            <repository>
                <snapshots>
                    <enabled>false</enabled>
                </snapshots>
                <id>bintray-foreseemobile-Android</id>
                <name>bintray</name>
                <url>http://foreseemobile.bintray.com/Android</url>
            </repository>
        </repositories>
        <pluginRepositories>
            <pluginRepository>
                <snapshots>
                    <enabled>false</enabled>
                </snapshots>
                <id>bintray-foreseemobile-Android</id>
                <name>bintray-plugins</name>
                <url>http://foreseemobile.bintray.com/Android</url>
            </pluginRepository>
        </pluginRepositories>
        <id>bintray</id>
    </profile>
</profiles>
<activeProfiles>
    <activeProfile>bintray</activeProfile>
</activeProfiles>
<dependencies>
  <dependency>
    <groupId>com.foresee.sdk</groupId>
    <artifactId>core</artifactId>
    <version>5.3.0</version>
    <type>pom</type>
  </dependency>
  <dependency>
    <groupId>com.foresee.sdk</groupId>
    <artifactId>sdk</artifactId>
    <version>5.3.0</version>
    <type>pom</type>
  </dependency>
  <dependency>
    <groupId>com.google.code.gson</groupId>
    <artifactId>gson</artifactId>
    <version>2.6.2</version>
    <scope>compile</scope>
  </dependency>
  <dependency>
    <groupId>com.android.support</groupId>
    <artifactId>appcompat-v7</artifactId>
    <version>26.1.0</version>
    <scope>compile</scope>
  </dependency>
<dependencies>

Getting Started


This guide explains the functionality provided by ForeSee for the Android Software Development Kit (SDK) and shares information on the concepts this SDK leverages. This SDK includes functionality for ForeSee’s base trigger library and Replay.

Suggested Edits are limited on API Reference Pages

You can only suggest edits to Markdown body content, but not to the API spec.