-
getBoolean(key) → nullable {boolean}
-
Get boolean value for the given key.
Parameters:
| Name |
Type |
Description |
key |
string
|
The key. |
Returns:
boolean
- Value for the key or null if no boolean mapping exists for the
given key.
- Since:
-
getByte(key) → nullable {number}
-
Get byte value for the given key.
Parameters:
| Name |
Type |
Description |
key |
string
|
The key. |
Returns:
number
- Value for the key or null if no byte mapping exists for the given key.
- Since:
-
getChar(key) → nullable {string}
-
Get char value for the given key.
Parameters:
| Name |
Type |
Description |
key |
string
|
The key. |
Returns:
string
- Value for the key or null if no char mapping exists for the given key.
- Since:
-
getDouble(key) → nullable {number}
-
Get double value for the given key.
Parameters:
| Name |
Type |
Description |
key |
string
|
The key. |
Returns:
number
- Value for the key or null if no double mapping exists for the given
key.
- Since:
-
getFloat(key) → nullable {number}
-
Get float value for the given key.
Parameters:
| Name |
Type |
Description |
key |
string
|
The key. |
Returns:
number
- Value for the key or null if no float mapping exists for the
given key.
- Since:
-
getInteger(key) → nullable {number}
-
Get integer value for the given key.
Parameters:
| Name |
Type |
Description |
key |
string
|
The key. |
Returns:
number
- Value for the key or null if no integer mapping exists for the given
key.
- Since:
-
getIntegerArray(key) → nullable {Array.<number>}
-
Get integer array value for the given key.
Parameters:
| Name |
Type |
Description |
key |
string
|
The key. |
Returns:
Array.<number>
- Value for the key or null if no integer array mapping exists
for the given key.
- Since:
-
getLong(key) → nullable {number}
-
Get long value for the given key.
Parameters:
| Name |
Type |
Description |
key |
string
|
The key. |
Returns:
number
- Value for the key or null if no long mapping exists for the given
key.
- Since:
-
getShort(key) → nullable {number}
-
Get short value for the given key.
Parameters:
| Name |
Type |
Description |
key |
string
|
The key. |
Returns:
number
- Value for the key or null if no short mapping exists for the given key.
- Since:
-
getString(key) → nullable {string}
-
Get string value for the given key.
Parameters:
| Name |
Type |
Description |
key |
string
|
The key. |
Returns:
string
- Value for the key or null if no string mapping exists for the given
key.
- Since:
Example
var extras = mobicontrol.android.createBundle().
withString("stringKey", "Welcome");
mobicontrol.log.info(extras.getString("stringKey"));
-
getStringArray(key) → nullable {Array.<string>}
-
Get string array value for the given key.
Parameters:
| Name |
Type |
Description |
key |
string
|
The key. |
Returns:
Array.<string>
- Value for the key or null if no string array mapping exists
for the given key.
- Since:
-
-
Get URI value for the given key.
Parameters:
| Name |
Type |
Description |
key |
string
|
The key. |
- Since:
-
-
Insert a boolean value into the mapping of this bundle.
Any existing value for the given key is replaced with the new value.
Parameters:
| Name |
Type |
Description |
key |
string
|
The key. |
value |
boolean
|
The value. |
- Since:
Example
// Open the Calendar app, adding "John Doe Vacation" all-day event on October 20, 2025
const startTime = new Date("2025-10-20T11:00:00").getTime();
var extras = mobicontrol.android.createBundle().
withString("title", "John Doe Vacation").
withBoolean("allDay", true);
var intent = mobicontrol.android.createIntent().
withData("content://com.android.calendar/events").
withAction("android.intent.action.INSERT").
withExtras(extras);
mobicontrol.android.startActivity(intent);
-
-
Insert a byte value into the mapping of this bundle.
Any existing value for the given key is replaced with the new value.
Parameters:
| Name |
Type |
Description |
key |
string
|
The key. |
value |
number
|
The value. |
- Since:
-
-
Insert a char value into the mapping of this bundle.
Any existing value for the given key is replaced with the new value.
Parameters:
| Name |
Type |
Description |
key |
string
|
The key. |
value |
string
|
The value. |
- Since:
-
-
Insert a double value into the mapping of this bundle.
Any existing value for the given key is replaced with the new value.
Parameters:
| Name |
Type |
Description |
key |
string
|
The key. |
value |
number
|
The value. |
- Since:
-
-
Insert a float value into the mapping of this bundle.
Any existing value for the given key is replaced with the new value.
Parameters:
| Name |
Type |
Description |
key |
string
|
The key. |
value |
number
|
The value. |
- Since:
-
-
Insert an integer value into the mapping of this bundle.
Any existing value for the given key is replaced with the new value.
Parameters:
| Name |
Type |
Description |
key |
string
|
The key. |
value |
number
|
The value. |
- Since:
-
-
Insert an integer array value into the mapping of this bundle.
Any existing value for the given key is replaced with the new value.
Parameters:
| Name |
Type |
Attributes |
Description |
key |
string
|
|
The key. |
value |
Array.<number>
|
<nullable>
|
The value. |
- Since:
-
-
Insert a long value into the mapping of this bundle.
Any existing value for the given key is replaced with the new value.
Parameters:
| Name |
Type |
Description |
key |
string
|
The key. |
value |
number
|
The value. |
- Since:
Example
// Open the Calendar app, adding "Travel Plan Discussion" event on October 20, 2024, starting at 11AM and ending at 12PM
const startTime = new Date("2024-10-20T11:00:00").getTime();
const endTime = new Date("2024-10-20T12:00:00").getTime();
var extras = mobicontrol.android.createBundle().
withString("title", "Travel Plan Discussion").
withString("location", "3rd floor meeting room").
withLong("beginTime", startTime).
withLong("endTime", endTime);
var intent = mobicontrol.android.createIntent().
withData("content://com.android.calendar/events").
withAction("android.intent.action.INSERT").
withExtras(extras);
mobicontrol.android.startActivity(intent);
-
-
Insert a short value into the mapping of this bundle.
Any existing value for the given key is replaced with the new value.
Parameters:
| Name |
Type |
Description |
key |
string
|
The key. |
value |
number
|
The value. |
- Since:
-
-
Insert a string value into the mapping of this bundle.
Any existing value for the given key is replaced with the new value.
Parameters:
| Name |
Type |
Description |
key |
string
|
The key. |
value |
string
|
The value. |
- Since:
Example
// Launch Google quick search, performing a search for "Android intent" keywords
var extras = mobicontrol.android.createBundle().withString("query", "Android intent");
var intent = mobicontrol.android.createIntent().
withAction("com.google.android.googlequicksearchbox.GOOGLE_SEARCH").
withExtras(extras);
mobicontrol.android.startActivity(intent);
-
-
Insert a string array value into the mapping of this bundle.
Any existing value for the given key is replaced with the new value.
Parameters:
| Name |
Type |
Attributes |
Description |
key |
string
|
|
The key. |
value |
Array.<string>
|
<nullable>
|
The value. |
- Since:
-
-
Insert a URI value into the mapping of this bundle.
Any existing value for the given key is replaced with the new value.
- Since:
Example
// Capture image with Android camera and store it in data folder of internal storage
var file = new mobicontrol.io.File(mobicontrol.storage.internal.dataDirectory + "/target.jpg");
var fileUri = mobicontrol.android.createFileContentUri(file)
var extras = mobicontrol.android.createBundle().withUri("output", fileUri);
var intent = mobicontrol.android.createIntent().
withAction("android.media.action.IMAGE_CAPTURE").
withExtras(extras);
mobicontrol.android.startActivity(intent);