Example app is under example directory, use Android Studio to build and run the app.
Make sure to update serverUrl and token in FILUM.initialize() before running.
Step 1: Clone filum-android-sdk repository
git clone https://github.com/Filum-AI/filum-android-sdkStep 2: Import filum-android-sdk as a module
- In Android Studio, select
File->New->Import Module... - Specify the path to
filum-android-sdk
Step 3: Add filum-android-sdk in build.gradle
- Open
example/build.gradleof your app - Add this line
...
dependencies {
...
implementation project(':filum-android-sdk')
...
}
final FILUM filum = FILUM.initialize(
"http://server-url.example",
"your_project_token",
MainActivity.this
);Use this method right after user has just logged in/signed up or update any of his/her profile info.
filum.identify(userId);Use a string to represent the event name and a JSONObject to contain all custom properties.
// With custom props
try {
JSONObject props = new JSONObject();
props.put("price", 100);
props.put("package_sku", "package_1_free");
filum.track("Purchase", props);
} catch (JSONException e) {
e.printStackTrace();
}
// Without custom props
filum.track("End session");Use this method right after user has just logged out. It will clear the current user_id and
generate new anonymous ID for the new user.
filum.reset();