Simple Runtime Reference
Simple Runtime Reference
August 2009
Version 0.1.1
1
Functions
• Application - Various application related runtime functions
• Arrays - Various array related runtime functions
• Assertions - Checking the runtime state of an application
• Collection - Unordered set of items
• Conversions - Various conversion related runtime functions
• Dates - Various date and time related runtime functions
• Files - Various file related runtime functions Log - Logging related runtime functions
• Math - Various mathematical runtime functions
• Strings - Various string related runtime functions
Components
• AccelerometerSensor - Sensor to measure acceleration in 3 dimensions
• Button - Push-style button
• Canvas - Surface to draw on
• CheckBox - Two state button that can either be checked or un-checked
• EmailPicker - Editable text box using auto-completion to pick out an email address
from contacts
• Form - Root component container
• Image - Component for displaying images
• Label - Text display
• LocationSensor - Sensor to provide information about the current location
• OrientationSensor - Sensor to measure absolute orientation in 3 dimensions
• Panel - Container for other components
• PasswordTextBox - Editable text box for entering passwords
• Phone - Component providing phone-related functionality
• RadioButton - Two state button that can either be checked or un-checked
• TextBox - Editable text box
• Timer - Timer component
Layouts
• FrameLayout - Layout for prominently showing a single component
• LinearLayout - Layout for placing components horizontally or vertically
• TableLayout - Layout for placing components in tabular form
Runtime Errors
• AssertionFailure - Indicates an assertion failure
• ConversionError - Indicates a failed attempt to convert a value of one type into
another
• FileAlreadyExistsError - Indicates a failed attempt to create a file
• FileIOError - Indicates a problem accessing a file
2
• IllegalArgumentError - Indicates an illegal value for a function or procedure
argument
• IndexOutOfBoundsError - Indicates an array or collection access with an index that
is outside of bounds
• NoSuchFileError - Indicates that no file for the given name could be found
• PropertyAccessError - Indicates illegal access to a property
• UninitializedInstanceError - Indicates access to uninitialized object or array variable
• UnknownFileHandleError - Indicates usage of an unknown file handle
• UnknownIdentifierError - Indicates that an identifier could not be resolved at
runtime
3
namespace com.google.devtools.simple.runtime
Application
AddMenuItem
Parameters:
• caption - menu item caption
4
SwitchFormStatic
Parameters:
• form - form to display
Finish
GetPreferenceStatic
Retrieves the value of a previously stored preference (even from previous of the same
program).
Parameters:
• name - name which was used to store the value under
Returns:
• value associated with name
StorePreference
5
Stores the given value under given name. The value can be retrieved using the given name
any time (even on subsequent runs of the program).
Parameters:
• name - name to store value under
• value - value to store (must be a primitive value, objects not allowed)
6
namespace com.google.devtools.simple.runtime
Arrays
Filter
Parameters:
• array - array to search in
• str - substring to search for in the array
• include - if true then include matching strings in the result, otherwise
exclude them
Returns:
• array containing (non-)matching array entries
Join
Parameters:
• array - array containing strings to be appended
• separator - string append between array elements
Returns:
7
• string containing appended array elements
Split
Parameters:
• str - string to be split up
• separator - separator to look for
• count - number of times
Returns:
• array containing split string
UBound
Parameters:
• array - array whose size is requested
• dim - dimension (1 for the first dimension, and so on)
Returns:
• size of the array dimension
8
namespace com.google.devtools.simple.runtime
Assertions
Assertions allow test against assumptions about the runtime state of an application. A failing
assertion will result in an AssertionFailure runtime error.
AssertTrue
Tests whether an assertion is true. Evaluates the given expression and causes an
AssertionFailure runtime error if the expression does not evaluate to True.
Parameters:
• expression - expression to test
AssertFalse
Tests whether an assertion is false. Evaluates the given expression and causes an
AssertionFailure runtime error if the expression does not evaluate to False.
Parameters:
• expression - expression to test
9
namespace com.google.devtools.simple.runtime
Collection
A collection is an ordered set of items. Unlike arrays where all members must have the
same data type, collections do not have that restriction.
Clear
Sub Clear()
Add
Parameters:
• item - item to be added
Item
Parameters:
10
• index - item position
Returns:
• item
Count
Contains
Parameters:
• item - item to look for
Returns:
• True if the item is already in the collection
Remove
Parameters:
• item - item to remove
11
12
namespace com.google.devtools.simple.runtime
Conversions
• Asc - Returns the unicode value of the first character of the given string.
• Chr - Returns a string for the given unicode value.
• Hex - Returns a string containing the hexadecimal value for the given value.
Asc
Returns the unicode value of the first character of the given string.
Parameters:
• str - string to convert first character of
Returns:
• unicode value of first character of str
Chr
Parameters:
• value - unicode value to convert into a string
Returns:
• string consisting of given unicode value
13
Hex
Returns a string containing the hexadecimal value for the given value. If the given value is
not w whole number then its integer part will be used.
Parameters:
• v - value
Returns:
• string with hexadecimal value of v
14
namespace com.google.devtools.simple.runtime
Dates
15
DATE_JANUARY, DATE_FEBRUARY, DATE_MARCH, DATE_APRIL, DATE_MAY,
DATE_JUNE, DATE_JULY, DATE_AUGUST, DATE_SEPTEMBER, DATE_OCTOBER,
DATE_NOVEMBER, DATE_DECEMBER
Month constants.
Weekday constant.
DateAdd
16
Parameters:
• date - date to add to
• intervalKind - kind of interval (one of DATE_YEAR, DATE_MONTH,
DATE_DAY, DATE_WEEK, DATE_HOUR, DATE_MINUTE or DATE_SECOND)
• interval - units to add
DateValue
Parameters:
• value - string to convert
Returns:
• date
Day
Parameters:
• date - date to get day of
Returns:
• day (range 1 - 31)
17
FormatDate
Parameters:
• date - date to format
Returns:
• formatted date
Hour
Parameters:
• date - date to use hours of
Returns:
• hours (range 0 - 23)
Minute
Parameters:
• date - date to use minutes of
Returns:
• minutes (range 0 - 59)
18
Month
Parameters:
• date - date to use month of
Returns:
• month (one of DATE_JANUARY, DATE_FEBRUARY, DATE_MARCH,
DATE_APRIL, DATE_MAY, DATE_JUNE, DATE_JULY, DATE_AUGUST,
DATE_SEPTEMBER, DATE_OCTOBER, DATE_NOVEMBER or DATE_DECEMBER)
MonthName
Parameters:
• date - date to use month of
Returns:
• name of month
Now
Returns:
19
• current date and time
Second
Parameters:
• date - date to use seconds of
Returns:
• seconds (range 0 - 59)
Timer
Returns:
• current system time in milliseconds
Weekday
Parameters:
20
• date - date to use weekday of
Returns:
• weekday (one of DATE_SUNDAY, DATE_MONDAY, DATE_TUESDAY,
DATE_WEDNESDAY, DATE_THURSDAY, DATE_FRIDAY or DATE_SATURDAY)
WeekdayName
Parameters:
• date - date to use weekday of
Returns:
• name of weekday
Year
Parameters:
• date - date to use year of
Returns:
• year
21
namespace com.google.devtools.simple.runtime
Files
Rename
Parameters:
• oldname - file name before renaming
• newname - file name after renaming
22
Delete
Deletes a file.
Parameters:
• name - name of file to delete
Mkdir
Parameters:
• name - name of new directory
Rmdir
Deletes a directory.
Parameters:
• name - name of directory to delete
23
IsDirectory
Checks whether the given name is the name of an existing directory. Causes a runtime error
if the directory doesn't exist.
Parameters:
• name - name to check
Returns:
• True if the name belongs to an existing directory, False otherwise
Exists
Parameters:
• name - file to check
Returns:
• True if the file or directory exists, False otherwise
Open
Parameters:
• name - name of file to open or create
24
Returns:
• file handle
Close
Parameters:
• handle - handle of file to close
Eof
Checks whether the current file position is at the end of the file.
Parameters:
• handle - handle of file to check
Returns:
• True if the end of the file was reaches, False otherwise
Seek
25
Parameters:
• handle - handle of file
• offset - absolute position within file
Returns:
• new position within file
Size
Parameters:
• handle - handle of file
Returns:
• file size
WriteString
Parameters:
• handle - handle of file
• value - value to write
26
ReadString
Parameters:
• handle - handle of file
Returns:
• value read
WriteBoolean
Parameters:
• handle - handle of file
• value - value to write
ReadBoolean
Parameters:
• handle - handle of file
Returns:
• value read
27
WriteByte
Parameters:
• handle - handle of file
• value - value to write
ReadByte
Parameters:
• handle - handle of file
Returns:
• value read
WriteShort
Parameters:
• handle - handle of file
28
• value - value to write
ReadShort
Parameters:
• handle - handle of file
Returns:
• value read
WriteInteger
Parameters:
• handle - handle of file
• value - value to write
ReadInteger
29
Parameters:
• handle - handle of file
Returns:
• value read
WriteLong
Parameters:
• handle - handle of file
• value - value to write
ReadLong
Parameters:
• handle - handle of file
Returns:
• value read
WriteSingle
30
Writes a Single value to a file.
Parameters:
• handle - handle of file
• value - value to write
ReadSingle
Parameters:
• handle - handle of file
Returns:
• value read
WriteDouble
Parameters:
• handle - handle of file
• value - value to write
31
ReadDouble
Parameters:
• handle - handle of file
Returns:
• value read
32
namespace com.google.devtools.simple.runtime
Log
Error
Parameters:
• moduleName - name of the module reporting the message (e.g. "Simple
Runtime Library")
• message - text to log
Warning
Parameters:
• moduleName - name of the module reporting the message (e.g. "Simple
Runtime Library")
• message - text to log
33
Info
Parameters:
• moduleName - name of the module reporting the message (e.g. "Simple
Runtime Library")
• message - text to log
34
namespace com.google.devtools.simple.runtime
Math
• E -Euler's constant.
• PI - Pi.
Const E As Double
Euler's constant.
PI
Const PI As Double
Pi.
35
Abs
Parameters:
• v - value
Returns:
• absolute value
Atn
Parameters:
• v - value
Returns:
• arctangent of v
Atn2
Returns the angle theta from the conversion of rectangular coordinates (x, y) to polar
coordinates (r, theta>).
36
Parameters:
• y - the ordinate coordinate
• x - the abscissa coordinate
Returns:
• the theta component of the point (r, theta) in polar coordinates that
corresponds to the point (x, y) in Cartesian coordinates
Cos
Parameters:
• v - value
Returns:
• cosine of v
Exp
Parameters:
• v - value
Returns:
• e to the power of v
37
Int
Parameters:
• v - value
Returns:
• integer part of v
Log
Parameters:
• v - value
Returns:
• natural logarithm for v
Max
Parameters:
• v1 - first value
• v2 - second value
38
Returns:
• greater value of v1 and v2
Min
Parameters:
• v1 - first value
• v2 - second value
Returns:
• smaller value of v1 and v2
Rnd
Returns a random number in the range between 0.0 (inclusive) and 1.0 (exclusive).
Returns:
• random number (between 0.0 and 1.0)
Sin
39
Parameters:
• v - value
Returns:
• sine of v
Sgn
Parameters:
• v - value
Returns:
• for positive values, 0 for zero, and -1 for negative values
Sqr
Parameters:
• v - value
Returns:
• square root of v
40
Tan
Parameters:
• v - value
Returns:
• tangent of v
DegreesToRadians
Parameters:
• d - value in degrees
Returns:
• radian approximation to d degrees
RadiansToDegrees
Parameters:
• r - value in radians
Returns:
41
• degree approximation to r radians
42
namespace com.google.devtools.simple.runtime
Strings
InStr
Parameters:
• str1 - string to search in
• str2 - string to search for
• start - search start index within str1
Returns:
• index at which str2 was found within str1 or a negative value if str2
was not found within str1
43
InStrRev
Searches for a string in another string starting at the end of that string.
Parameters:
• str1 - string to search in
• str2 - string to search for
• start - search start index within str1
Returns:
• index at which str2 was found within str1 or a negative value if str2
was not found within str1
LCase
Parameters:
• str - string to convert to lowercase
UCase
Parameters:
• str - string to convert to uppercase
44
Left
Returns the specified number of characters from the start of the given string.
Parameters:
• str - string to return characters from
• len - number of characters to return
Returns:
• substring of the given string
Right
Returns the specified number of characters from the end of the given string.
Parameters:
• str - string to return characters from
• len - number of characters to return
Returns:
• substring of the given string
Mid
45
Returns the specified number of characters from the given string starting from the given
index.
Parameters:
• str - string to return characters from
• start - start index within str
• len - number of characters to return
Returns:
• substring of the given string
Len
Parameters:
• str - string to get length of
Returns:
• number of characters (length) of the given string
Trim
Removes leading and trailing space characters from the given string.
Parameters:
• str - string to trim
46
LTrim
Parameters:
• str - string to trim
RTrim
Parameters:
• str - string to trim
Replace
Replaces occurrences of one string with another string in the given string.
Parameters:
• str - string to modify
• find - string to find
• replace - string to replace found string with
• start - start index within str
• count - number of times to perform the replacement (-1 to replace all
occurrences)
47
StrComp
Parameters:
• str1 - first string of comparison
• str2 - second string of comparison
Returns:
• 0 if the strings are equal, a negative number if str2 follows str1 and a
positive number if str1 follows str2
StrReverse
Parameters:
• str - string to reverse
48
namespace com.google.devtools.simple.runtime.errors
AssertionFailure
49
namespace com.google.devtools.simple.runtime.errors
ConversionError
Runtime error indicating a failed attempt of converting a value of a type into a value of
another type, e.g. the String "foo" into an Integer, but also converting from a base type to a
derived type where there is no relationship.
50
namespace com.google.devtools.simple.runtime.errors
FileAlreadyExistsError
Runtime error indicating that the attempt to create a file failed because there is a file
already existing with the same name.
51
namespace com.google.devtools.simple.runtime.errors
FileIOError
52
namespace com.google.devtools.simple.runtime.errors
IllegalArgumentError
53
namespace com.google.devtools.simple.runtime.errors
IndexOutOfBoundsError
Runtime error indicating an array or collection access with an index that is outside of
bounds.
54
namespace com.google.devtools.simple.runtime.errors
NoSuchFileError
Runtime error indicating that no file for the given name could be found.
55
namespace com.google.devtools.simple.runtime.errors
PropertyAccessError
Runtime error indicating write access to a read-only property or read access to a write-only
property.
56
namespace com.google.devtools.simple.runtime.errors
UnknownFileHandleError
57
namespace com.google.devtools.simple.runtime.errors
UnknownIdentifierError
58
namespace com.google.devtools.simple.runtime.errors
UninitializedInstanceError
Runtime error indicating an access to an instance or array variable that is not properly
initialized.
59
namespace com.google.devtools.simple.runtime.components
AccelerometerSensor
Events
Properties
Initialize
Event Initialize()
AccelerationChanged
Parameters:
• xAccel - acceleration minus Gx on the x-axis
• yAccel - acceleration minus Gy on the y-axis
• zAccel - acceleration minus Gz on the z-axis
60
Shaking
Event Shaking()
Available
This property indicates whether the sensor is available on the device running the
application. This property is read-only.
Enabled
Reading from the Enabled property indicates whether the sensor is generating data. Writing
to the Enabled property will turn sensor data generation on or off. Data generation is
enabled by default.
XAccel
Reading the value of this property returns the most recent x acceleration value. In order for
this property to supply meaningful values, the sensor needs to be available and enabled.
Writing to this property will accelerate the device at the given rate. Use this only in a
controlled environment as sudden acceleration may cause severe injury... No, just kidding -
this property is read-only.
61
YAccel
Reading the value of this property returns the most recent y acceleration value. In order for
this property to supply meaningful values, the sensor needs to be available and enabled.
This property is read-only.
ZAccel
Reading the value of this property returns the most recent z acceleration value. In order for
this property to supply meaningful values, the sensor needs to be available and enabled.
This property is read-only.
62
namespace com.google.devtools.simple.runtime.components
Button
Events
Properties
Initialize
Event Initialize()
Click
Event Click()
63
Event raised after the button is clicked or touched.
GotFocus
Event GotFocus()
LostFocus
Event LostFocus()
BackgroundColor
Reading from the BackgroundColor property returns the current background color of the
component. The color value is encoded as &Haarrggbb where aa represents the alpha value
(&H00 - transparent to &HFF - opaque), rr represents the red, gg the green and bb the blue
component of the color. Writing to the BackgroundColor property will set the background
color of the component.
There are a number of predefined color constants: Component.COLOR_NONE,
Component.COLOR_BLACK, Component.COLOR_BLUE,Component.COLOR_CYAN,
Component.COLOR_DKGRAY, Component.COLOR_GRAY, Component.COLOR_GREEN,
Component.COLOR_LTGRAY,Component.COLOR_MAGENTA, Component.COLOR_RED,
Component.COLOR_WHITE and Component.COLOR_YELLOW.
Column
64
Reading from the Column property returns the current column position within a table layout.
Writing to the Column property will set the column position of the component within a table
layout. This property has no meaning for any other layout.
Height
Reading from the Height property returns the current height of the component in pixels.
Writing to the Height property changes the height of the component to the given value in
pixels. There are two special values. Component.LENGTH_PREFERRED sets the preferred
height of the component which depends on the contents of the component.
Component.LENGTH_FILL_PARENT sets the height of the component to its maximum to fill
the height of its parent container.
Row
Reading from the Row property returns the current row position within a table layout.
Writing to the Row property will set the row position of the component within a table layout.
This property has no meaning for any other layout.
Width
Reading from the Width property returns the current width of the component in pixels.
Writing to the Width property changes the width of the component to the given value in
pixels. There are two special values. Component.LENGTH_PREFERRED sets the preferred width
of the component which depends on the contents of the component.
Component.LENGTH_FILL_PARENT sets the width of the component to its maximum to fill the
width of its parent container.
65
FontBold
Reading from this property indicates the font weight. A value of True means that the
component font is bold, False means normal. Writing to this property changes the changes
the font weight.
The default value of this property is False.
FontItalic
Reading from this property indicates the font style. A value of True means that the
component font is italic, False means normal. Writing to this property changes the changes
the font style.
The default value of this property is False.
FontSize
Reading from this property returns the font height in points. Writing to this property
changes the changes the font height.
The default value of this property is 14 points.
FontTypeface
Reading from this property returns the font typeface. The value must be one of
Component.TYPEFACE_DEFAULT,
Component.TYPEFACE_SERIF,Component.TYPEFACE_SANSSERIF or
Component.TYPEFACE_MONOSPACE. Writing to this property changes the changes the font
66
typeface.
The default value of this property is Component.TYPEFACE_DEFAULT.
Justification
Reading from this property returns the text justification. The value must be one of
Component.JUSTIFY_LEFT, Component.JUSTIFY_CENTER or Component.JUSTIFY_RIGHT.
Writing to this property changes the changes the text justification.
The default value of this property is Component.JUSTIFY_LEFT.
Text
Reading from this property returns the text displayed by the component. Writing to this
property changes the changes the text displayed.
TextColor
Reading from the TextColor property returns the current color of the text displayed by this
component. The color value is encoded as &Haarrggbbwhere aa represents the alpha value
(&H00 - transparent to &HFF - opaque), rr represents the red, gg the green and bb the blue
component of the color. Writing to the TextColor property will set the color for the text of
the component.
There are a number of predefined color constants: Component.COLOR_NONE,
Component.COLOR_BLACK, Component.COLOR_BLUE,Component.COLOR_CYAN,
Component.COLOR_DKGRAY, Component.COLOR_GRAY, Component.COLOR_GREEN,
Component.COLOR_LTGRAY,Component.COLOR_MAGENTA, Component.COLOR_RED,
Component.COLOR_WHITE and Component.COLOR_YELLOW.
67
Enabled
Reading from the Enabled property indicates whether the button is enabled. Writing to the
Enabled property will enabled or disable the button.
Buttons are enabled by default.
Image
Reading from this property returns the path of the image currently shown on the
component. If there is no image shown an empty string will be returned. Writing to this
property changes the image shown on the component.
68
namespace com.google.devtools.simple.runtime.components
Canvas
Events
Properties
Functions
Initialize
Event Initialize()
Touched
69
BackgroundColor
Reading from the BackgroundColor property returns the current background color of the
component. The color value is encoded as &Haarrggbb where aa represents the alpha value
(&H00 - transparent to &HFF - opaque), rr represents the red, gg the green and bb the blue
component of the color. Writing to the BackgroundColor property will set the background
color of the component. The default background color of the Canvas component is
Component.COLOR_WHITE.
There are a number of predefined color constants: Component.COLOR_NONE,
Component.COLOR_BLACK, Component.COLOR_BLUE,Component.COLOR_CYAN,
Component.COLOR_DKGRAY, Component.COLOR_GRAY, Component.COLOR_GREEN,
Component.COLOR_LTGRAY,Component.COLOR_MAGENTA, Component.COLOR_RED,
Component.COLOR_WHITE and Component.COLOR_YELLOW.
Column
Reading from the Column property returns the current column position within a table layout.
Writing to the Column property will set the column position of the component within a table
layout. This property has no meaning for any other layout.
Height
Reading from the Height property returns the current height of the component in pixels.
Writing to the Height property changes the height of the component to the given value in
pixels. There are two special values. Component.LENGTH_PREFERRED sets the preferred
height of the component which depends on the contents of the component.
Component.LENGTH_FILL_PARENT sets the height of the component to its maximum to fill
the height of its parent container.
70
Row
Reading from the Row property returns the current row position within a table layout.
Writing to the Row property will set the row position of the component within a table layout.
This property has no meaning for any other layout.
Width
Reading from the Width property returns the current width of the component in pixels.
Writing to the Width property changes the width of the component to the given value in
pixels. There are two special values. Component.LENGTH_PREFERRED sets the preferred width
of the component which depends on the contents of the component.
Component.LENGTH_FILL_PARENT sets the width of the component to its maximum to fill the
width of its parent container.
BackgroundImage
Writing to this property changes the background image shown on the component. The value
assigned to this property should be the name of a file in the project's assets directory. This
property is write-only.
Clear
Sub Clear()
71
DrawPoint
Parameters:
• x - x coordinate
• y - y coordinate
DrawCircle
Draws a circle at the given coordinates on the canvas, with the given radius
Parameters:
• x - x coordinate
• y - y coordinate
• r - radius
DrawLine
Parameters:
• x1 - x coordinate of first point
• y1 - y coordinate of first point
• x2 - x coordinate of second point
• y2 - y coordinate of second point
72
73
namespace com.google.devtools.simple.runtime.components
CheckBox
Events
Properties
Initialize
Event Initialize()
Changed
Event Changed()
74
Event raised after the checkbox's value changed.
GotFocus
Event GotFocus()
LostFocus
Event LostFocus()
BackgroundColor
Reading from the BackgroundColor property returns the current background color of the
component. The color value is encoded as &Haarrggbb where aa represents the alpha value
(&H00 - transparent to &HFF - opaque), rr represents the red, gg the green and bb the blue
component of the color. Writing to the BackgroundColor property will set the background
color of the component.
There are a number of predefined color constants: Component.COLOR_NONE,
Component.COLOR_BLACK, Component.COLOR_BLUE,Component.COLOR_CYAN,
Component.COLOR_DKGRAY, Component.COLOR_GRAY, Component.COLOR_GREEN,
Component.COLOR_LTGRAY, Component.COLOR_MAGENTA, Component.COLOR_RED,
Component.COLOR_WHITE and Component.COLOR_YELLOW.
Column
75
Reading from the Column property returns the current column position within a table layout.
Writing to the Column property will set the column position of the component within a table
layout. This property has no meaning for any other layout.
Height
Reading from the Height property returns the current height of the component in pixels.
Writing to the Height property changes the height of the component to the given value in
pixels. There are two special values. Component.LENGTH_PREFERRED sets the preferred
height of the component which depends on the contents of the component.
Component.LENGTH_FILL_PARENT sets the height of the component to its maximum to fill
the height of its parent container.
Row
Reading from the Row property returns the current row position within a table layout.
Writing to the Row property will set the row position of the component within a table layout.
This property has no meaning for any other layout.
Width
Reading from the Width property returns the current width of the component in pixels.
Writing to the Width property changes the width of the component to the given value in
pixels. There are two special values. Component.LENGTH_PREFERRED sets the preferred width
of the component which depends on the contents of the component.
Component.LENGTH_FILL_PARENT sets the width of the component to its maximum to fill the
width of its parent container.
76
FontBold
Reading from this property indicates the font weight. A value of True means that the
component font is bold, False means normal. Writing to this property changes the changes
the font weight.
The default value of this property is False.
FontItalic
Reading from this property indicates the font style. A value of True means that the
component font is italic, False means normal. Writing to this property changes the changes
the font style.
The default value of this property is False.
FontSize
Reading from this property returns the font height in points. Writing to this property
changes the changes the font height.
The default value of this property is 14 points.
FontTypeface
Reading from this property returns the font typeface. The value must be one of
Component.TYPEFACE_DEFAULT, Component.TYPEFACE_SERIF,
Component.TYPEFACE_SANSSERIF or Component.TYPEFACE_MONOSPACE. Writing to this
property changes the changes the font typeface.
77
The default value of this property is Component.TYPEFACE_DEFAULT.
Justification
Reading from this property returns the text justification. The value must be one of
Component.JUSTIFY_LEFT, Component.JUSTIFY_CENTER or Component.JUSTIFY_RIGHT.
Writing to this property changes the changes the text justification.
The default value of this property is Component.JUSTIFY_LEFT.
Text
Reading from this property returns the text displayed by the component. Writing to this
property changes the changes the text displayed.
TextColor
Reading from the TextColor property returns the current color of the text displayed by this
component. The color value is encoded as &Haarrggbb where aa represents the alpha value
(&H00 - transparent to &HFF - opaque), rr represents the red, gg the green and bb the blue
component of the color. Writing to the TextColor property will set the color for the text of
the component.
There are a number of predefined color constants: Component.COLOR_NONE,
Component.COLOR_BLACK, Component.COLOR_BLUE,Component.COLOR_CYAN,
Component.COLOR_DKGRAY, Component.COLOR_GRAY, Component.COLOR_GREEN,
Component.COLOR_LTGRAY, Component.COLOR_MAGENTA, Component.COLOR_RED,
Component.COLOR_WHITE and Component.COLOR_YELLOW.
78
Enabled
Reading from the Enabled property indicates whether the checkbox is enabled. Writing to
the Enabled property will enabled or disable the checkbox.
Checkboxes are enabled by default.
Value
Reading from the Value property indicates the current state of the checkbox. Writing to the
Value property will either check or uncheck the checkbox.
Checkboxes are unchecked by default.
79
namespace com.google.devtools.simple.runtime.components
EmailPicker
Editable text box using auto-completion to pick out an email address from contacts.
Events
Properties
Initialize
Event Initialize()
GotFocus
Event GotFocus()
80
LostFocus
Event LostFocus()
BackgroundColor
Reading from the BackgroundColor property returns the current background color of the
component. The color value is encoded as &Haarrggbb where aa represents the alpha value
(&H00 - transparent to &HFF - opaque), rr represents the red, gg the green and bb the blue
component of the color. Writing to the BackgroundColor property will set the background
color of the component.
There are a number of predefined color constants: Component.COLOR_NONE,
Component.COLOR_BLACK, Component.COLOR_BLUE, Component.COLOR_CYAN,
Component.COLOR_DKGRAY, Component.COLOR_GRAY, Component.COLOR_GREEN,
Component.COLOR_LTGRAY, Component.COLOR_MAGENTA, Component.COLOR_RED,
Component.COLOR_WHITE and Component.COLOR_YELLOW.
Column
Reading from the Column property returns the current column position within a table layout.
Writing to the Column property will set the column position of the component within a table
layout. This property has no meaning for any other layout.
Height
Reading from the Height property returns the current height of the component in pixels.
81
Writing to the Height property changes the height of the component to the given value in
pixels. There are two special values. Component.LENGTH_PREFERRED sets the preferred
height of the component which depends on the contents of the component.
Component.LENGTH_FILL_PARENT sets the height of the component to its maximum to fill
the height of its parent container.
Row
Reading from the Row property returns the current row position within a table layout.
Writing to the Row property will set the row position of the component within a table layout.
This property has no meaning for any other layout.
Width
Reading from the Width property returns the current width of the component in pixels.
Writing to the Width property changes the width of the component to the given value in
pixels. There are two special values. Component.LENGTH_PREFERRED sets the preferred width
of the component which depends on the contents of the component.
Component.LENGTH_FILL_PARENT sets the width of the component to its maximum to fill the
width of its parent container.
FontBold
Reading from this property indicates the font weight. A value of True means that the
component font is bold, False means normal. Writing to this property changes the changes
the font weight.
The default value of this property is False.
82
FontItalic
Reading from this property indicates the font style. A value of True means that the
component font is italic, False means normal. Writing to this property changes the changes
the font style.
The default value of this property is False.
FontSize
Reading from this property returns the font height in points. Writing to this property
changes the changes the font height.
The default value of this property is 14 points.
FontTypeface
Reading from this property returns the font typeface. The value must be one of
Component.TYPEFACE_DEFAULT, Component.TYPEFACE_SERIF,
Component.TYPEFACE_SANSSERIF or Component.TYPEFACE_MONOSPACE. Writing to this
property changes the changes the font typeface.
The default value of this property is Component.TYPEFACE_DEFAULT.
Justification
Reading from this property returns the text justification. The value must be one of
Component.JUSTIFY_LEFT, Component.JUSTIFY_CENTER or Component.JUSTIFY_RIGHT.
Writing to this property changes the changes the text justification.
83
The default value of this property is Component.JUSTIFY_LEFT.
Text
Reading from this property returns the text displayed by the component. Writing to this
property changes the changes the text displayed.
TextColor
Reading from the TextColor property returns the current color of the text displayed by this
component. The color value is encoded as &Haarrggbb where aa represents the alpha value
(&H00 - transparent to &HFF - opaque), rr represents the red, gg the green and bb the blue
component of the color. Writing to the TextColor property will set the color for the text of
the component.
There are a number of predefined color constants: Component.COLOR_NONE,
Component.COLOR_BLACK, Component.COLOR_BLUE, Component.COLOR_CYAN,
Component.COLOR_DKGRAY, Component.COLOR_GRAY, Component.COLOR_GREEN,
Component.COLOR_LTGRAY, Component.COLOR_MAGENTA, Component.COLOR_RED,
Component.COLOR_WHITE and Component.COLOR_YELLOW.
Enabled
Reading from the Enabled property indicates whether the email picker is enabled. Writing to
the Enabled property will enabled or disable the email picker.
Email pickers are enabled by default.
84
namespace com.google.devtools.simple.runtime.components
Form
Form is the base object of all forms defined by applications. A form is the root container for
all components on it.
Events
Properties
Initialize
Event Initialize()
Event raised upon form initialization. Inside of an event handler for this event is the best
place for adding components dynamically to a form. For more information of dynamic forms
see How To Write A Simple Application.
Keyboard
Parameters:
85
• keycode - constant identifying pressed key (one of
Component.KEYCODE_0, Component.KEYCODE_1,
Component.KEYCODE_2, Component.KEYCODE_3,
Component.KEYCODE_4, Component.KEYCODE_5,
Component.KEYCODE_6, Component.KEYCODE_7,
Component.KEYCODE_8, Component.KEYCODE_9,
Component.KEYCODE_A, Component.KEYCODE_APOSTROPHE,
Component.KEYCODE_AT, Component.KEYCODE_B,
Component.KEYCODE_BACK, Component.KEYCODE_BACKSLASH,
Component.KEYCODE_C, Component.KEYCODE_CALL,
Component.KEYCODE_CAMERA, Component.KEYCODE_CLEAR,
Component.KEYCODE_COMMA, Component.KEYCODE_D,
Component.KEYCODE_DEL, Component.KEYCODE_E,
Component.KEYCODE_ENDCALL, Component.KEYCODE_ENTER,
Component.KEYCODE_ENVELOPE, Component.KEYCODE_EQUALS,
Component.KEYCODE_EXPLORER, Component.KEYCODE_F,
Component.KEYCODE_FOCUS, Component.KEYCODE_G,
Component.KEYCODE_GRAVE, Component.KEYCODE_H,
Component.KEYCODE_HEADSETHOOK, Component.KEYCODE_HOME,
Component.KEYCODE_I, Component.KEYCODE_J,
Component.KEYCODE_K, Component.KEYCODE_L,
Component.KEYCODE_LEFT, Component.KEYCODE_LEFT_ALT,
Component.KEYCODE_LEFT_BRACKET, Component.KEYCODE_LEFT_SHIFT,
Component.KEYCODE_M, Component.KEYCODE_MEDIA_FAST_FORWARD,
Component.KEYCODE_MEDIA_NEXT,
Component.KEYCODE_MEDIA_PLAY_PAUSE,
Component.KEYCODE_MEDIA_PREVIOUS,
Component.KEYCODE_MEDIA_REWIND, Component.KEYCODE_MEDIA_STOP,
Component.KEYCODE_MENU, Component.KEYCODE_MINUS,
Component.KEYCODE_MUTE, Component.KEYCODE_N,
Component.KEYCODE_NOTIFICATION, Component.KEYCODE_NUM,
Component.KEYCODE_O, Component.KEYCODE_P,
Component.KEYCODE_PAD_CENTER, Component.KEYCODE_PAD_DOWN,
Component.KEYCODE_PAD_LEFT, Component.KEYCODE_PAD_RIGHT,
Component.KEYCODE_PAD_UP, Component.KEYCODE_PERIOD,
Component.KEYCODE_PLUS, Component.KEYCODE_POUND,
Component.KEYCODE_POWER, Component.KEYCODE_Q,
Component.KEYCODE_R, Component.KEYCODE_RIGHT,
Component.KEYCODE_RIGHT_ALT, Component.KEYCODE_RIGHT_BRACKET,
Component.KEYCODE_RIGHT_SHIFT, Component.KEYCODE_S,
Component.KEYCODE_SEARCH, Component.KEYCODE_SEMICOLON,
Component.KEYCODE_SLASH, Component.KEYCODE_SPACE,
Component.KEYCODE_STAR, Component.KEYCODE_SYM,
Component.KEYCODE_T, Component.KEYCODE_TAB,
Component.KEYCODE_U, Component.KEYCODE_V,
Component.KEYCODE_VOLUME_DOWN, Component.KEYCODE_VOLUME_UP,
86
Component.KEYCODE_W, Component.KEYCODE_X, Component.KEYCODE_Y
or Component.KEYCODE_Z)
MenuSelected
Parameters:
• caption - string identifying selected menu item
TouchGesture
Event raised after input of a gesture on the touch screen was recognized.
Parameters:
• direction - constant identifying direction of touch gesture (one of
Component.TOUCH_DOUBLETAP, Component.TOUCH_FLINGDOWN,
Component.TOUCH_FLINGLEFT, Component.TOUCH_FLINGRIGHT,
Component.TOUCH_FLINGUP, Component.TOUCH_MOVEDOWN,
Component.TOUCH_MOVELEFT, Component.TOUCH_MOVERIGHT,
Component.TOUCH_MOVEUP or Component.TOUCH_TAP)
BackgroundColor
87
Reading from the BackgroundColor property returns the current background color of the
form. The color value is encoded as &Haarrggbb where aa represents the alpha value (&H00
- transparent to &HFF - opaque), rr represents the red, gg the green and bb the blue
component of the color. Writing to the BackgroundColor property will set the background
color of the form.
There are a number of predefined color constants: Component.COLOR_NONE,
Component.COLOR_BLACK, Component.COLOR_BLUE, Component.COLOR_CYAN,
Component.COLOR_DKGRAY, Component.COLOR_GRAY, Component.COLOR_GREEN,
Component.COLOR_LTGRAY, Component.COLOR_MAGENTA, Component.COLOR_RED,
Component.COLOR_WHITE and Component.COLOR_YELLOW.
The default background color for forms is Component.COLOR_WHITE.
Height
Reading from the Height property returns the current height of the form in pixels. For forms
the Height property is a read-only property.
Width
Reading from the Width property returns the current width of the form in pixels. For forms
the Width property is a read-only property.
BackgroundImage
Writing to this property changes the background image shown on the component. The value
assigned to this property should be the name of a file in the project's assets directory. This
property is write-only.
88
Layout
Reading from the Layout property returns the current layout object instance. For more
information about layouts see LinearLayout, TableLayout and FrameLayout. Writing to the
Layout property changes the layout to a different layout. The following predefined constants
can be used: Component.LAYOUT_LINEAR, Component.LAYOUT_TABLE or
Component.LAYOUT_FRAME.
Note that once components have been added to the form its layout cannot be changed any
longer!
Scrollable
Reading from the this property indicates whether the contents of the form are scrollable.
Writing to this property will make the contents of the form scrollable in case the
components of the form do not fit within the height or width of the form.
Title
Reading from the this property returns the title shown at the top of the form. Writing to this
property changes the title of the form.
89
namespace com.google.devtools.simple.runtime.components
Image
Events
Properties
Initialize
Event Initialize()
BackgroundColor
Reading from the BackgroundColor property returns the current background color of the
component. The color value is encoded as &Haarrggbb where aa represents the alpha value
(&H00 - transparent to &HFF - opaque), rr represents the red, gg the green and bb the blue
component of the color. Writing to the BackgroundColor property will set the background
color of the component.
There are a number of predefined color constants: Component.COLOR_NONE,
Component.COLOR_BLACK, Component.COLOR_BLUE, Component.COLOR_CYAN,
Component.COLOR_DKGRAY, Component.COLOR_GRAY, Component.COLOR_GREEN,
Component.COLOR_LTGRAY, Component.COLOR_MAGENTA, Component.COLOR_RED,
Component.COLOR_WHITE and Component.COLOR_YELLOW.
90
Column
Reading from the Column property returns the current column position within a table layout.
Writing to the Column property will set the column position of the component within a table
layout. This property has no meaning for any other layout.
Height
Reading from the Height property returns the current height of the component in pixels.
Writing to the Height property changes the height of the component to the given value in
pixels. There are two special values. Component.LENGTH_PREFERRED sets the preferred
height of the component which depends on the contents of the component.
Component.LENGTH_FILL_PARENT sets the height of the component to its maximum to fill
the height of its parent container.
Row
Reading from the Row property returns the current row position within a table layout.
Writing to the Row property will set the row position of the component within a table layout.
This property has no meaning for any other layout.
Width
Reading from the Width property returns the current width of the component in pixels.
Writing to the Width property changes the width of the component to the given value in
91
pixels. There are two special values. Component.LENGTH_PREFERRED sets the preferred width
of the component which depends on the contents of the component.
Component.LENGTH_FILL_PARENT sets the width of the component to its maximum to fill the
width of its parent container.
Picture
Writing to this property changes the image shown on the component. The value assigned to
this property should be the name of a file in the project's assets directory. This property is
write-only.
92
namespace com.google.devtools.simple.runtime.components
Label
Events
Properties
Initialize
Event Initialize()
BackgroundColor
Reading from the BackgroundColor property returns the current background color of the
component. The color value is encoded as &Haarrggbb where aa represents the alpha value
(&H00 - transparent to &HFF - opaque), rr represents the red, gg the green and bb the blue
component of the color. Writing to the BackgroundColor property will set the background
color of the component.
There are a number of predefined color constants: Component.COLOR_NONE,
93
Component.COLOR_BLACK, Component.COLOR_BLUE, Component.COLOR_CYAN,
Component.COLOR_DKGRAY, Component.COLOR_GRAY, Component.COLOR_GREEN,
Component.COLOR_LTGRAY, Component.COLOR_MAGENTA, Component.COLOR_RED,
Component.COLOR_WHITE and Component.COLOR_YELLOW.
Column
Reading from the Column property returns the current column position within a table layout.
Writing to the Column property will set the column position of the component within a table
layout. This property has no meaning for any other layout.
Height
Reading from the Height property returns the current height of the component in pixels.
Writing to the Height property changes the height of the component to the given value in
pixels. There are two special values. Component.LENGTH_PREFERRED sets the preferred
height of the component which depends on the contents of the component.
Component.LENGTH_FILL_PARENT sets the height of the component to its maximum to fill
the height of its parent container.
Row
Reading from the Row property returns the current row position within a table layout.
Writing to the Row property will set the row position of the component within a table layout.
This property has no meaning for any other layout.
94
Width
Reading from the Width property returns the current width of the component in pixels.
Writing to the Width property changes the width of the component to the given value in
pixels. There are two special values. Component.LENGTH_PREFERRED sets the preferred width
of the component which depends on the contents of the component.
Component.LENGTH_FILL_PARENT sets the width of the component to its maximum to fill the
width of its parent container.
FontBold
Reading from this property indicates the font weight. A value of True means that the
component font is bold, False means normal. Writing to this property changes the changes
the font weight.
The default value of this property is False.
FontItalic
Reading from this property indicates the font style. A value of True means that the
component font is italic, False means normal. Writing to this property changes the changes
the font style.
The default value of this property is False.
FontSize
Reading from this property returns the font height in points. Writing to this property
95
changes the changes the font height.
The default value of this property is 14 points.
FontTypeface
Reading from this property returns the font typeface. The value must be one of
Component.TYPEFACE_DEFAULT, Component.TYPEFACE_SERIF,
Component.TYPEFACE_SANSSERIF or Component.TYPEFACE_MONOSPACE. Writing to this
property changes the changes the font typeface.
The default value of this property is Component.TYPEFACE_DEFAULT.
Justification
Reading from this property returns the text justification. The value must be one of
Component.JUSTIFY_LEFT, Component.JUSTIFY_CENTER or Component.JUSTIFY_RIGHT.
Writing to this property changes the changes the text justification.
The default value of this property is Component.JUSTIFY_LEFT.
Text
Reading from this property returns the text displayed by the component. Writing to this
property changes the changes the text displayed.
TextColor
96
Reading from the TextColor property returns the current color of the text displayed by this
component. The color value is encoded as &Haarrggbb where aa represents the alpha value
(&H00 - transparent to &HFF - opaque), rr represents the red, gg the green and bb the blue
component of the color. Writing to the TextColor property will set the color for the text of
the component.
There are a number of predefined color constants: Component.COLOR_NONE,
Component.COLOR_BLACK, Component.COLOR_BLUE, Component.COLOR_CYAN,
Component.COLOR_DKGRAY, Component.COLOR_GRAY, Component.COLOR_GREEN,
Component.COLOR_LTGRAY, Component.COLOR_MAGENTA, Component.COLOR_RED,
Component.COLOR_WHITE and Component.COLOR_YELLOW.
97
namespace com.google.devtools.simple.runtime.components
LocationSensor
Sensor that can determines the current location (longitude, latitude, altitude).
Events
Properties
Initialize
Event Initialize()
Changed
Parameters:
• latitude - latitude
• longitude - longitude
98
• altitude - altitude in feet.
Available
This property indicates whether the sensor is available on the device running the
application. This property is read-only.
Enabled
Reading from the Enabled property indicates whether the sensor is generating data. Writing
to the Enabled property will turn sensor data generation on or off. Data generation is
enabled by default.
HasAltitude
Indicates whether the location sensor provides altitude information. This property is read-
only.
Longitude
Reading the value of this property returns the most recent longitude value of the device. In
order for this property to supply meaningful values, the sensor needs to be available and
99
enabled. This property is read-only.
Latitude
Reading the value of this property returns the most recent latitude value of the device. In
order for this property to supply meaningful values, the sensor needs to be available and
enabled. This property is read-only.
Altitude
Reading the value of this property returns the most recent altitude value of the device. In
order for this property to supply meaningful values, the sensor needs to be available and
enabled. This property is read-only.
CurrentAddress
Provides a street address for the current location. If no street address can be found for the
current location, an empty string will be returned. In order for this property to supply
meaningful values, the sensor needs to be available and enabled. This property is read-only.
100
namespace com.google.devtools.simple.runtime.components
OrientationSensor
Events
Properties
Initialize
Event Initialize()
OrientationChanged
Parameters:
• yaw - angle between the magnetic north direction and the Y axis,
around the Z axis (0 to 359). 0=North, 90=East, 180=South, 270=West
101
• pitch - rotation around X axis (-180 to 180), with positive values when
the z-axis moves toward the y-axis.
• roll - rotation around Y axis (-90 to 90), with positive values when the
x-axis moves away from the z-axis.
Available
This property indicates whether the sensor is available on the device running the
application. This property is read-only.
Enabled
Reading from the Enabled property indicates whether the sensor is generating data. Writing
to the Enabled property will turn sensor data generation on or off. Data generation is
enabled by default.
Pitch
Reading the value of this property returns the most recent pitch value of the device. In
order for this property to supply meaningful values, the sensor needs to be available and
enabled. This property is read-only.
Roll
102
Reading the value of this property returns the most recent pitch value of the device. In
order for this property to supply meaningful values, the sensor needs to be available and
enabled. This property is read-only.
Yaw
Reading the value of this property returns the most recent pitch value of the device. In
order for this property to supply meaningful values, the sensor needs to be available and
enabled. This property is read-only.
Angle
Reading the value of this property returns the angle in which the device is tilted in degrees.
For the magnitude of the tilt, use the Magnitude property. In order for this property to
supply meaningful values, the sensor needs to be available and enabled. This property is
read-only.
Magnitude
Reading the value of this property returns a number between 0 and 1, inclusive, indicating
how far the device is tilted. For the angle of the tilt, use the Angle property. In order for this
property to supply meaningful values, the sensor needs to be available and enabled. This
property is read-only.
103
namespace com.google.devtools.simple.runtime.components
Panel
Events
Properties
Initialize
Event Initialize()
BackgroundColor
Reading from the BackgroundColor property returns the current background color of the
component. The color value is encoded as &Haarrggbb where aa represents the alpha value
(&H00 - transparent to &HFF - opaque), rr represents the red, gg the green and bb the blue
component of the color. Writing to the BackgroundColor property will set the background
color of the component.
There are a number of predefined color constants: Component.COLOR_NONE,
Component.COLOR_BLACK, Component.COLOR_BLUE, Component.COLOR_CYAN,
Component.COLOR_DKGRAY, Component.COLOR_GRAY, Component.COLOR_GREEN,
Component.COLOR_LTGRAY, Component.COLOR_MAGENTA, Component.COLOR_RED,
Component.COLOR_WHITE and Component.COLOR_YELLOW.
104
Column
Reading from the Column property returns the current column position within a table layout.
Writing to the Column property will set the column position of the component within a table
layout. This property has no meaning for any other layout.
Height
Reading from the Height property returns the current height of the component in pixels.
Writing to the Height property changes the height of the component to the given value in
pixels. There are two special values. Component.LENGTH_PREFERRED sets the preferred
height of the component which depends on the contents of the component.
Component.LENGTH_FILL_PARENT sets the height of the component to its maximum to fill
the height of its parent container.
Row
Reading from the Row property returns the current row position within a table layout.
Writing to the Row property will set the row position of the component within a table layout.
This property has no meaning for any other layout.
Width
Reading from the Width property returns the current width of the component in pixels.
Writing to the Width property changes the width of the component to the given value in
pixels. There are two special values. Component.LENGTH_PREFERRED sets the preferred width
of the component which depends on the contents of the component.
105
Component.LENGTH_FILL_PARENT sets the width of the component to its maximum to fill the
width of its parent container.
Layout
Reading from the Layout property returns the current layout object instance. For more
information about layouts see LinearLayout, TableLayout and FrameLayout. Writing to the
Layout property changes the layout to a different layout. The following predefined constants
can be used: Component.LAYOUT_LINEAR, Component.LAYOUT_TABLE or
Component.LAYOUT_FRAME.
Note that once components have been added to the panel its layout cannot be changed any
longer!
106
namespace com.google.devtools.simple.runtime.components
PasswordTextBox
Events
Properties
Initialize
Event Initialize()
GotFocus
Event GotFocus()
107
LostFocus
Event LostFocus()
BackgroundColor
Reading from the BackgroundColor property returns the current background color of the
component. The color value is encoded as &Haarrggbb where aa represents the alpha value
(&H00 - transparent to &HFF - opaque), rr represents the red, gg the green and bb the blue
component of the color. Writing to the BackgroundColor property will set the background
color of the component.
There are a number of predefined color constants: Component.COLOR_NONE,
Component.COLOR_BLACK, Component.COLOR_BLUE, Component.COLOR_CYAN,
Component.COLOR_DKGRAY, Component.COLOR_GRAY, Component.COLOR_GREEN,
Component.COLOR_LTGRAY, Component.COLOR_MAGENTA, Component.COLOR_RED,
Component.COLOR_WHITE and Component.COLOR_YELLOW.
Column
Reading from the Column property returns the current column position within a table layout.
Writing to the Column property will set the column position of the component within a table
layout. This property has no meaning for any other layout.
Height
108
Reading from the Height property returns the current height of the component in pixels.
Writing to the Height property changes the height of the component to the given value in
pixels. There are two special values. Component.LENGTH_PREFERRED sets the preferred
height of the component which depends on the contents of the component.
Component.LENGTH_FILL_PARENT sets the height of the component to its maximum to fill
the height of its parent container.
Row
Reading from the Row property returns the current row position within a table layout.
Writing to the Row property will set the row position of the component within a table layout.
This property has no meaning for any other layout.
Width
Reading from the Width property returns the current width of the component in pixels.
Writing to the Width property changes the width of the component to the given value in
pixels. There are two special values. Component.LENGTH_PREFERRED sets the preferred width
of the component which depends on the contents of the component.
Component.LENGTH_FILL_PARENT sets the width of the component to its maximum to fill the
width of its parent container.
FontBold
Reading from this property indicates the font weight. A value of True means that the
component font is bold, False means normal. Writing to this property changes the changes
the font weight.
The default value of this property is False.
109
FontItalic
Reading from this property indicates the font style. A value of True means that the
component font is italic, False means normal. Writing to this property changes the changes
the font style.
The default value of this property is False.
FontSize
Reading from this property returns the font height in points. Writing to this property
changes the changes the font height.
The default value of this property is 14 points.
FontTypeface
Reading from this property returns the font typeface. The value must be one of
Component.TYPEFACE_DEFAULT, Component.TYPEFACE_SERIF,
Component.TYPEFACE_SANSSERIF or Component.TYPEFACE_MONOSPACE. Writing to this
property changes the changes the font typeface.
The default value of this property is Component.TYPEFACE_DEFAULT.
Justification
Reading from this property returns the text justification. The value must be one of
Component.JUSTIFY_LEFT, Component.JUSTIFY_CENTER or Component.JUSTIFY_RIGHT.
Writing to this property changes the changes the text justification.
110
The default value of this property is Component.JUSTIFY_LEFT.
Text
Reading from this property returns the text displayed by the component. Writing to this
property changes the changes the text displayed.
TextColor
Reading from the TextColor property returns the current color of the text displayed by this
component. The color value is encoded as &Haarrggbb where aa represents the alpha value
(&H00 - transparent to &HFF - opaque), rr represents the red, gg the green and bb the blue
component of the color. Writing to the TextColor property will set the color for the text of
the component.
There are a number of predefined color constants: Component.COLOR_NONE,
Component.COLOR_BLACK, Component.COLOR_BLUE, Component.COLOR_CYAN,
Component.COLOR_DKGRAY, Component.COLOR_GRAY, Component.COLOR_GREEN,
Component.COLOR_LTGRAY, Component.COLOR_MAGENTA, Component.COLOR_RED,
Component.COLOR_WHITE and Component.COLOR_YELLOW.
Enabled
Reading from the Enabled property indicates whether the password textbox is enabled.
Writing to the Enabled property will enabled or disable the password textbox.
Password textboxes are enabled by default.
111
Hint
Reading from the Hint property returns the text of the hint that will be shown for the
password textbox. Writing to the Hint property will change the hint being shown for the
password textbox.
112
namespace com.google.devtools.simple.runtime.components
Phone
Events
Properties
Functions
Initialize
Event Initialize()
Available
This property indicates whether the sensor is available on the device running the
application. This property is read-only.
Call
113
Places a call to the given phone number.
Parameters:
• phoneNumber - phone number in the form of numbers only (no spaces,
no dashes etc.)
Vibrate
Parameters:
• duration - duration in milliseconds
114
namespace com.google.devtools.simple.runtime.components
RadioButton
A radio button is a two-state button that can be checked or unchecked. I can only be used
within a panel with a linear layout. Checking a radio button will automatically uncheck any
previously checked radio button within the same panel.
Events
Properties
Initialize
Event Initialize()
Changed
Event Changed()
115
Event raised after the radio button's value changed.
GotFocus
Event GotFocus()
LostFocus
Event LostFocus()
BackgroundColor
Reading from the BackgroundColor property returns the current background color of the
component. The color value is encoded as &Haarrggbb where aa represents the alpha value
(&H00 - transparent to &HFF - opaque), rr represents the red, gg the green and bb the blue
component of the color. Writing to the BackgroundColor property will set the background
color of the component.
There are a number of predefined color constants: Component.COLOR_NONE,
Component.COLOR_BLACK, Component.COLOR_BLUE, Component.COLOR_CYAN,
Component.COLOR_DKGRAY, Component.COLOR_GRAY, Component.COLOR_GREEN,
Component.COLOR_LTGRAY, Component.COLOR_MAGENTA, Component.COLOR_RED,
Component.COLOR_WHITE and Component.COLOR_YELLOW.
Column
116
Reading from the Column property returns the current column position within a table layout.
Writing to the Column property will set the column position of the component within a table
layout. This property has no meaning for any other layout.
Height
Reading from the Height property returns the current height of the component in pixels.
Writing to the Height property changes the height of the component to the given value in
pixels. There are two special values. Component.LENGTH_PREFERRED sets the preferred
height of the component which depends on the contents of the component.
Component.LENGTH_FILL_PARENT sets the height of the component to its maximum to fill
the height of its parent container.
Row
Reading from the Row property returns the current row position within a table layout.
Writing to the Row property will set the row position of the component within a table layout.
This property has no meaning for any other layout.
Width
Reading from the Width property returns the current width of the component in pixels.
Writing to the Width property changes the width of the component to the given value in
pixels. There are two special values. Component.LENGTH_PREFERRED sets the preferred width
of the component which depends on the contents of the component.
Component.LENGTH_FILL_PARENT sets the width of the component to its maximum to fill the
width of its parent container.
117
FontBold
Reading from this property indicates the font weight. A value of True means that the
component font is bold, False means normal. Writing to this property changes the changes
the font weight.
The default value of this property is False.
FontItalic
Reading from this property indicates the font style. A value of True means that the
component font is italic, False means normal. Writing to this property changes the changes
the font style.
The default value of this property is False.
FontSize
Reading from this property returns the font height in points. Writing to this property
changes the changes the font height.
The default value of this property is 14 points.
FontTypeface
Reading from this property returns the font typeface. The value must be one of
Component.TYPEFACE_DEFAULT, Component.TYPEFACE_SERIF,
Component.TYPEFACE_SANSSERIF or Component.TYPEFACE_MONOSPACE. Writing to this
property changes the changes the font typeface.
118
The default value of this property is Component.TYPEFACE_DEFAULT.
Justification
Reading from this property returns the text justification. The value must be one of
Component.JUSTIFY_LEFT, Component.JUSTIFY_CENTER or Component.JUSTIFY_RIGHT.
Writing to this property changes the changes the text justification.
The default value of this property is Component.JUSTIFY_LEFT.
Text
Reading from this property returns the text displayed by the component. Writing to this
property changes the changes the text displayed.
TextColor
Reading from the TextColor property returns the current color of the text displayed by this
component. The color value is encoded as &Haarrggbb where aa represents the alpha value
(&H00 - transparent to &HFF - opaque), rr represents the red, gg the green and bb the blue
component of the color. Writing to the TextColor property will set the color for the text of
the component.
There are a number of predefined color constants: Component.COLOR_NONE,
Component.COLOR_BLACK, Component.COLOR_BLUE, Component.COLOR_CYAN,
Component.COLOR_DKGRAY, Component.COLOR_GRAY, Component.COLOR_GREEN,
Component.COLOR_LTGRAY, Component.COLOR_MAGENTA, Component.COLOR_RED,
Component.COLOR_WHITE and Component.COLOR_YELLOW.
119
Enabled
Reading from the Enabled property indicates whether the radio button is enabled. Writing to
the Enabled property will enabled or disable the radio button.
Radio buttons are enabled by default.
Value
Reading from the Value property indicates the current state of the radio button. Writing to
the Value property will either check or uncheck the radio button.
Radio buttons are unchecked by default.
120
namespace com.google.devtools.simple.runtime.components
TextBox
Events
Properties
Initialize
Event Initialize()
GotFocus
Event GotFocus()
121
Event raised after the component gains focus.
LostFocus
Event LostFocus()
Validate
Event raised after each character input. A handler for this event may check the input text
and validate the input by setting the accept reference parameter.
Parameters:
• text - proposed content for the text box
• accept - indicates whether to accept the input (default value is True)
BackgroundColor
Reading from the BackgroundColor property returns the current background color of the
component. The color value is encoded as &Haarrggbb where aa represents the alpha value
(&H00 - transparent to &HFF - opaque), rr represents the red, gg the green and bb the blue
component of the color. Writing to the BackgroundColor property will set the background
color of the component.
There are a number of predefined color constants: Component.COLOR_NONE,
Component.COLOR_BLACK, Component.COLOR_BLUE, Component.COLOR_CYAN,
Component.COLOR_DKGRAY, Component.COLOR_GRAY, Component.COLOR_GREEN,
Component.COLOR_LTGRAY, Component.COLOR_MAGENTA, Component.COLOR_RED,
Component.COLOR_WHITE and Component.COLOR_YELLOW.
122
Column
Reading from the Column property returns the current column position within a table layout.
Writing to the Column property will set the column position of the component within a table
layout. This property has no meaning for any other layout.
Height
Reading from the Height property returns the current height of the component in pixels.
Writing to the Height property changes the height of the component to the given value in
pixels. There are two special values. Component.LENGTH_PREFERRED sets the preferred
height of the component which depends on the contents of the component.
Component.LENGTH_FILL_PARENT sets the height of the component to its maximum to fill
the height of its parent container.
Row
Reading from the Row property returns the current row position within a table layout.
Writing to the Row property will set the row position of the component within a table layout.
This property has no meaning for any other layout.
Width
Reading from the Width property returns the current width of the component in pixels.
123
Writing to the Width property changes the width of the component to the given value in
pixels. There are two special values. Component.LENGTH_PREFERRED sets the preferred width
of the component which depends on the contents of the component.
Component.LENGTH_FILL_PARENT sets the width of the component to its maximum to fill the
width of its parent container.
FontBold
Reading from this property indicates the font weight. A value of True means that the
component font is bold, False means normal. Writing to this property changes the changes
the font weight.
The default value of this property is False.
FontItalic
Reading from this property indicates the font style. A value of True means that the
component font is italic, False means normal. Writing to this property changes the changes
the font style.
The default value of this property is False.
FontSize
Reading from this property returns the font height in points. Writing to this property
changes the changes the font height.
The default value of this property is 14 points.
124
FontTypeface
Reading from this property returns the font typeface. The value must be one of
Component.TYPEFACE_DEFAULT, Component.TYPEFACE_SERIF,
Component.TYPEFACE_SANSSERIF or Component.TYPEFACE_MONOSPACE. Writing to this
property changes the changes the font typeface.
The default value of this property is Component.TYPEFACE_DEFAULT.
Justification
Reading from this property returns the text justification. The value must be one of
Component.JUSTIFY_LEFT, Component.JUSTIFY_CENTER or Component.JUSTIFY_RIGHT.
Writing to this property changes the changes the text justification.
The default value of this property is Component.JUSTIFY_LEFT.
Text
Reading from this property returns the text displayed by the component. Writing to this
property changes the changes the text displayed.
TextColor
Reading from the TextColor property returns the current color of the text displayed by this
component. The color value is encoded as &Haarrggbb where aa represents the alpha value
(&H00 - transparent to &HFF - opaque), rr represents the red, gg the green and bb the blue
component of the color. Writing to the TextColor property will set the color for the text of
125
the component.
There are a number of predefined color constants: Component.COLOR_NONE,
Component.COLOR_BLACK, Component.COLOR_BLUE, Component.COLOR_CYAN,
Component.COLOR_DKGRAY, Component.COLOR_GRAY, Component.COLOR_GREEN,
Component.COLOR_LTGRAY, Component.COLOR_MAGENTA, Component.COLOR_RED,
Component.COLOR_WHITE and Component.COLOR_YELLOW.
Enabled
Reading from the Enabled property indicates whether the textbox is enabled. Writing to the
Enabled property will enabled or disable the textbox.
Textboxes are enabled by default.
Hint
Reading from the Hint property returns the text of the hint that will be shown for the
textbox. Writing to the Hint property will change the hint being shown for the textbox.
126
namespace com.google.devtools.simple.runtime.components
Timer
Events
Properties
Initialize
Event Initialize()
Timer
Event Timer()
Event raised upon Timer expiration. After completing an event handler for this event, the
timer will be reset to the current interval value and restarted (unless it was disabled).
Enabled
Reading from the Enabled property indicates whether the timer is running and will be
restarted after interval expiration. Writing to the Enabled property will turn timer on or off.
127
The timer is enabled by default.
Interval
Reading from the Interval property returns the number of milliseconds between timer
events. Writing to the Interval property will changed the length of the interval between
timer events. If the timer is enabled and the interval is being changed then the current
timer run is aborted and the timer is immediately restarted with the new interval.
The default interval is 1000 ms.
128
namespace com.google.devtools.simple.runtime.components
FrameLayout
Layout for prominently showing a single component. If there are multiple components in the
container then only the component last added will be shown.
129
namespace com.google.devtools.simple.runtime.components
LinearLayout
Properties
Orientation
This property sets the orientation of the linear layout. The assigned value must be either
Component.LAYOUT_ORIENTATION_HORIZONTAL or
Component.LAYOUT_ORIENTATION_VERTICAL. This property is write-only.
130
namespace com.google.devtools.simple.runtime.components
TableLayout
Properties
Columns
This property sets the number of columns used by the layout. The assigned value must be
greater than zero. This property is write-only.
Rows
This property sets the number of rows used by the layout. The assigned value must be
greater than zero. This property is write-only.
131