This is an archive. | |
See the new ClickWiki at https://clickwiki.github.io. This version is just an archive for the purposes of migrating content to the new structure. |
Android object
Author | Clickteam |
Status | Released |
Release Date | 2006 |
Available for | |
Supported Runtimes | |
License | Free |
Attributes | |
Download | |
---|---|
Includes Examples | ? |
Includes Help Files | Yes |
Links | Part of the Android Exporter |
The Android object contains specific functions for the Android devices.
Contents
- 1 Conditions
- 1.1 Device has a GPU?
- 1.2 User is roaming
- 1.3 Network is connected?
- 1.4 Bluetooth is enabled?
- 1.5 Device is rooted?
- 1.6 Device is plugged in?
- 1.7 Battery is charging / discharging / full?
- 1.8 On incoming intent
- 1.9 On any incoming intent
- 1.10 On back button pressed?
- 1.11 On menu button pressed?
- 1.12 Is back button down?
- 1.13 Is menu button down?
- 1.14 Read button state
- 1.15 On options menu item selected
- 1.16 On any options menu item selected
- 2 Actions
- 2.1 Log functions
- 2.2 Sleep prevention
- 2.3 Open URL
- 2.4 Intent (outgoing) / Start intent
- 2.5 Intent (outgoing) / Start intent with chooser
- 2.6 Intent (outgoing) / Add category
- 2.7 Intent (outgoing) / Add extra data
- 2.8 Intent (incoming) / Subscribe to action
- 2.9 Intent (incoming) / Unsubscribe from action
- 2.10 Vibrate
- 3 Expressions
- 3.1 GPU name
- 3.2 GPU vendor
- 3.3 Phone unique ID
- 3.4 Network operator name
- 3.5 Device unique ID
- 3.6 Battery charge percentage
- 3.7 Screen width
- 3.8 Screen height
- 3.9 Renderer type
- 3.10 Ad height
- 3.11 Get data storage directory
- 3.12 Temp directory
- 3.13 External storage directory
- 3.14 Runtime / Runtime version
- 3.15 Runtime / Application title
- 3.16 Runtime / Application package name
- 3.17 Runtime / Application version
- 3.18 Intent (incoming) / Action
- 3.19 Intent (incoming) / Data
- 3.20 Intent (incoming) / Extra data (by key) / String
- 3.21 Intent (incoming) / Extra data (by key) / Boolean
- 3.22 Intent (incoming) / Extra data (by key) / Integer
- 3.23 Selected options menu item
Conditions
Device has a GPU?
This condition is true if the device has a GPU (graphic processor unit). Note: although applications created with Clickteam Fusion 2.5 run on devices without GPU, graphical applications are very slow on these devices.
User is roaming
This condition is true when the user is roaming.
Network is connected?
This condition is true when the device is connected to the network.
Important: you must select the ACCESS_NETWORK_STATE permission in the properties of the application, otherwise this function won't work or will crash.
Bluetooth is enabled?
This condition is true when Bluetooth is enabled on the device.
Important: you must select the BLUETOOTH permission in the properties of the application otherwise this function won't work or will crash.
Device is rooted?
This condition attempts to detect if the device has been rooted. Note that this may not work on all devices or with different rooting methods.
Device is plugged in?
These conditions are true when the device is plugged into any power source, an AC adapter or an USB port.
Battery is charging / discharging / full?
These conditions allow you to test the status of the battery.
On incoming intent
This condition is true when the application receives a specific intent. Parameter = action name.
On any incoming intent
This condition is true when the application receives any intent.
On back button pressed?
This condition works only if you select the "Disable default back button behavior" option in the properties of the application. In this case, it's triggered when the user presses the back button.
This condition is triggered when the user presses the menu button just before the application is sent to the background.
Is back button down?
This condition is true when the back button is down.
This condition is true when the menu button is down.
Read button state
This condition is true when a button is pressed. Parameter = key code (the list of available key codes is available in the Android documentation)
This condition is triggered when a specific item of the Options menu is selected by the user. Parameter = identifier of the menu item.
This condition is triggered when any item of the Options menu is selected by the user. You can retrieve the identifier of the menu item with the MenuItem$ expression.
Actions
Log functions
These functions allow you to write to the system log, viewable with DDMS. The different actions are for different levels of verbosity, where "error" is the most important and "verbose" is the least (this affects how they show up in the console - log messages may be filtered by levels of verbosity).
Sleep prevention
Allows you to prevent or allow the device to enter sleep mode.
Open URL
Opens an URL in the browser.
Intent (outgoing) / Start intent
Allows you to start an Intent. An intent is an abstract description of an operation to be performed. This could be, for example, something like "android.intent.action.DIAL" with the parameter "tel:123" to dial the number "123". There are a lot of possible Intents in Android. Look at the documentation of the Android SDK for more information: http://developer.android.com/reference/android/content/Intent.html
Intent (outgoing) / Start intent with chooser
Allows you to start an intent with a chooser dialog where necessary.
Sometimes there is more than one application available to receive an intent (for example, multiple e-mail clients may be installed). When this is the case, the user will be presented with the chooser dialog.
Intent (outgoing) / Add category
Gives additional information about the action to execute. For more information, see the Intent documentation.
Intent (outgoing) / Add extra data
These actions allow you to add extra data to the intent. For example, when starting an intent to send an e-mail, it may be useful to include the subject and body. Parameters = data name and value.
Intent (incoming) / Subscribe to action
Allows your application to receive specific incoming intents, causing the "On incoming intent" condition to fire. Parameter = action name.
Intent (incoming) / Unsubscribe from action
Cancels a subscription for a specific incoming intent. Parameter = action name.
Vibrate
Vibrates the device. Parameter = duration in milliseconds.
Important: you must select the VIBRATE permission in the properties of the application otherwise using this action will result in the application being force closed.
Expressions
GPU name
GPU_Name$("Android")
Returns the name of the GPU (graphic processor unit) on the device, if any.
GPU vendor
GPU_Vendor$("Android")
Returns the name of the vendor of the GPU (graphic processor unit) on the device, if any.
Phone unique ID
PhoneID$("Android")
Returns the unique identifier of the phone.
Network operator name
Operator$("Android")
Returns the name of the network operator.
Device unique ID
DeviceID$("Android")
Returns a unique identifier for the device. Although this works for all devices, the ID is specific to Clickteam Fusion 2.5 and not a standard identifier.
Battery charge percentage
BatteryPercentage("Android")
Returns the current percentage of charge of the battery between 0 and 100.
Screen width
ScreenWidth("Android")
This expression returns the width of the screen.
Screen height
ScreenHeight("Android")
This expression returns the height of the screen.
Renderer type
Renderer$("Android")
This expression returns the name of the renderer (OpenGL ES 1.1 or 2.0).
Ad height
AdHeight("Android")
This expression returns the height of the currently displayed ad, if any. If no ad is displayed, 0 will be returned.
Get data storage directory
DataStorageDirectory$("Android")
Returns the pathname of the data storage directory, used for storing small, persistent files (such as saves or settings).
Temp directory
TempPath$("Android")
Returns the pathname of the temp directory.
External storage directory
ExternalStorageDirectory$("Android")
Returns the pathname of the external storage directory, used for storing larger files. On a typical phone, this is likely to be the SD card.
Runtime / Runtime version
RuntimeVersion$("Android")
Returns the version of the runtime code.
Runtime / Application title
AppTitle$("Android")
Returns the title of the application.
Runtime / Application package name
PackageName$("Android")
Returns the package name of the application.
Runtime / Application version
AppVersion$("Android")
Returns the version of the application specified in the Version Name option in the Android properties of the application.
Intent (incoming) / Action
IntentAction$("Android")
Returns the action name of the incoming intent.
Intent (incoming) / Data
IntentData$("Android")
Returns the data parameter of the incoming intent.
Intent (incoming) / Extra data (by key) / String
IntentExtra_String$("Android", "data_name")
Returns an extra string parameter for the incoming intent. Parameter = name of extra data.
Intent (incoming) / Extra data (by key) / Boolean
IntentExtra_Boolean("Android", "data_name")
Returns an extra boolean parameter for the incoming intent. Parameter = name of extra data.
Intent (incoming) / Extra data (by key) / Integer
IntentExtra_Long("Android", "data_name")
Returns an extra integer parameter for the incoming intent. Parameter = name of extra data.
MenuItem$("Android")
Returns the identifier of the selected item in the Options menu.