Add the Viafoura Android SDK to your app

Add the SDK

Using Gradle

  1. Open your application level 'build.gradle'
  2. Add the 'Viafoura' gradle dependency
implementation 'com.viafoura:android:0.0.1'
  1. Sync your project

Using Maven

<dependency>
  <groupId>com.viafoura</groupId>
  <artifactId>android</artifactId>
  <version>0.0.1</version>
</dependency>

Initialize the SDK

  1. Create an Application class for your app.
  2. Initialize the SDK in the onCreate(). Make sure to replace SITE_UUID and SITE_DOMAIN with the values corresponding to your domain.
public class MyApplication extends Application {
    @Override
    public void onCreate() {
        super.onCreate();

        ViafouraSDK.initialize(getApplicationContext(), "SITE_UUID", "SITE_DOMAIN");
    }
}
class MyApplication: Application() {
    override fun onCreate() {
        super.onCreate()
        ViafouraSDK.initialize(getApplicationContext(), "SITE_UUID", "SITE_DOMAIN")
    }
}

What’s Next