User:Lehalle/python/android

Doc of Android QPython AndroidHelper Class

edit

class Android

Methods defined here:

addContextMenuItem(self, label, event, eventData=None)
addContextMenuItem(label,event,eventData=None)
Adds a new item to context menu.
label (String) label for this menu item
event (String) event that will be generated on menu item click
eventData (Object) (optional)
Context menus are used primarily with webViewShow
addOptionsMenuItem(self, label, event, eventData=None, iconName=None)
addOptionsMenuItem(label,event,eventData=None,iconName=None)
Adds a new item to options menu.
label (String) label for this menu item
event (String) event that will be generated on menu item click
eventData (Object) (optional)
iconName (String) Android system menu icon, see http://developer.android.com/reference/android/R.drawable.html (optional)
Example (python)
import android
droid=android.Android()
droid.addOptionsMenuItem("Silly","silly",None,"star_on")
droid.addOptionsMenuItem("Sensible","sensible","I bet.","star_off")
droid.addOptionsMenuItem("Off","off",None,"ic_menu_revert")
print "Hit menu to see extra options."
print "Will timeout in 10 seconds if you hit nothing."
while True: # Wait for events from the menu.
response=droid.eventWait(10000).result
if response==None:
break
print response
if response["name"]=="off":
break
print "And done."
batteryCheckPresent(self)
batteryCheckPresent(self)
Returns the most recently received battery presence data.
Min SDK level=5
batteryGetHealth(self)
batteryGetHealth(self)
Returns the most recently received battery health data:1 - unknown;2 - good;3 - overheat;4 - dead;5 - over voltage;6 - unspecified failure;
batteryGetLevel(self)
batteryGetLevel(self)
Returns the most recently received battery level (percentage).
Min SDK level=5
batteryGetPlugType(self)
batteryGetPlugType(self)
Returns the most recently received plug type data:-1 - unknown0 - unplugged;1 - power source is an AC charger2 - power source is a USB port
batteryGetStatus(self)
batteryGetStatus(self)
Returns the most recently received battery status data:1 - unknown;2 - charging;3 - discharging;4 - not charging;5 - full;
batteryGetTechnology(self)
batteryGetTechnology(self)
Returns the most recently received battery technology data.
Min SDK level=5
batteryGetTemperature(self)
batteryGetTemperature(self)
Returns the most recently received battery temperature.
Min SDK level=5
batteryGetVoltage(self)
batteryGetVoltage(self)
Returns the most recently received battery voltage.
Min SDK level=5
batteryStartMonitoring(self)
batteryStartMonitoring(self)
Starts tracking battery state.
throws "battery" events
batteryStopMonitoring(self)
batteryStopMonitoring(self)
Stops tracking battery state.
bluetoothAccept(self, uuid='457807c0-4897-11df-9879-0800200c9a66', timeout=0)
bluetoothAccept(uuid="457807c0-4897-11df-9879-0800200c9a66",timeout=0)
Listens for and accepts a Bluetooth connection. Blocks until the connection is established or fails.
uuid (String) (default=457807c0-4897-11df-9879-0800200c9a66)
timeout (Integer) How long to wait for a new connection, 0 is wait for ever (default=0)
bluetoothActiveConnections(self)
bluetoothActiveConnections(self)
Returns true when there's an active Bluetooth connection.
bluetoothConnect(self, uuid='457807c0-4897-11df-9879-0800200c9a66', address=None)
bluetoothConnect(uuid="457807c0-4897-11df-9879-0800200c9a66",address=None)
Connect to a device over Bluetooth. Blocks until the connection is established or fails.
uuid (String) The UUID passed here must match the UUID used by the server device. (default=457807c0-4897-11df-9879-0800200c9a66)
address (String) The user will be presented with a list of discovered devices to choose from if an address is not provided. (optional)
returns: (String) True if the connection was established successfully.
bluetoothGetConnectedDeviceName(self, connID=None)
bluetoothGetConnectedDeviceName(connID=None)
Returns the name of the connected device.
connID (String) Connection id (optional) (default=)
bluetoothGetLocalName(self)
bluetoothGetLocalName(self)
Gets the Bluetooth Visible device name
bluetoothGetRemoteDeviceName(self, address)
bluetoothGetRemoteDeviceName(address)
Queries a remote device for it's name or null if it can't be resolved
address (String) Bluetooth Address For Target Device
bluetoothGetScanMode(self)
bluetoothGetScanMode(self)
Gets the scan mode for the local dongle. Return values: -1 when Bluetooth is disabled. 0 if non discoverable and non connectable. 1 connectable non discoverable. 3 connectable and discoverable.
bluetoothMakeDiscoverable(self, duration=300)
bluetoothMakeDiscoverable(duration=300)
Requests that the device be discoverable for Bluetooth connections.
duration (Integer) period of time, in seconds, during which the device should be discoverable (default=300)
bluetoothRead(self, bufferSize=4096, connID=None)
bluetoothRead(bufferSize=4096,connID=None)
Read up to bufferSize ASCII characters.
bufferSize (Integer) (default=4096)
connID (String) Connection id (optional) (default=)
bluetoothReadBinary(self, bufferSize=4096, connID=None)
bluetoothReadBinary(bufferSize=4096,connID=None)
Read up to bufferSize bytes and return a chunked, base64 encoded string.
bufferSize (Integer) (default=4096)
connID (String) Connection id (optional) (default=)
bluetoothReadLine(self, connID=None)
bluetoothReadLine(connID=None)
Read the next line.
connID (String) Connection id (optional) (default=)
bluetoothReadReady(self, connID=None)
bluetoothReadReady(connID=None)
Returns True if the next read is guaranteed not to block.
connID (String) Connection id (optional) (default=)
bluetoothSetLocalName(self, name)
bluetoothSetLocalName(name)
Sets the Bluetooth Visible device name, returns True on success
name (String) New local name
bluetoothStop(self, connID=None)
bluetoothStop(connID=None)
Stops Bluetooth connection.
connID (String) Connection id (optional) (default=)
bluetoothWrite(self, ascii, connID='')
bluetoothWrite(ascii,connID="")
Sends ASCII characters over the currently open Bluetooth connection.
ascii (String)
connID (String) Connection id (default=)
bluetoothWriteBinary(self, base64, connID=None)
bluetoothWriteBinary(base64,connID=None)
Send bytes over the currently open Bluetooth connection.
base64 (String) A base64 encoded String of the bytes to be sent.
connID (String) Connection id (optional) (default=)
cameraCapturePicture(self, targetPath, useAutoFocus=True)
cameraCapturePicture(targetPath,useAutoFocus=True)
Take a picture and save it to the specified path.
targetPath (String)
useAutoFocus (Boolean) (default=true)
returns: (Bundle) A map of Booleans autoFocus and takePicture where True indicates success.
cameraInteractiveCapturePicture(self, targetPath)
cameraInteractiveCapturePicture(targetPath)
Starts the image capture application to take a picture and saves it to the specified path.
targetPath (String)
cameraStartPreview(self, resolutionLevel=0, jpegQuality=20, filepath=None)
cameraStartPreview(resolutionLevel=0,jpegQuality=20,filepath=None)
Start Preview Mode. Throws 'preview' events.
resolutionLevel (Integer) increasing this number provides higher resolution (default=0)
jpegQuality (Integer) a number from 0-100 (default=20)
filepath (String) Path to store jpeg files. (optional)
returns: (boolean) True if successful
cameraStopPreview(self)
cameraStopPreview(self)
Stop the preview mode.
checkAirplaneMode(self)
checkAirplaneMode(self)
Checks the airplane mode setting.
returns: (Boolean) True if airplane mode is enabled.
checkBluetoothState(self)
checkBluetoothState(self)
Checks Bluetooth state.
returns: (Boolean) True if Bluetooth is enabled.
checkNetworkRoaming(self)
checkNetworkRoaming(self)
Returns true if the device is considered roaming on the current network, for GSM purposes.
checkRingerSilentMode(self)
checkRingerSilentMode(self)
Checks the ringer silent mode setting.
returns: (Boolean) True if ringer silent mode is enabled.
checkScreenOn(self)
checkScreenOn(self)
Checks if the screen is on or off (requires API level 7).
returns: (Boolean) True if the screen is currently on.
checkWifiState(self)
checkWifiState(self)
Checks Wifi state.
returns: (Boolean) True if Wifi is enabled.
clearContextMenu(self)
clearContextMenu(self)
Removes all items previously added to context menu.
clearOptionsMenu(self)
clearOptionsMenu(self)
Removes all items previously added to options menu.
contactsGet(self, attributes=None)
contactsGet(attributes=None)
Returns a List of all contacts.
attributes (JSONArray) (optional)
returns: (List) a List of contacts as Maps
contactsGetAttributes(self)
contactsGetAttributes(self)
Returns a List of all possible attributes for contacts.
contactsGetById(self, id, attributes=None)
contactsGetById(id,attributes=None)
Returns contacts by ID.
id (Integer)
attributes (JSONArray) (optional)
contactsGetCount(self)
contactsGetCount(self)
Returns the number of contacts.
contactsGetIds(self)
contactsGetIds(self)
Returns a List of all contact IDs.
dialogCreateAlert(self, title=None, message=None)
dialogCreateAlert(title=None,message=None)
Create alert dialog.
title (String) (optional)
message (String) (optional)
Example (python)
import android
droid=android.Android()
droid.dialogCreateAlert("I like swords.","Do you like swords?")
droid.dialogSetPositiveButtonText("Yes")
droid.dialogSetNegativeButtonText("No")
droid.dialogShow()
response=droid.dialogGetResponse().result
droid.dialogDismiss()
if response.has_key("which"):
result=response["which"]
if result=="positive":
print "Yay! I like swords too!"
elif result=="negative":
print "Oh. How sad."
elif response.has_key("canceled"): # Yes, I know it's mispelled.
print "You can't even make up your mind?"
else:
print "Unknown response=",response
print "Done"
dialogCreateDatePicker(self, year=1970, month=1, day=1)
dialogCreateDatePicker(year=1970,month=1,day=1)
Create date picker dialog.
year (Integer) (default=1970)
month (Integer) (default=1)
day (Integer) (default=1)
dialogCreateHorizontalProgress(self, title=None, message=None, maximum_progress=100)
dialogCreateHorizontalProgress(title=None,message=None,maximum_progress=100)
Create a horizontal progress dialog.
title (String) (optional)
message (String) (optional)
maximum progress (Integer) (default=100)
dialogCreateInput(self, title='Value', message='Please enter value:', defaultText=None, inputType=None)
dialogCreateInput(title="Value",message="Please enter value:",defaultText=None,inputType=None)
Create a text input dialog.
title (String) title of the input box (default=Value)
message (String) message to display above the input box (default=Please enter value:)
defaultText (String) text to insert into the input box (optional)
inputType (String) type of input data, ie number or text (optional)
For inputType, see InputTypes. Some useful ones are text, number, and textUri. Multiple flags can be
supplied, seperated by "|", ie: "textUri|textAutoComplete"
dialogCreatePassword(self, title='Password', message='Please enter password:')
dialogCreatePassword(title="Password",message="Please enter password:")
Create a password input dialog.
title (String) title of the input box (default=Password)
message (String) message to display above the input box (default=Please enter password:)
dialogCreateSeekBar(self, starting_value=50, maximum_value=100, title='', message='')
dialogCreateSeekBar(starting_value=50,maximum_value=100,title,message)
Create seek bar dialog.
starting value (Integer) (default=50)
maximum value (Integer) (default=100)
title (String)
message (String)
Will produce "dialog" events on change, containing:
"progress" - Position chosen, between 0 and max
"which" = "seekbar"
"fromuser" = true/false change is from user input
Response will contain a "progress" element.
dialogCreateSpinnerProgress(self, title=None, message=None, maximum_progress=100)
dialogCreateSpinnerProgress(title=None,message=None,maximum_progress=100)
Create a spinner progress dialog.
title (String) (optional)
message (String) (optional)
maximum progress (Integer) (default=100)
dialogCreateTimePicker(self, hour=0, minute=0, is24hour=False)
dialogCreateTimePicker(hour=0,minute=0,is24hour=False)
Create time picker dialog.
hour (Integer) (default=0)
minute (Integer) (default=0)
is24hour (Boolean) Use 24 hour clock (default=false)
dialogDismiss(self)
dialogDismiss(self)
Dismiss dialog.
dialogGetInput(self, title='Value', message='Please enter value:', defaultText=None)
dialogGetInput(title="Value",message="Please enter value:",defaultText=None)
Queries the user for a text input.
title (String) title of the input box (default=Value)
message (String) message to display above the input box (default=Please enter value:)
defaultText (String) text to insert into the input box (optional)
The result is the user's input, or None (null) if cancel was hit.
Example (python)
import android
droid=android.Android()
print droid.dialogGetInput("Title","Message","Default").result
dialogGetPassword(self, title='Password', message='Please enter password:')
dialogGetPassword(title="Password",message="Please enter password:")
Queries the user for a password.
title (String) title of the password box (default=Password)
message (String) message to display above the input box (default=Please enter password:)
dialogGetResponse(self)
dialogGetResponse(self)
Returns dialog response.
dialogGetSelectedItems(self)
dialogGetSelectedItems(self)
This method provides list of items user selected.
returns: (Set) Selected items
dialogSetCurrentProgress(self, current)
dialogSetCurrentProgress(current)
Set progress dialog current value.
current (Integer)
dialogSetItems(self, items)
dialogSetItems(items)
Set alert dialog list items.
items (JSONArray)
This effectively creates list of options. Clicking on an item will immediately return an "item"
element, which is the index of the selected item.
dialogSetMaxProgress(self, max)
dialogSetMaxProgress(max)
Set progress dialog maximum value.
max (Integer)
dialogSetMultiChoiceItems(self, items, selected=None)
dialogSetMultiChoiceItems(items,selected=None)
Set dialog multiple choice items and selection.
items (JSONArray)
selected (JSONArray) list of selected items (optional)
This creates a list of check boxes. You can select multiple items out of the list. A response
will not be returned until the dialog is closed, either with the Cancel key or a button
(positive/negative/neutral). Use dialogGetSelectedItems() to find out what was
selected.
dialogSetNegativeButtonText(self, text)
dialogSetNegativeButtonText(text)
Set alert dialog button text.
text (String)
dialogSetNeutralButtonText(self, text)
dialogSetNeutralButtonText(text)
Set alert dialog button text.
text (String)
dialogSetPositiveButtonText(self, text)
dialogSetPositiveButtonText(text)
Set alert dialog positive button text.
text (String)
dialogSetSingleChoiceItems(self, items, selected=0)
dialogSetSingleChoiceItems(items,selected=0)
Set dialog single choice items and selected item.
items (JSONArray)
selected (Integer) selected item index (default=0)
This creates a list of radio buttons. You can select one item out of the list. A response will
not be returned until the dialog is closed, either with the Cancel key or a button
(positive/negative/neutral). Use dialogGetSelectedItems() to find out what was
selected.
dialogShow(self)
dialogShow(self)
Show dialog.
environment(self)
environment(self)
A map of various useful environment details
Map returned:
TZ = Timezone
id = Timezone ID
display = Timezone display name
offset = Offset from UTC (in ms)
SDK = SDK Version
download = default download path
appcache = Location of application cache
sdcard = Space on sdcard
availblocks = Available blocks
blockcount = Total Blocks
blocksize = size of block.
eventClearBuffer(self)
eventClearBuffer(self)
Clears all events from the event buffer.
Example (python): droid.eventClearBuffer()
eventGetBrodcastCategories(self)
eventGetBrodcastCategories(self)
Lists all the broadcast signals we are listening for
eventPoll(self, number_of_events=1)
eventPoll(number_of_events=1)
Returns and removes the oldest n events (i.e. location or sensor update, etc.) from the event buffer.
number_of_events (Integer) (default=1)
returns: (List) A List of Maps of event properties.
Actual data returned in the map will depend on the type of event.
Example (python):
import android, time
droid = android.Android()
droid.startSensing()
time.sleep(1)
droid.eventClearBuffer()
time.sleep(1)
e = eventPoll(1).result
event_entry_number = 0
x = e[event_entry_ number]['data']['xforce']
e has the format:
[{u'data': {u'accuracy': 0, u'pitch': -0.48766891956329345, u'xmag': -5.6875, u'azimuth':
0.3312483489513397, u'zforce': 8.3492730000000002, u'yforce': 4.5628165999999997, u'time':
1297072704.813, u'ymag': -11.125, u'zmag': -42.375, u'roll': -0.059393649548292161, u'xforce':
0.42223078000000003}, u'name': u'sensors', u'time': 1297072704813000L}]
x has the string value of the x force data (0.42223078000000003) at the time of the event
entry.
eventPost(self, name, data, enqueue=None)
eventPost(name,data,enqueue=None)
Post an event to the event queue.
name (String) Name of event
data (String) Data contained in event.
enqueue (Boolean) Set to False if you don't want your events to be added to the event queue, just dispatched. (optional) (default=false)
Example:
import android
from datetime import datetime
droid = android.Android()
t = datetime.now()
droid.eventPost('Some Event', t)
eventRegisterForBroadcast(self, category, enqueue=True)
eventRegisterForBroadcast(category,enqueue=True)
Registers a listener for a new broadcast signal
category (String)
enqueue (Boolean) Should this events be added to the event queue or only dispatched (default=true)
Registers a listener for a new broadcast signal
eventUnregisterForBroadcast(self, category)
eventUnregisterForBroadcast(category)
Stop listening for a broadcast signal
category (String)
eventWait(self, timeout=None)
eventWait(timeout=None)
Blocks until an event occurs. The returned event is removed from the buffer.
timeout (Integer) the maximum time to wait (optional)
returns: (Event) Map of event properties.
eventWaitFor(self, eventName, timeout=None)
eventWaitFor(eventName,timeout=None)
Blocks until an event with the supplied name occurs. The returned event is not removed from the buffer.
eventName (String)
timeout (Integer) the maximum time to wait (in ms) (optional)
returns: (Event) Map of event properties.
forceStopPackage(self, packageName)
forceStopPackage(packageName)
Force stops a package.
packageName (String) name of package
fullDismiss(self)
fullDismiss(self)
Dismiss Full Screen.
fullQuery(self)
fullQuery(self)
Get Fullscreen Properties
fullQueryDetail(self, id)
fullQueryDetail(id)
Get fullscreen properties for a specific widget
id (String) id of layout widget
fullSetList(self, id, list)
fullSetList(id,list)
Attach a list to a fullscreen widget
id (String) id of layout widget
list (JSONArray) List to set
fullSetProperty(self, id, property, value)
fullSetProperty(id,property,value)
Set fullscreen widget property
id (String) id of layout widget
property (String) name of property to set
value (String) value to set property to
fullShow(self, layout)
fullShow(layout)
Show Full Screen.
layout (String) String containing View layout
See wiki page for more
detail.
generateDtmfTones(self, phoneNumber, toneDuration=100)
generateDtmfTones(phoneNumber,toneDuration=100)
Generate DTMF tones for the given phone number.
phoneNumber (String)
toneDuration (Integer) duration of each tone in milliseconds (default=100)
geocode(self, latitude, longitude, maxResults=1)
geocode(latitude,longitude,maxResults=1)
Returns a list of addresses for the given latitude and longitude.
latitude (Double)
longitude (Double)
maxResults (Integer) maximum number of results (default=1)
returns: (List) A list of addresses.
getCellLocation(self)
getCellLocation(self)
Returns the current cell location.
getClipboard(self)
getClipboard(self)
Read text from the clipboard.
returns: (String) The text in the clipboard.
getConstants(self, classname)
getConstants(classname)
Get list of constants (static final fields) for a class
classname (String) Class to get constants from
getDeviceId(self)
getDeviceId(self)
Returns the unique device ID, for example, the IMEI for GSM and the MEID for CDMA phones. Return null if device ID is not available.
getDeviceSoftwareVersion(self)
getDeviceSoftwareVersion(self)
Returns the software version number for the device, for example, the IMEI/SV for GSM phones. Return null if the software version is not available.
getInput(self, title='SL4A Input', message='Please enter value:')
getInput(title="SL4A Input",message="Please enter value:")
Queries the user for a text input.
title (String) title of the input box (default=SL4A Input)
message (String) message to display above the input box (default=Please enter value:)
Deprecated in r3. Use dialogGetInput instead.
getIntent(self)
getIntent(self)
Returns the intent that launched the script.
getLastKnownLocation(self)
getLastKnownLocation(self)
Returns the last known location of the device.
returns: (Map) A map of location information by provider.
getLaunchableApplications(self)
getLaunchableApplications(self)
Returns a list of all launchable application class names.
getLine1Number(self)
getLine1Number(self)
Returns the phone number string for line 1, for example, the MSISDN for a GSM phone. Return null if it is unavailable.
getMaxMediaVolume(self)
getMaxMediaVolume(self)
Returns the maximum media volume.
getMaxRingerVolume(self)
getMaxRingerVolume(self)
Returns the maximum ringer volume.
getMediaVolume(self)
getMediaVolume(self)
Returns the current media volume.
getNeighboringCellInfo(self)
getNeighboringCellInfo(self)
Returns the neighboring cell information of the device.
getNetworkOperator(self)
getNetworkOperator(self)
Returns the numeric name (MCC+MNC) of current registered operator.
getNetworkOperatorName(self)
getNetworkOperatorName(self)
Returns the alphabetic name of current registered operator.
getNetworkType(self)
getNetworkType(self)
Returns a the radio technology (network type) currently in use on the device.
getPackageVersion(self, packageName)
getPackageVersion(packageName)
Returns package version name.
packageName (String)
getPackageVersionCode(self, packageName)
getPackageVersionCode(packageName)
Returns package version code.
packageName (String)
getPassword(self, title='SL4A Password Input', message='Please enter password:')
getPassword(title="SL4A Password Input",message="Please enter password:")
Queries the user for a password.
title (String) title of the input box (default=SL4A Password Input)
message (String) message to display above the input box (default=Please enter password:)
Deprecated in r3. Use dialogGetPassword instead.
getPhoneType(self)
getPhoneType(self)
Returns the device phone type.
getRingerVolume(self)
getRingerVolume(self)
Returns the current ringer volume.
getRunningPackages(self)
getRunningPackages(self)
Returns a list of packages running activities or services.
returns: (List) List of packages running activities.
getScreenBrightness(self)
getScreenBrightness(self)
Returns the screen backlight brightness.
returns: (Integer) the current screen brightness between 0 and 255
getScreenTimeout(self)
getScreenTimeout(self)
Returns the current screen timeout in seconds.
returns: (Integer) the current screen timeout in seconds.
getSimCountryIso(self)
getSimCountryIso(self)
Returns the ISO country code equivalent for the SIM provider's country code.
getSimOperator(self)
getSimOperator(self)
Returns the MCC+MNC (mobile country code + mobile network code) of the provider of the SIM. 5 or 6 decimal digits.
getSimOperatorName(self)
getSimOperatorName(self)
Returns the Service Provider Name (SPN).
getSimSerialNumber(self)
getSimSerialNumber(self)
Returns the serial number of the SIM, if applicable. Return null if it is unavailable.
getSimState(self)
getSimState(self)
Returns the state of the device SIM card.
getSubscriberId(self)
getSubscriberId(self)
Returns the unique subscriber ID, for example, the IMSI for a GSM phone. Return null if it is unavailable.
getVibrateMode(self, ringer=None)
getVibrateMode(ringer=None)
Checks Vibration setting. If ringer=true then query Ringer setting, else query Notification setting
ringer (Boolean) (optional)
returns: (Boolean) True if vibrate mode is enabled.
getVoiceMailAlphaTag(self)
getVoiceMailAlphaTag(self)
Retrieves the alphabetic identifier associated with the voice mail number.
getVoiceMailNumber(self)
getVoiceMailNumber(self)
Returns the voice mail number. Return null if it is unavailable.
launch(self, className)
launch(className)
Start activity with the given class name.
className (String)
log(self, message)
log(message)
Writes message to logcat.
message (String)
makeIntent(self, action, uri=None, type=None, extras=None, categories=None, packagename=None, classname=None, flags=None)
makeIntent(action,uri=None,type=None,extras=None,categories=None,packagename=None,classname=None,flags=None)
Create an Intent.
action (String)
uri (String) (optional)
type (String) MIME type/subtype of the URI (optional)
extras (JSONObject) a Map of extras to add to the Intent (optional)
categories (JSONArray) a List of categories to add to the Intent (optional)
packagename (String) name of package. If used, requires classname to be useful (optional)
classname (String) name of class. If used, requires packagename to be useful (optional)
flags (Integer) Intent flags (optional)
returns: (Intent) An object representing an Intent
makeToast(self, message)
makeToast(message)
Displays a short-duration Toast notification.
message (String)
mediaIsPlaying(self, tag='default')
mediaIsPlaying(tag="default")
Checks if media file is playing.
tag (String) string identifying resource (default=default)
returns: (boolean) true if playing
mediaPlay(self, url, tag='default', play=True)
mediaPlay(url,tag="default",play=True)
Open a media file
url (String) url of media resource
tag (String) string identifying resource (default=default)
play (Boolean) start playing immediately (default=true)
returns: (boolean) true if play successful
mediaPlayClose(self, tag='default')
mediaPlayClose(tag="default")
Close media file
tag (String) string identifying resource (default=default)
returns: (boolean) true if successful
mediaPlayInfo(self, tag='default')
mediaPlayInfo(tag="default")
Information on current media
tag (String) string identifying resource (default=default)
returns: (Map) Media Information
mediaPlayList(self)
mediaPlayList(self)
Lists currently loaded media
returns: (Set) List of Media Tags
mediaPlayPause(self, tag='default')
mediaPlayPause(tag="default")
pause playing media file
tag (String) string identifying resource (default=default)
returns: (boolean) true if successful
mediaPlaySeek(self, msec, tag='default')
mediaPlaySeek(msec,tag="default")
Seek To Position
msec (Integer) Position in millseconds
tag (String) string identifying resource (default=default)
returns: (int) New Position (in ms)
mediaPlaySetLooping(self, enabled=True, tag='default')
mediaPlaySetLooping(enabled=True,tag="default")
Set Looping
enabled (Boolean) (default=true)
tag (String) string identifying resource (default=default)
returns: (boolean) True if successful
mediaPlayStart(self, tag='default')
mediaPlayStart(tag="default")
start playing media file
tag (String) string identifying resource (default=default)
returns: (boolean) true if successful
notify(self, title, message)
notify(title,message)
Displays a notification that will be canceled when the user clicks on it.
title (String) title
message (String)
phoneCall(self, uri)
phoneCall(uri)
Calls a contact/phone number by URI.
uri (String)
phoneCallNumber(self, phone_number)
phoneCallNumber(phone_number)
Calls a phone number.
phone number (String)
phoneDial(self, uri)
phoneDial(uri)
Dials a contact/phone number by URI.
uri (String)
phoneDialNumber(self, phone_number)
phoneDialNumber(phone_number)
Dials a phone number.
phone number (String)
pick(self, uri)
pick(uri)
Display content to be picked by URI (e.g. contacts)
uri (String)
returns: (Intent) A map of result values.
pickContact(self)
pickContact(self)
Displays a list of contacts to pick from.
returns: (Intent) A map of result values.
pickPhone(self)
pickPhone(self)
Displays a list of phone numbers to pick from.
returns: (String) The selected phone number.
prefGetAll(self, filename=None)
prefGetAll(filename=None)
Get list of Shared Preference Values
filename (String) Desired preferences file. If not defined, uses the default Shared Preferences. (optional)
returns: (Map) Map of key,value
prefGetValue(self, key, filename=None)
prefGetValue(key,filename=None)
Read a value from shared preferences
key (String)
filename (String) Desired preferences file. If not defined, uses the default Shared Preferences. (optional)
prefPutValue(self, key, value, filename=None)
prefPutValue(key,value,filename=None)
Write a value to shared preferences
key (String)
value (Object)
filename (String) Desired preferences file. If not defined, uses the default Shared Preferences. (optional)
queryAttributes(self, uri)
queryAttributes(uri)
Content Resolver Query Attributes
uri (String) The URI, using the content:// scheme, for the content to retrieve.
returns: (JSONArray) a list of available columns for a given content uri
queryContent(self, uri, attributes=None, selection=None, selectionArgs=None, order=None)
queryContent(uri,attributes=None,selection=None,selectionArgs=None,order=None)
Content Resolver Query
uri (String) The URI, using the content:// scheme, for the content to retrieve.
attributes (JSONArray) A list of which columns to return. Passing null will return all columns (optional)
selection (String) A filter declaring which rows to return (optional)
selectionArgs (JSONArray) You may include ?s in selection, which will be replaced by the values from selectionArgs (optional)
order (String) How to order the rows (optional)
returns: (List) result of query as Maps
Exactly as per ContentResolver.query
readBatteryData(self)
readBatteryData(self)
Returns the most recently recorded battery data.
readLocation(self)
readLocation(self)
Returns the current location as indicated by all available providers.
returns: (Map) A map of location information by provider.
readPhoneState(self)
readPhoneState(self)
Returns the current phone state and incoming number.
returns: (Bundle) A Map of "state" and "incomingNumber"
readSensors(self)
readSensors(self)
Returns the most recently recorded sensor data.
readSignalStrengths(self)
readSignalStrengths(self)
Returns the current signal strengths.
returns: (Bundle) A map of "gsm_signal_strength"
receiveEvent(self)
receiveEvent(self)
Returns and removes the oldest event (i.e. location or sensor update, etc.) from the event buffer.
returns: (Event) Map of event properties.
Deprecated in r4. Use eventPoll instead.
recognizeSpeech(self, prompt=None, language=None, languageModel=None)
recognizeSpeech(prompt=None,language=None,languageModel=None)
Recognizes user's speech and returns the most likely result.
prompt (String) text prompt to show to the user when asking them to speak (optional)
language (String) language override to inform the recognizer that it should expect speech in a language different than the one set in the java.util.Locale.getDefault() (optional)
languageModel (String) informs the recognizer which speech model to prefer (see android.speech.RecognizeIntent) (optional)
returns: (String) An empty string in case the speech cannot be recongnized.
recorderCaptureVideo(self, targetPath, duration=None, recordAudio=True)
recorderCaptureVideo(targetPath,duration=None,recordAudio=True)
Records video (and optionally audio) from the camera and saves it to the given location. Duration specifies the maximum duration of the recording session. If duration is not provided this method will return immediately and the recording will only be stopped when recorderStop is called or when a scripts exits. Otherwise it will block for the time period equal to the duration argument.
targetPath (String)
duration (Integer) (optional)
recordAudio (Boolean) (default=true)
recorderStartMicrophone(self, targetPath)
recorderStartMicrophone(targetPath)
Records audio from the microphone and saves it to the given location.
targetPath (String)
recorderStartVideo(self, targetPath, duration=0, videoSize=1)
recorderStartVideo(targetPath,duration=0,videoSize=1)
Records video from the camera and saves it to the given location. Duration specifies the maximum duration of the recording session. If duration is 0 this method will return and the recording will only be stopped when recorderStop is called or when a scripts exits. Otherwise it will block for the time period equal to the duration argument.videoSize: 0=160x120, 1=320x240, 2=352x288, 3=640x480, 4=800x480.
targetPath (String)
duration (Integer) (default=0)
videoSize (Integer) (default=1)
recorderStop(self)
recorderStop(self)
Stops a previously started recording.
requiredVersion(self, requiredVersion)
requiredVersion(requiredVersion)
Checks if version of SL4A is greater than or equal to the specified version.
requiredVersion (Integer)
rpcPostEvent(self, name, data)
rpcPostEvent(name,data)
Post an event to the event queue.
name (String)
data (String)
Deprecated in r4. Use eventPost instead.
scanBarcode(self)
scanBarcode(self)
Starts the barcode scanner.
returns: (Intent) A Map representation of the result Intent.
search(self, query)
search(query)
Starts a search for the given query.
query (String)
sendBroadcast(self, action, uri=None, type=None, extras=None, packagename=None, classname=None)
sendBroadcast(action,uri=None,type=None,extras=None,packagename=None,classname=None)
Send a broadcast.
action (String)
uri (String) (optional)
type (String) MIME type/subtype of the URI (optional)
extras (JSONObject) a Map of extras to add to the Intent (optional)
packagename (String) name of package. If used, requires classname to be useful (optional)
classname (String) name of class. If used, requires packagename to be useful (optional)
sendBroadcastIntent(self, intent)
sendBroadcastIntent(intent)
Send Broadcast Intent
intent (Intent) Intent in the format as returned from makeIntent
sendEmail(self, to, subject, body, attachmentUri=None)
sendEmail(to,subject,body,attachmentUri=None)
Launches an activity that sends an e-mail message to a given recipient.
to (String) A comma separated list of recipients.
subject (String)
body (String)
attachmentUri (String) (optional)
sensorsGetAccuracy(self)
sensorsGetAccuracy(self)
Returns the most recently received accuracy value.
sensorsGetLight(self)
sensorsGetLight(self)
Returns the most recently received light value.
sensorsReadAccelerometer(self)
sensorsReadAccelerometer(self)
Returns the most recently received accelerometer values.
returns: (List) a List of Floats [(acceleration on the) X axis, Y axis, Z axis].
sensorsReadMagnetometer(self)
sensorsReadMagnetometer(self)
Returns the most recently received magnetic field values.
returns: (List) a List of Floats [(magnetic field value for) X axis, Y axis, Z axis].
sensorsReadOrientation(self)
sensorsReadOrientation(self)
Returns the most recently received orientation values.
returns: (List) a List of Doubles [azimuth, pitch, roll].
setClipboard(self, text)
setClipboard(text)
Put text in the clipboard.
text (String)
Creates a new AndroidFacade that simplifies the interface to various Android APIs.
setMediaVolume(self, volume)
setMediaVolume(volume)
Sets the media volume.
volume (Integer)
setResultBoolean(self, resultCode, resultValue)
setResultBoolean(resultCode,resultValue)
Sets the result of a script execution. Whenever the script APK is called via startActivityForResult(), the resulting intent will contain SCRIPT_RESULT extra with the given value.
resultCode (Integer) The result code to propagate back to the originating activity, often RESULT_CANCELED (0) or RESULT_OK (-1)
resultValue (Boolean)
setResultBooleanArray(self, resultCode, resultValue)
setResultBooleanArray(resultCode,resultValue)
Sets the result of a script execution. Whenever the script APK is called via startActivityForResult(), the resulting intent will contain SCRIPT_RESULT extra with the given value.
resultCode (Integer) The result code to propagate back to the originating activity, often RESULT_CANCELED (0) or RESULT_OK (-1)
resultValue (Boolean)
setResultByte(self, resultCode, resultValue)
setResultByte(resultCode,resultValue)
Sets the result of a script execution. Whenever the script APK is called via startActivityForResult(), the resulting intent will contain SCRIPT_RESULT extra with the given value.
resultCode (Integer) The result code to propagate back to the originating activity, often RESULT_CANCELED (0) or RESULT_OK (-1)
resultValue (Byte)
setResultByteArray(self, resultCode, resultValue)
setResultByteArray(resultCode,resultValue)
Sets the result of a script execution. Whenever the script APK is called via startActivityForResult(), the resulting intent will contain SCRIPT_RESULT extra with the given value.
resultCode (Integer) The result code to propagate back to the originating activity, often RESULT_CANCELED (0) or RESULT_OK (-1)
resultValue (Byte)
setResultChar(self, resultCode, resultValue)
setResultChar(resultCode,resultValue)
Sets the result of a script execution. Whenever the script APK is called via startActivityForResult(), the resulting intent will contain SCRIPT_RESULT extra with the given value.
resultCode (Integer) The result code to propagate back to the originating activity, often RESULT_CANCELED (0) or RESULT_OK (-1)
resultValue (Character)
setResultCharArray(self, resultCode, resultValue)
setResultCharArray(resultCode,resultValue)
Sets the result of a script execution. Whenever the script APK is called via startActivityForResult(), the resulting intent will contain SCRIPT_RESULT extra with the given value.
resultCode (Integer) The result code to propagate back to the originating activity, often RESULT_CANCELED (0) or RESULT_OK (-1)
resultValue (Character)
setResultDouble(self, resultCode, resultValue)
setResultDouble(resultCode,resultValue)
Sets the result of a script execution. Whenever the script APK is called via startActivityForResult(), the resulting intent will contain SCRIPT_RESULT extra with the given value.
resultCode (Integer) The result code to propagate back to the originating activity, often RESULT_CANCELED (0) or RESULT_OK (-1)
resultValue (Double)
setResultDoubleArray(self, resultCode, resultValue)
setResultDoubleArray(resultCode,resultValue)
Sets the result of a script execution. Whenever the script APK is called via startActivityForResult(), the resulting intent will contain SCRIPT_RESULT extra with the given value.
resultCode (Integer) The result code to propagate back to the originating activity, often RESULT_CANCELED (0) or RESULT_OK (-1)
resultValue (Double)
setResultFloat(self, resultCode, resultValue)
setResultFloat(resultCode,resultValue)
Sets the result of a script execution. Whenever the script APK is called via startActivityForResult(), the resulting intent will contain SCRIPT_RESULT extra with the given value.
resultCode (Integer) The result code to propagate back to the originating activity, often RESULT_CANCELED (0) or RESULT_OK (-1)
resultValue (Float)
setResultFloatArray(self, resultCode, resultValue)
setResultFloatArray(resultCode,resultValue)
Sets the result of a script execution. Whenever the script APK is called via startActivityForResult(), the resulting intent will contain SCRIPT_RESULT extra with the given value.
resultCode (Integer) The result code to propagate back to the originating activity, often RESULT_CANCELED (0) or RESULT_OK (-1)
resultValue (Float)
setResultInteger(self, resultCode, resultValue)
setResultInteger(resultCode,resultValue)
Sets the result of a script execution. Whenever the script APK is called via startActivityForResult(), the resulting intent will contain SCRIPT_RESULT extra with the given value.
resultCode (Integer) The result code to propagate back to the originating activity, often RESULT_CANCELED (0) or RESULT_OK (-1)
resultValue (Integer)
setResultIntegerArray(self, resultCode, resultValue)
setResultIntegerArray(resultCode,resultValue)
Sets the result of a script execution. Whenever the script APK is called via startActivityForResult(), the resulting intent will contain SCRIPT_RESULT extra with the given value.
resultCode (Integer) The result code to propagate back to the originating activity, often RESULT_CANCELED (0) or RESULT_OK (-1)
resultValue (Integer)
setResultLong(self, resultCode, resultValue)
setResultLong(resultCode,resultValue)
Sets the result of a script execution. Whenever the script APK is called via startActivityForResult(), the resulting intent will contain SCRIPT_RESULT extra with the given value.
resultCode (Integer) The result code to propagate back to the originating activity, often RESULT_CANCELED (0) or RESULT_OK (-1)
resultValue (Long)
setResultLongArray(self, resultCode, resultValue)
setResultLongArray(resultCode,resultValue)
Sets the result of a script execution. Whenever the script APK is called via startActivityForResult(), the resulting intent will contain SCRIPT_RESULT extra with the given value.
resultCode (Integer) The result code to propagate back to the originating activity, often RESULT_CANCELED (0) or RESULT_OK (-1)
resultValue (Long)
setResultSerializable(self, resultCode, resultValue)
setResultSerializable(resultCode,resultValue)
Sets the result of a script execution. Whenever the script APK is called via startActivityForResult(), the resulting intent will contain SCRIPT_RESULT extra with the given value.
resultCode (Integer) The result code to propagate back to the originating activity, often RESULT_CANCELED (0) or RESULT_OK (-1)
resultValue (Serializable)
setResultShort(self, resultCode, resultValue)
setResultShort(resultCode,resultValue)
Sets the result of a script execution. Whenever the script APK is called via startActivityForResult(), the resulting intent will contain SCRIPT_RESULT extra with the given value.
resultCode (Integer) The result code to propagate back to the originating activity, often RESULT_CANCELED (0) or RESULT_OK (-1)
resultValue (Short)
setResultShortArray(self, resultCode, resultValue)
setResultShortArray(resultCode,resultValue)
Sets the result of a script execution. Whenever the script APK is called via startActivityForResult(), the resulting intent will contain SCRIPT_RESULT extra with the given value.
resultCode (Integer) The result code to propagate back to the originating activity, often RESULT_CANCELED (0) or RESULT_OK (-1)
resultValue (Short)
setResultString(self, resultCode, resultValue)
setResultString(resultCode,resultValue)
Sets the result of a script execution. Whenever the script APK is called via startActivityForResult(), the resulting intent will contain SCRIPT_RESULT extra with the given value.
resultCode (Integer) The result code to propagate back to the originating activity, often RESULT_CANCELED (0) or RESULT_OK (-1)
resultValue (String)
setResultStringArray(self, resultCode, resultValue)
setResultStringArray(resultCode,resultValue)
Sets the result of a script execution. Whenever the script APK is called via startActivityForResult(), the resulting intent will contain SCRIPT_RESULT extra with the given value.
resultCode (Integer) The result code to propagate back to the originating activity, often RESULT_CANCELED (0) or RESULT_OK (-1)
resultValue (String)
setRingerVolume(self, volume)
setRingerVolume(volume)
Sets the ringer volume.
volume (Integer)
setScreenBrightness(self, value)
setScreenBrightness(value)
Sets the the screen backlight brightness.
value (Integer) brightness value between 0 and 255
returns: (Integer) the original screen brightness.
setScreenTimeout(self, value)
setScreenTimeout(value)
Sets the screen timeout to this number of seconds.
value (Integer)
returns: (Integer) The original screen timeout.
smsDeleteMessage(self, id)
smsDeleteMessage(id)
Deletes a message.
id (Integer)
returns: (Boolean) True if the message was deleted
smsGetAttributes(self)
smsGetAttributes(self)
Returns a List of all possible message attributes.
smsGetMessageById(self, id, attributes=None)
smsGetMessageById(id,attributes=None)
Returns message attributes.
id (Integer) message ID
attributes (JSONArray) (optional)
smsGetMessageCount(self, unreadOnly, folder='inbox')
smsGetMessageCount(unreadOnly,folder="inbox")
Returns the number of messages.
unreadOnly (Boolean)
folder (String) (default=inbox)
smsGetMessageIds(self, unreadOnly, folder='inbox')
smsGetMessageIds(unreadOnly,folder="inbox")
Returns a List of all message IDs.
unreadOnly (Boolean)
folder (String) (default=inbox)
smsGetMessages(self, unreadOnly, folder='inbox', attributes=None)
smsGetMessages(unreadOnly,folder="inbox",attributes=None)
Returns a List of all messages.
unreadOnly (Boolean)
folder (String) (default=inbox)
attributes (JSONArray) (optional)
returns: (List) a List of messages as Maps
smsMarkMessageRead(self, ids, read)
smsMarkMessageRead(ids,read)
Marks messages as read.
ids (JSONArray) List of message IDs to mark as read.
read (Boolean)
returns: (Integer) number of messages marked read
smsSend(self, destinationAddress, text)
smsSend(destinationAddress,text)
Sends an SMS.
destinationAddress (String) typically a phone number
text (String)
startActivity(self, action, uri=None, type=None, extras=None, wait=None, packagename=None, classname=None)
startActivity(action,uri=None,type=None,extras=None,wait=None,packagename=None,classname=None)
Starts an activity.
action (String)
uri (String) (optional)
type (String) MIME type/subtype of the URI (optional)
extras (JSONObject) a Map of extras to add to the Intent (optional)
wait (Boolean) block until the user exits the started activity (optional)
packagename (String) name of package. If used, requires classname to be useful (optional)
classname (String) name of class. If used, requires packagename to be useful (optional)
packagename and classname, if provided, are used in a 'setComponent' call.
startActivityForResult(self, action, uri=None, type=None, extras=None, packagename=None, classname=None)
startActivityForResult(action,uri=None,type=None,extras=None,packagename=None,classname=None)
Starts an activity and returns the result.
action (String)
uri (String) (optional)
type (String) MIME type/subtype of the URI (optional)
extras (JSONObject) a Map of extras to add to the Intent (optional)
packagename (String) name of package. If used, requires classname to be useful (optional)
classname (String) name of class. If used, requires packagename to be useful (optional)
returns: (Intent) A Map representation of the result Intent.
startActivityForResultIntent(self, intent)
startActivityForResultIntent(intent)
Starts an activity and returns the result.
intent (Intent) Intent in the format as returned from makeIntent
returns: (Intent) A Map representation of the result Intent.
startActivityIntent(self, intent, wait=None)
startActivityIntent(intent,wait=None)
Start Activity using Intent
intent (Intent) Intent in the format as returned from makeIntent
wait (Boolean) block until the user exits the started activity (optional)
startEventDispatcher(self, port=None)
startEventDispatcher(port=None)
Opens up a socket where you can read for events posted
port (Integer) Port to use (optional) (default=0)
startInteractiveVideoRecording(self, path)
startInteractiveVideoRecording(path)
Starts the video capture application to record a video and saves it to the specified path.
path (String)
startLocating(self, minDistance=60000, minUpdateDistance=30)
startLocating(minDistance=60000,minUpdateDistance=30)
Starts collecting location data.
minDistance (Integer) minimum time between updates in milliseconds (default=60000)
minUpdateDistance (Integer) minimum distance between updates in meters (default=30)
startSensing(self, sampleSize=5)
startSensing(sampleSize=5)
Starts recording sensor data to be available for polling.
sampleSize (Integer) number of samples for calculating average readings (default=5)
Deprecated in 4. Use startSensingTimed or startSensingThreshhold instead.
startSensingThreshold(self, sensorNumber, threshold, axis)
startSensingThreshold(sensorNumber,threshold,axis)
Records to the Event Queue sensor data exceeding a chosen threshold.
sensorNumber (Integer) 1 = Orientation, 2 = Accelerometer, 3 = Magnetometer and 4 = Light
threshold (Integer) Threshold level for chosen sensor (integer)
axis (Integer) 0 = No axis, 1 = X, 2 = Y, 3 = X+Y, 4 = Z, 5= X+Z, 6 = Y+Z, 7 = X+Y+Z
startSensingTimed(self, sensorNumber, delayTime)
startSensingTimed(sensorNumber,delayTime)
Starts recording sensor data to be available for polling.
sensorNumber (Integer) 1 = All, 2 = Accelerometer, 3 = Magnetometer and 4 = Light
delayTime (Integer) Minimum time between readings in milliseconds
startTrackingPhoneState(self)
startTrackingPhoneState(self)
Starts tracking phone state.
startTrackingSignalStrengths(self)
startTrackingSignalStrengths(self)
Starts tracking signal strengths.
stopEventDispatcher(self)
stopEventDispatcher(self)
Stops the event server, you can't read in the port anymore
stopLocating(self)
stopLocating(self)
Stops collecting location data.
stopSensing(self)
stopSensing(self)
Stops collecting sensor data.
stopTrackingPhoneState(self)
stopTrackingPhoneState(self)
Stops tracking phone state.
stopTrackingSignalStrengths(self)
stopTrackingSignalStrengths(self)
Stops tracking signal strength.
toggleAirplaneMode(self, enabled=None)
toggleAirplaneMode(enabled=None)
Toggles airplane mode on and off.
enabled (Boolean) (optional)
returns: (Boolean) True if airplane mode is enabled.
toggleBluetoothState(self, enabled=None, prompt=True)
toggleBluetoothState(enabled=None,prompt=True)
Toggle Bluetooth on and off.
enabled (Boolean) (optional)
prompt (Boolean) Prompt the user to confirm changing the Bluetooth state. (default=true)
returns: (Boolean) True if Bluetooth is enabled.
toggleRingerSilentMode(self, enabled=None)
toggleRingerSilentMode(enabled=None)
Toggles ringer silent mode on and off.
enabled (Boolean) (optional)
returns: (Boolean) True if ringer silent mode is enabled.
toggleVibrateMode(self, enabled=None, ringer=None)
toggleVibrateMode(enabled=None,ringer=None)
Toggles vibrate mode on and off. If ringer=true then set Ringer setting, else set Notification setting
enabled (Boolean) (optional)
ringer (Boolean) (optional)
returns: (Boolean) True if vibrate mode is enabled.
toggleWifiState(self, enabled=None)
toggleWifiState(enabled=None)
Toggle Wifi on and off.
enabled (Boolean) (optional)
returns: (Boolean) True if Wifi is enabled.
ttsIsSpeaking(self)
ttsIsSpeaking(self)
Returns True if speech is currently in progress.
ttsSpeak(self, message)
ttsSpeak(message)
Speaks the provided message via TTS.
message (String)
vibrate(self, duration=300)
vibrate(duration=300)
Vibrates the phone or a specified duration in milliseconds.
duration (Integer) duration in milliseconds (default=300)
view(self, uri, type=None, extras=None)
view(uri,type=None,extras=None)
Start activity with view action by URI (i.e. browser, contacts, etc.).
uri (String)
type (String) MIME type/subtype of the URI (optional)
extras (JSONObject) a Map of extras to add to the Intent (optional)
viewContacts(self)
viewContacts(self)
Opens the list of contacts.
viewHtml(self, path)
viewHtml(path)
Opens the browser to display a local HTML file.
path (String) the path to the HTML file
viewMap(self, query)
viewMap(query,_e.g._pizza,_123_My_Street)
Opens a map search for query (e.g. pizza, 123 My Street).
query, e.g. pizza, 123 My Street (String)
waitForEvent(self, eventName, timeout=None)
waitForEvent(eventName,timeout=None)
Blocks until an event with the supplied name occurs. The returned event is not removed from the buffer.
eventName (String)
timeout (Integer) the maximum time to wait (optional)
returns: (Event) Map of event properties.
Deprecated in r4. Use eventWaitFor instead.
wakeLockAcquireBright(self)
wakeLockAcquireBright(self)
Acquires a bright wake lock (CPU on, screen bright).
wakeLockAcquireDim(self)
wakeLockAcquireDim(self)
Acquires a dim wake lock (CPU on, screen dim).
wakeLockAcquireFull(self)
wakeLockAcquireFull(self)
Acquires a full wake lock (CPU on, screen bright, keyboard bright).
wakeLockAcquirePartial(self)
wakeLockAcquirePartial(self)
Acquires a partial wake lock (CPU on).
wakeLockRelease(self)
wakeLockRelease(self)
Releases the wake lock.
webViewShow(self, url, wait=None)
webViewShow(url,wait=None)
Display a WebView with the given URL.
url (String)
wait (Boolean) block until the user exits the WebView (optional)
See wiki page for more
detail.
webcamAdjustQuality(self, resolutionLevel=0, jpegQuality=20)
webcamAdjustQuality(resolutionLevel=0,jpegQuality=20)
Adjusts the quality of the webcam stream while it is running.
resolutionLevel (Integer) increasing this number provides higher resolution (default=0)
jpegQuality (Integer) a number from 0-100 (default=20)
webcamStart(self, resolutionLevel=0, jpegQuality=20, port=0)
webcamStart(resolutionLevel=0,jpegQuality=20,port=0)
Starts an MJPEG stream and returns a Tuple of address and port for the stream.
resolutionLevel (Integer) increasing this number provides higher resolution (default=0)
jpegQuality (Integer) a number from 0-100 (default=20)
port (Integer) If port is specified, the webcam service will bind to port, otherwise it will pick any available port. (default=0)
webcamStop(self)
webcamStop(self)
Stops the webcam stream.
wifiDisconnect(self)
wifiDisconnect(self)
Disconnects from the currently active access point.
returns: (Boolean) True if the operation succeeded.
wifiGetConnectionInfo(self)
wifiGetConnectionInfo(self)
Returns information about the currently active access point.
wifiGetScanResults(self)
wifiGetScanResults(self)
Returns the list of access points found during the most recent Wifi scan.
wifiLockAcquireFull(self)
wifiLockAcquireFull(self)
Acquires a full Wifi lock.
wifiLockAcquireScanOnly(self)
wifiLockAcquireScanOnly(self)
Acquires a scan only Wifi lock.
wifiLockRelease(self)
wifiLockRelease(self)
Releases a previously acquired Wifi lock.
wifiReassociate(self)
wifiReassociate(self)
Reassociates with the currently active access point.
returns: (Boolean) True if the operation succeeded.
wifiReconnect(self)
wifiReconnect(self)
Reconnects to the currently active access point.
returns: (Boolean) True if the operation succeeded.
wifiStartScan(self)
wifiStartScan(self)
Starts a scan for Wifi access points.
returns: (Boolean) True if the scan was initiated successfully.