Skip to content

Android manifest settings

This document lists the manifest settings that come with the Android SDK and what they do.

Version

The following line controls the version of the Android OS that will work with the application, we don’t recommend changing it. But you can increase “minSdkVersion” if you don’t mind losing backward compatibility with older devices.

<uses-sdk android:targetSdkVersion="31" android:minSdkVersion="21"/>

Used features

Our SDK don’t use GPS for indoor location, but uses it for outdoor location, enabled by default. If you removed this permission, there won’t be any positioning outdoors.

<uses-feature android:required="false" android:name="android.hardware.location.gps"/>

Permissions

We have a detailed article about permissions needed by the SDK, here we will list some permissions that you might need to change for specific reasons.

Network state changes

These two permissions check the state of connections. Network state permission is needed when the SDK launches. It verifies if the network is available when attempting to do a license check and the SDK will crash if the permission is not present.

<uses-permission android:name="android.permission.ACCESS_WIFI_STATE"/>
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE"/>

Keep CPU on

This permission ensures location can remain being calculated accurately when device considers itself to be in idle state (for example in situations where normally the device would shut down the screen or lock itself automatically). Without this permission as soon the Android device considers itself “idle” it will shut down the CPU, Screen, or both.

<uses-permission android:name="android.permission.WAKE_LOCK" />

Allow beacon scanner to start after device is ready

This permission is needed so that the beacon scanner algorithm is notified when it is allowed to start scanning and looking for beacons.

<uses-permission android:name="android.permission.RECEIVE_BOOT_COMPLETED"/>

Bluetooth scan

This only applies to Android 11 Red Velvet Cake (API level 30) and earlier.

<uses-permission android:name="android.permission.BLUETOOTH" android:maxSdkVersion="30"/>
<uses-permission android:name="android.permission.BLUETOOTH_ADMIN" android:maxSdkVersion="30"/>

This only applies to Android 12 Snow Cone (API level 31) and later.

<uses-permission android:name="android.permission.BLUETOOTH_SCAN" />
<uses-permission android:name="android.permission.BLUETOOTH_CONNECT" />

Location permissions

The following permission are needed to calculate location, even if not using Bluetooth. Keep in mind the “fine location” is mandatory if bluetooth is being used for location, “coarse” permission is not enough.

<uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION"/>
<uses-permission android:name="android.permission.ACCESS_FINE_LOCATION"/>

Background location access

This only applies to Android 10 Quince Tart (API level 29) and later. This is required for background location and required for Geofencing.

<uses-permission android:name="android.permission.ACCESS_BACKGROUND_LOCATION" />

HTTPS requests

The SDK communicates with Pointr Cloud using HTTPS, this includes license validation. If you remove these lines from your manifest, the SDK will fail to launch.

<uses-permission android:name="android.permission.INTERNET"/>

Foreground service

This is required for two main things, one is geofencing, since it requires constant monitoring of the position to trigger the events, a service (foreground or background) is needed. The second thing is for listening positions on the background for any reason, to do that it is necessary to start as foreground service first.

<uses-permission android:name="android.permission.FOREGROUND_SERVICE" />

Receivers and intent filters

Startup broadcast receiver

This receiver purpose is wake up the services again if Android optmization disabled them.

A particularly important intent filter there is the STATE_CHANGED on the Bluetooth Adapter, it is needed to make sure the adapter is working correctly, sometimes the adapter has issues and the SDK attempts to powercycle it to fix them. If you remove that filter your application might get in a state where the Bluetooth of the device is stuck in some error condition or invalid state.

<receiver android:name="com.pointrlabs.core.receiver.StartupBroadcastReceiver" android:exported="true">
    <intent-filter>
        <action android:name="android.intent.action.BOOT_COMPLETED"/>
        <action android:name="android.intent.action.ACTION_POWER_CONNECTED"/>
        <action android:name="android.intent.action.ACTION_POWER_DISCONNECTED"/>
        <action android:name="android.bluetooth.adapter.action.STATE_CHANGED"/>
    </intent-filter>
</receiver>

Geofence receiver

This receiver is used to make geofencing events work. If you remove it, you will miss geofencing events.

<receiver android:name="com.pointrlabs.core.receiver.GpsGeofenceBroadcastReceiver" android:exported="false"/>

Boot receiver

This receiver allows the foreground service to start a Pointr SDK instance after boot is completed.

<receiver android:name="com.pointrlabs.core.receiver.BootCompletedIntentReceiver" android:exported="true">
    <intent-filter>
        <action android:name="android.intent.action.BOOT_COMPLETED"/>
    </intent-filter>
</receiver>

Gps broadcast receiver

<receiver android:name="com.pointrlabs.core.receiver.GpsBroadcastReceiver" android:exported="true"/>

Location provider changed

This receiver purpose is detect when the SDK switched from GPS to BLE and vice-versa.

<receiver android:name="com.pointrlabs.core.receiver.LocationProviderChangeReceiver" android:exported="false">
    <intent-filter>
        <action android:name="android.location.PROVIDERS_CHANGED"/>
        <action android:name="android.location.MODE_CHANGED"/>
    </intent-filter>
</receiver>

Launch as location foreground service

The following line of the manifest is mandatory on devices running Android 10 Quince Tart (API Level 29) and later in situations where location service is needed.

Without this line the Android operating systems using API Levle 29 or more will assume the application is using background location service if it attempts to use location, and will kill the application automatically unless it also has ACCESS_BACKGROUND_LOCATION permission and meets other requeriments for background location.

<service android:name="com.pointrlabs.core.service.PointrService" android:exported="false" android:foregroundServiceType="location|connectedDevice"/>

Last update: December 19, 2023
Back to top