Android Setup

1. Add the SDK

You can add the SDK using gradle.

Add our repository in order to download libraries:

repositories {
    maven { url "https://fritz.mycloudrepo.io/public/repositories/android" }
}

Add the gradle dependencies:

dependencies {
    implementation 'ai.fritz:core:4.1.0'
}

2. Add Internet Permissions to Android Manifest

Edit your app’s AndroidManifest.xml to include INTERNET permissions. The model will always run offline and on-device. We require internet permissions to collect performance metrics on the models and improve them over time so that your app always runs smoothly.

<?xml version="1.0" encoding="utf-8"?>
<manifest>
    /*
      ----------------------------------------------
      Add internet permissions
      ----------------------------------------------
    */
    <uses-permission android:name="android.permission.INTERNET" />
    ...

    /*
      ----------------------------------------------
      Runs service to check for model update.
      ----------------------------------------------
    */
    <service
        android:name="ai.fritz.core.FritzCustomModelService"
        android:exported="true"
        android:permission="android.permission.BIND_JOB_SERVICE" />
</manifest>

3. Initialize the SDK onCreate

In your Application or MainActivity class, initialize SDK.

public class MainActivity extends AppCompatActivity {

    private static final String API_KEY = "<your fritz api key>";
    ...
    @Override
    protected void onCreate(Bundle savedInstanceState) {
        Fritz.configure(this, API_KEY);
}

Note

To find your API Key, go to the webapp “Your Project > Project Settings > Your App > Show API Key”