This library allows you to use Personyze system on Android devices.
See reference manual.
See also:
- Personyze Android SDK
- Personyze Android SDK Demo app
- Personyze iOS SDK
- Personyze iOS SDK Demo app
- First you need to download the SDK files from here.
- Start Android Studio. This guide was using Android Studio version 2021.2.1. Create new project. Select “Phone and Tablet” > “Empty Activity” and click “Next”.
- Enter desired project name, or leave as suggested and click “Finish”.
- Unzip the SDK. There must be directory called “personyzeandroidsdk”. Put it to the project root directory.
- In the Project window on the left, where project files are listed, notice “Gradle Scripts”, expand it and edit the “settings.gradle” file.
Initially this file ends with such line:
include ':app'
Change this line to:
include ':app', ':personyzeandroidsdk'
- The IDE will prompt to sync the file. Click “Sync Now”.
- Find “app/build.gradle” file. This file starts with this line: “plugins { id 'com.android.application' }”. In the “dependencies” section add this line:
implementation project(path: ':personyzeandroidsdk')
- The IDE again will prompt to sync the file, so do it again.
- Your app must have INTERNET permission, so add it. In the “app/src/main/AndroidManifest.xml” file, in
<manifest>
tag, add:
<uses-permission android:name="android.permission.INTERNET" />
- Some applications also will need to add the following “uses-library” to “app/src/main/AndroidManifest.xml”:
<application
...>
<uses-library
android:name="org.apache.http.legacy"
android:required="false" />
This is according to Apache HTTP Legacy library
- Now the SDK must be usable.
To be sure add this code to your MainActivity, or elsewhere:
PersonyzeTracker.inst.initialize(this, "0011223344556677889900112233445566778899");
PersonyzeTracker.inst.navigate("MainActivity");
PersonyzeTracker.inst.done();
Use your API key instead of “0011223344556677889900112233445566778899”. API keys for your account can be found on Personyze in the “Settings” → “Integrations” page. You need the full-featured key.
The code above logs a navigation to page called “MainActivity”.
You can look up this request on Personyze Live Visits Dashboard. In filters, select “Pages” → “only containing” → “MainActivity”.
See this guide.