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 AndroidTools






public AndroidTools()


isServiceExported( Context context, ComponentName name )

Check to see if a component is exported

public static boolean isServiceExported(Context context,ComponentName name)

Method Parameters

object used to retrieve the package manager
of the component in question

getSdlEnabledApps( Context context, String myPackageName )

Get all SDL enabled apps. If the package name is null, it will return all apps. However, if the package name is included, the resulting hash map will not include the app with that package name.

public static java.util.HashMap getSdlEnabledApps(Context context,String myPackageName)

Method Parameters

a context object used to get an instance of the package manager
the package of the requesting app. This should only be included if the app wants to exclude itself from the map

querySdlAppInfo( Context context, java.util.Comparator<com.smartdevicelink.util.SdlAppInfo> comparator )

Finds all SDL apps via their SdlRouterService manifest entry. It will return the metadata associated with that router service.

public static java.util.List querySdlAppInfo(Context context,java.util.Comparator<com.smartdevicelink.util.SdlAppInfo> comparator)

Method Parameters

a context instance to obtain the package manager
the Comparator to sort the resulting list. If null is supplied, they will be returned as they are from the system

sendExplicitBroadcast( Context context, Intent intent, java.util.List<android.content.pm.ResolveInfo> apps )

Sends the provided intent to the specified destinations making it an explicit intent, rather than an implicit intent. A direct replacement of sendBroadcast(Intent). As of Android 8.0 (API 26+) implicit broadcasts are no longer sent to broadcast receivers that are declared via the AndroidManifest. If no apps are found to receive the intent, this method will send the broadcast implicitly if no list of apps is provided.

public static void sendExplicitBroadcast(Context context,Intent intent,java.util.List<android.content.pm.ResolveInfo> apps)

Method Parameters

- the intent to send explicitly
- the list of apps that this broadcast will be sent to. If null is passed in the intent will be sent to all apps that match the provided intent via a query to the package manager; it will also be sent implicitly to mimic sendBroadcast()'s original functionality.

isUSBCableConnected( Context context )

Checks if the usb cable is physically connected or not Note: the intent here is a sticky intent so registerReceiver is actually a synchronous call and doesn't register a receiver on each call

public static boolean isUSBCableConnected(Context context)

Method Parameters

a context instance

downloadImage( String urlStr )

public static android.graphics.Bitmap downloadImage(String urlStr) throws java.io.IOException

Method Parameters



  • java.io.IOException

isDebugMode( Context context )

public static boolean isDebugMode(Context context)

Method Parameters


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