Skip to content

SDK Initialization

Required Parameters:

  • Context: Application context (required)

Initialization Example:

public class ByteriaApplication extends Application {
@Override
public void onCreate() {
super.onCreate();
// Initialize as early as possible, off the main thread
AlphynSDK.initializeAsync(this, error -> {
if (error != null) {
Log.e("Byteria", "Initialization failed: " + error.getMessage());
}
});
}
}

Best Practices:

  • Initialize in Application.onCreate() for best performance
  • Use initializeAsync: initialize returns only once setup has finished, so on the main thread it delays the app’s first frame
  • initializeAsync throws IllegalArgumentException for invalid parameters at the call; any other failure arrives as the callback’s error
  • Check initialization status with AlphynSDK.isInitialized()