Set Permissions for BLE API
July 23, 2015

SCiO Apps require Bluetooth in order to communicate between the SCiO Sensor and a smartphone.

In order to use the Bluetooth Low Energy (BLE) API in your app, you must add Bluetooth permissions to the AndroidManifest.xml file as follows:

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

Important: Be sure to add the permissions to the root and not to the application node.

In order to use the SCiO API login functionality, you must add the following setting to the application node of the AndroidManifest.xml file:

<activity android:name="com.consumerphysics.android.sdk.sciosdk.ScioLoginActivity" />

The manifest should be similar to the following example:

<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="consumerphysics.com.myscioapplication" >
    <uses-permission android:name="android.permission.BLUETOOTH" />
    <uses-permission android:name="android.permission.BLUETOOTH_ADMIN" />
    <uses-permission android:name="android.permission.INTERNET" />
    <uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
 
    <application
            android:allowBackup="true"
            android:icon="@mipmap/ic_launcher"
            android:label="@string/app_name"
            android:theme="@style/AppTheme" >

            <activity
                android:name=".MainActivity"
                android:label="@string/app_name" >
                <intent-filter>
                    <action android:name="android.intent.action.MAIN" />
                    <category android:name="android.intent.category.LAUNCHER" />
                </intent-filter>
            </activity>
        <activity android:name="com.consumerphysics.android.sdk.sciosdk.ScioLoginActivity" />
    </application>
</manifest>

Congratulations! You are now ready to start developing your app.

Leave a Reply