Configuration

In API 2.0 configuration of the SDK is done using preferences and it is not tied to the setup.

API key

Pre API 2.0

Smartlook.setupAndStartRecording("YOUR_API_KEY")
Smartlook.setupAndStartRecording("YOUR_API_KEY");

API 2.0

Smartlook.instance.preference.projectKey = "YOUR PROJECT KEY"
Smartlook.getInstance().getPreferences().setProjectKey("YOUR PROJECT KEY");

Project key documentation.

Frame rate

Pre API 2.0

val builder = Smartlook.SetupOptionsBuilder("YOUR_API_KEY")
        .setFps(2)

Smartlook.setupAndStartRecording(builder.build())
Smartlook.SetupOptionsBuilder builder = new Smartlook.SetupOptionsBuilder("YOUR_API_KEY")
        .setFps(2);

Smartlook.setupAndStartRecording(builder.build());

API 2.0

Smartlook.instance.preferences.frameRate = 2
Smartlook.getInstance().getPreferences().setframeRate(2);

Frame rate documentation.

Rendering mode

Pre API 2.0

// Setup configuration
val builder = Smartlook.SetupOptionsBuilder("YOUR_API_KEY")
        .setRenderingMode(RenderingMode.NATIVE)

Smartlook.setupAndStartRecording(builder.build())

// Runtime configuration
Smartlook.setRenderingMode(RenderingMode.NATIVE)
// Setup configuration
Smartlook.SetupOptionsBuilder builder = new Smartlook.SetupOptionsBuilder("YOUR_API_KEY")
        .setRenderingMode(RenderingMode.NATIVE);

Smartlook.setupAndStartRecording(builder.build());

// Runtime configuration
Smartlook.setRenderingMode(RenderingMode.NATIVE);

API 2.0

Smartlook.instance.preferences.renderingMode = RenderingMode.NATIVE
Smartlook.getInstance().getPreferences().setRenderingMode(RenderingMode.NATIVE);

Rendering mode documentation.

Rendering mode option

Pre API 2.0

// Setup configuration
val builder = Smartlook.SetupOptionsBuilder("YOUR_API_KEY")
        .setRenderingModeOption(RenderingModeOption.WIREFRAME)

Smartlook.setupAndStartRecording(builder.build())

// Runtime configuration
Smartlook.setRenderingModeOption(RenderingModeOption.WIREFRAME)
// Setup configuration
Smartlook.SetupOptionsBuilder builder = new Smartlook.SetupOptionsBuilder("YOUR_API_KEY")
        .setRenderingModeOption(RenderingModeOption.WIREFRAME);

Smartlook.setupAndStartRecording(builder.build());

// Runtime configuration
Smartlook.setRenderingModeOption(RenderingModeOption.WIREFRAME);

API 2.0

Smartlook.instance.preferences.renderingModeOption = RenderingModeOption.WIREFRAME
Smartlook.getInstance().getPreferences().setRenderingModeOption(RenderingModeOption.WIREFRAME);

Rendering mode option documentation.

Experimental flag

Pre API 2.0

val builder = Smartlook.SetupOptionsBuilder("YOUR_API_KEY")
        .setExperimental(true)

Smartlook.setupAndStartRecording(builder.build())
Smartlook.SetupOptionsBuilder builder = new Smartlook.SetupOptionsBuilder("YOUR_API_KEY")
        .setExperimental(true);

Smartlook.setupAndStartRecording(builder.build());

API 2.0

Experimental flag was renamed to Surface recording so it better describes its functionality. That is to enable the recording of TextureView and SurfaceView.

Smartlook.instance.preferences.isSurfaceRecordingEnabled = true
Smartlook.getInstance().getPreferences().setSurfaceRecordingEnabled(true);

Surface recording documentation.

Adaptive frame rate

Pre API 2.0

val builder = Smartlook.SetupOptionsBuilder("YOUR_API_KEY")
        .useAdaptiveFramerate(true)

Smartlook.setupAndStartRecording(builder.build())
Smartlook.SetupOptionsBuilder builder = new Smartlook.SetupOptionsBuilder("YOUR_API_KEY")
        .useAdaptiveFramerate(true);

Smartlook.setupAndStartRecording(builder.build());

API 2.0

Smartlook.instance.preferences.isAdaptiveFrameRateEnabled = true
Smartlook.getInstance().getPreferences().setAdaptiveFrameRateEnabled(true);

Adaptive frame rate documentation.

Set activity (setup outside Application class)

Pre API 2.0

val builder = Smartlook.SetupOptionsBuilder("YOUR_API_KEY")
        .setActivity(sampleActivity)

Smartlook.setupAndStartRecording(builder.build())
Smartlook.SetupOptionsBuilder builder = new Smartlook.SetupOptionsBuilder("YOUR_API_KEY")
        .setActivity(sampleActivity);

Smartlook.setupAndStartRecording(builder.build());

API 2.0

Because SDK is set up automatically and project key can be set after recording is started, this API is no longer needed and was removed.

Start recording and project key documentation.

Event tracking modes

Pre API 2.0

// Setup configuration
val builder = Smartlook.SetupOptionsBuilder("YOUR_API_KEY")
        .setEventTrackingModes(eventTrackingModes: List<EventTrackingMode>)

Smartlook.setupAndStartRecording(builder.build())

// Runtime configuration
Smartlook.setEventTrackingMode(eventTrackingMode: EventTrackingMode)
Smartlook.setEventTrackingModes(eventTrackingModes: List<EventTrackingMode>)
// Setup configuration
Smartlook.SetupOptionsBuilder builder = new Smartlook.SetupOptionsBuilder("YOUR_API_KEY")
        .setEventTrackingModes(List<EventTrackingMode> eventTrackingModes);

Smartlook.setupAndStartRecording(builder.build());

// Runtime configuration
Smartlook.setEventTrackingMode(EventTrackingMode eventTrackingMode);
Smartlook.setEventTrackingModes(List<EventTrackingMode> eventTrackingModes);

API 2.0

Former event tracking modes are set not as a list of "flags", with an easy-to-use API documented here.