# SdkStatus

This class exposes the status of the Sentiance SDK. You can get an instance of this object in two ways.

* Using [`SdkStatusUpdateListener`](/important-topics/sdk/api-reference/android/sdkstatusupdatelistener.md) as explained in the [SDK Status Updates](/a-complete-integration/android-sdk/sdk-status-updates.md) step of the quick start guide;
* using the [`getSdkStatus()`](/important-topics/sdk/api-reference/android/sentiance.md#getsdkstatus) method.

A sample [`OnSdkStatusUpdateHandler`](/important-topics/sdk/api-reference/android/onsdkstatusupdatehandler.md) implementation can be found on our [Github](https://github.com/sentiance/sample-apps-android/blob/main/app/src/main/java/com/example/sentiancesdksample_app_android/SdkStatusUpdateHandler.kt).

## SdkStatus API

### `detectionStatus`

> A [`detectionStatus`](/important-topics/sdk/api-reference/android/detectionstatus.md) enum representing the detection status of the SDK.

### `startStatus` *(deprecated)*

{% hint style="warning" %}
**Deprecated**

Use `detectionStatus` instead.
{% endhint %}

> A [`StartStatus`](/important-topics/sdk/api-reference/android/sdkstatus/startstatus.md) enum representing the start state of the SDK detections.

### `canDetect`

> A synthesis of the following fields, indicating whether the conditions are suitable for the SDK to run its detections:
>
> * isRemoteEnabled
> * locationPermission
> * locationSetting
> * isGpsPresent
> * isGooglePlayServicesMissing
> * isAirplaneModeEnabled
> * isPreciseLocationPermGranted
> * isLocationAvailable
> * diskQuotaStatus
> * isBackgroundProcessingRestricted

### `isRemoteEnabled`

> Whether the user is enabled on the Sentiance Platform. By default, all users are enabled on the Sentiance Platform. A user may get disabled during creation if, for example, the device is a tablet and the same user already exists on a phone. Sentiance can also disable users selectively under certain conditions (e.g. due to a misbehaving SDK).
>
> An enabled user is required to do detections.

### `isPreciseLocationPermGranted`

> Whether the user has granted precise location permission to the app. See [approximate location](https://developer.android.com/about/versions/12/approximate-location).
>
> Precise location permission is required to do detections.

### `isActivityRecognitionPermGranted`

> Whether the activity recognition permission has been granted.

### `locationSetting`

> A [`LocationSetting`](/important-topics/sdk/api-reference/android/sdkstatus/locationsetting.md) enum representing the location setting currently set in the device settings.
>
> A location setting of `OK` is required to do detections.

### `isAirplaneModeEnabled`

> Whether the device is in airplane mode.
>
> Airplane mode must be disabled to do detections.

### `isLocationAvailable`

> The SDK's location availability state.
>
> Generally, when the device location setting is in an acceptable state, and all required location related permissions are granted, this property will be `true`. However, under certain conditions, location data may still be unavailable, in which case this property will be `false`. Once location data becomes available again, the SDK will automatically update this property and resume detections if possible.
>
> Note that it can take up to 30 seconds for a change in the device's location settings or permission to take effect on SDK's location availability state.

### `isAccelPresent`

> Whether the device has an accelerometer.

### `isGyroPresent`

> Whether the device has a gyroscope.

### `isGpsPresent`

> Whether the device has a GPS.
>
> A GPS is required to do detections.

### `isGooglePlayServicesMissing`

> Whether Google Play Services is missing.
>
> Google Play Services is required to do detections.

### `isBatteryOptimizationEnabled`

> Whether [battery optimization](https://github.com/sentiance/v4-docs/blob/main/sdk/api-reference/android/sdkstatus/broken-reference/README.md) is enabled for the application.
>
> On some devices, battery optimization can have a negative impact on apps running in the background. This is due to OEM specific customizations of Android's battery optimization feature. As such, disabling battery optimization is generally recommended for quality detections, if possible.

### `isBatterySavingEnabled`

> Whether battery saving is enabled on the device.
>
> When battery saving is enabled, it can have a negative impact on apps running in the background. As a result, SDK detection quality may be impacted.

### `isBackgroundProcessingRestricted`

> Whether background processing is [restricted](https://developer.android.com/reference/android/app/ActivityManager#isBackgroundRestricted\(\)) for the application. This will be set to `false` for devices running Oreo and lower.
>
> Unrestricted background processing is required to do detections.

### `isSchedulingExactAlarmsPermitted`

> Whether scheduling exact alarms is permitted. This is normally permitted, unless the user has manually revoked the permission from the device settings. When the permission is not granted, it can have a negative impact on the detection quality.

### `locationPermission`

> A [`LocationPermission`](/important-topics/sdk/api-reference/android/sdkconfig/locationpermission.md) enum representing the location accessibility permission.
>
> Under most circumstances, an `ALWAYS` permission is required to do detections.

### `wifiQuotaStatus`

> A [`QuotaStatus`](/important-topics/sdk/api-reference/android/sdkstatus/quota-status.md) enum representing the WiFi quota status of the SDK.
>
> The actual usages and limits in bytes can be obtained using the [`getWiFiQuotaUsage()`](/important-topics/sdk/api-reference/android/sentiance.md#getwifiquotausage), [`getWiFiQuotaLimit()`](/important-topics/sdk/api-reference/android/sentiance.md#getwifiquotalimit).
>
> Sentiance assigns a limited quota for the SDK to utilized over a period 30 days (sliding window). Once the quota is exceeded, data submission over WiFi stops. The default quota is 2048 MB, but is configurable by Sentiance.

### `mobileQuotaStatus`

> A [`QuotaStatus`](/important-topics/sdk/api-reference/android/sdkstatus/quota-status.md) enum representing the mobile data quota status of the SDK.
>
> The actual usages and limits in bytes can be obtained using the [`getMobileQuotaUsage()`](/important-topics/sdk/api-reference/android/sentiance.md#getmobilequotausage), [`getMobileQuotaLimit()`](/important-topics/sdk/api-reference/android/sentiance.md#getmobilequotalimit).
>
> Sentiance assigns a limited quota for the SDK to utilized over a period of 30 days (sliding window). Once the quota is exceeded, data submission over mobile data stops. The default quota is 250 MB, but is configurable by Sentiance.

### `diskQuotaStatus`

> A [`QuotaStatus`](/important-topics/sdk/api-reference/android/sdkstatus/quota-status.md) enum representing the disk quota status of the SDK.
>
> The actual usages and limits in bytes can be obtained using the [`getDiskQuotaUsage()`](/important-topics/sdk/api-reference/android/sentiance.md#getdiskquotausage), [`getDiskQuotaLimit()`](/important-topics/sdk/api-reference/android/sentiance.md#getdiskquotalimit).
>
> Sentiance assigns a limited quota for the SDK to utilized. Once the quota is exceeded, SDK detections stop. The default quota is 128 MB, but is configurable by Sentiance.


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.sentiance.com/important-topics/sdk/api-reference/android/sdkstatus.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
