5. Starting Detections

By starting detections, the Sentiance SDK will intelligently detect a user's real-world movements while collecting sensor, location, and motion activity data.

Starting detections is only allowed after a successful initialization. Ideally, this step is done immediately after initialization succeeds, as this will guarantee that the SDK is detecting as early and often as possible.

Call the start() method from the body of OnInitCallback.onInitSuccess():

@Override
public void onInitSuccess() {
    Sentiance.getInstance(context).start(new OnStartFinishedHandler() {
        @Override
        public void onStartFinished (SdkStatus sdkStatus) {
        }
    });
}

You can pass an OnStartFinishedHandler to the start() method to be notified of the start status. The next section explains about this status and handling general status updates.

If you want to have more control over when the Sentiance SDK is doing detections, see controlled detections.

Last updated