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 Documentation

Class SdlDeviceListener





SdlDeviceListener( Context context, BluetoothDevice device, SdlDeviceListener.Callback callback )

public SdlDeviceListener(Context context,BluetoothDevice device,SdlDeviceListener.Callback callback)

Constructor Parameters




This will start the SDL Device Listener with two paths. The first path will be a check against the supplied bluetooth device to see if it has already successfully connected as an SDL device. If it has, the supplied callback will be called immediately. If the device hasn't connected as an SDL device before, the SDL Device Listener will then open up an RFCOMM channel using the SDL UUID and await a potential connection. A timeout is used to ensure this only listens for a finite amount of time. If this is the first time the device has been seen, this will listen for 30 seconds, if it is not, this will listen for 15 seconds instead.

public void start()


Check to see if this instance is in the middle of running or not

public boolean isRunning()

setSDLConnectedStatus( Context context, String address, boolean hasSDLConnected )

Set the connection establishment status of the particular device

public static void setSDLConnectedStatus(Context context,String address,boolean hasSDLConnected)

Method Parameters

address of the device in question
true if a connection has been established, false if not

hasSDLConnected( Context context, String address )

Checks to see if a device address has connected to SDL before.

public static boolean hasSDLConnected(Context context,String address)

Method Parameters

the mac address of the device in question

isFeatureSupported( java.util.List<com.smartdevicelink.util.SdlAppInfo> sdlAppInfoList )

This method will check the current device and list of SDL enabled apps to derive if the feature can be supported. Due to older libraries sending their intents to start the router service right at the bluetooth A2DP/HFS connections, this feature can't be used until all applications are updated to the point they include the feature.

public static boolean isFeatureSupported(java.util.List<com.smartdevicelink.util.SdlAppInfo> sdlAppInfoList)

Method Parameters

current list of SDL enabled applications on the device

Inherited Methods

From Class Methods
java.lang.Object getClass, hashCode, equals, clone, toString, notify, notifyAll, wait, wait, wait, finalize
View on GitHub.com
Previous Section Next Section