Expand Minimize Picture-in-picture Power Device Status Voice Recognition Skip Back Skip Forward Minus Plus Play Search
Internet Explorer alert
This browser is not recommended for use with smartdevicelink.com, and may not function properly. Upgrade to a different browser to guarantee support of all features.
close alert
To Top Created with Sketch. To Top
To Bottom Created with Sketch. To Bottom
Android Guides
SDK Configuration

SDK Configuration

1. Get an App Id

An app id is required for production level apps. The app id gives your app special permissions to access vehicle data. If your app does not need to access vehicle data, a dummy app id (i.e. creating a fake id like "1234") is sufficient during the development stage. However, you must get an app id before releasing the app to the public.

To obtain an app id, sign up at smartdevicelink.com.

2. Add Required System Permissions

Some permissions are required to be granted to the SDL app in order for it to work properly. In the AndroidManifest file, we need to ensure we have the following system permissions:

<manifest xmlns:android="http://schemas.android.com/apk/res/android"
    package="com.company.mySdlApplication">

    <uses-permission android:name="android.permission.INTERNET" />
    <uses-permission android:name="android.permission.BLUETOOTH"/>
    <uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
    <uses-permission android:name="android.permission.FOREGROUND_SERVICE" />
    <uses-permission android:name="android.permission.BLUETOOTH_CONNECT"
        tools:targetApi="31"/>
    <uses-permission android:name="android.permission.POST_NOTIFICATIONS"
        tools:targetApi="33"/>
    <uses-permission android:name="android.permission.FOREGROUND_SERVICE_CONNECTED_DEVICE"
        tools:targetApi="34"/>

</manifest>
Note

The following required permissions are runtime permissions, and the developer must request them from the user.

<uses-permission android:name="android.permission.BLUETOOTH_CONNECT"
    tools:targetApi="31"/>
<uses-permission android:name="android.permission.POST_NOTIFICATIONS"
        tools:targetApi="33"/>

3. Add Required SDL Queries

It is required to add the SDL specific entries into the app's queries tag in the AndroidManifest.xml. If the tag already exists, just the intents need to be added. If the tag does not yet exist in the manifest, the tag can be added after the permissions are declared but before the application tag is opened.

<queries>
    <intent>
         <action android:name="com.smartdevicelink.router.service" />
    </intent>
    <intent>
        <action android:name="sdl.router.startservice" />
    </intent>
</queries>

The SDL Android library uses these queries to determine which app should host the router service, what apps to notify when there's an SDL connection, etc. As will be seen in the next sections, these intents are used in the intent filters for the SdlRouterService and the SdlBroadcastReceiver.

View on GitHub.com
Previous Section Next Section