Constants | ||
---|---|---|
int | INVALID_ID | Invalid id |
Public Constructors | |
---|---|
ExtensionUtils() |
Public Methods | |
---|---|
static void |
drawText(Canvas canvas, java.lang.String text, float x, float y, TextPaint textPaint, int availableWidth)
Draw text on canvas. |
static java.lang.String |
getUriString(Context context, int resourceId)
Get URI string from resourceId. |
static boolean |
areAnyAccessoriesConnected(Context context)
Check in the database if there are any accessories connected. |
static java.lang.String |
getContactName(Context context, Uri contactUri)
Get the contact name from a URI. |
static Bitmap |
getContactPhoto(Context context, Uri contactUri)
Get the contact photo from a contact URI. |
static Bitmap |
getBitmapFromUri(Context context, java.lang.String uriString)
Get bitmap from a URI. |
static long |
getExtensionId(Context context)
Get id of a registered extension |
static long |
getRegistrationId(Context context, java.lang.String hostAppPackageName, long extensionId)
Get id of a registered extension |
static boolean |
supportsHistory(Intent intent)
Get the value of the intent extra parameter EXTRA_ACCESSORY_SUPPORTS_HISTORY from the intent that started the configuration activity. |
static boolean |
supportsActions(Intent intent)
Get the value of the intent extra parameter EXTRA_ACCESSORY_SUPPORTS_ACTIONS from the intent that started the configuration activity. |
static java.lang.String |
getFormattedTime(long publishedTime)
Get formatted time. |
static int |
getRegistrationVersion(Context context)
Get the version of the registration API that is implemented by the current phone/tablet the extension is running on. |
static boolean |
hasIsEmulatedColumnInDisplayTable(Context context)
Check if the IS_EMULATED column is present in the Registration.Display table in the registration API. |
Invalid id
Constant Value: -1 (0xffffffffffffffff)
Draw text on canvas. Shade if text too long to fit.
canvas | The canvas to draw in. |
---|---|
text | The text to draw. |
x | The x coordinate. |
y | The y coordinate. |
textPaint | The paint to draw with. |
availableWidth | The available width for the text |
Get URI string from resourceId.
context | The context. |
---|---|
resourceId | The resource id. |
The URI string.
Check in the database if there are any accessories connected.
context | The context |
---|
True if at least one accessories is connected.
Get the contact name from a URI.
context | The context. |
---|---|
contactUri | The contact URI. |
The contact name.
Get the contact photo from a contact URI.
context | The context. |
---|---|
contactUri | The contact URI. |
The contact photo.
Get bitmap from a URI.
context | The context. |
---|---|
uriString | The URI as a string. |
The bitmap.
Get id of a registered extension
context |
---|
Id, INVALID_ID if extension is not registered
Get id of a registered extension
context | |
---|---|
hostAppPackageName | |
extensionId |
Id, INVALID_ID if extension is not registered
Get the value of the intent extra parameter EXTRA_ACCESSORY_SUPPORTS_HISTORY from the intent that started the configuration activity.
intent | The intent that started the configuration activity, see CONFIGURATION_ACTIVITY |
---|
Value of EXTRA_ACCESSORY_SUPPORTS_HISTORY, true if not contained in the intent extras.
Get the value of the intent extra parameter EXTRA_ACCESSORY_SUPPORTS_ACTIONS from the intent that started the configuration activity.
intent | The intent that started the configuration activity, see CONFIGURATION_ACTIVITY |
---|
Value of EXTRA_ACCESSORY_SUPPORTS_ACTIONS, true if not contained in the intent extras.
Get formatted time.
publishedTime | The published time in millis. |
---|
The formatted time.
Get the version of the registration API that is implemented by the current phone/tablet the extension is running on.
context | The context. |
---|
The version of the registration API.
Check if the IS_EMULATED column is present in the Registration.Display table in the registration API.
context | The context. |
---|
True if the table exists.
The extension utils class contains utility functions used by several extensions.