static
Class Device
Interface to device specific functionalities. To initialize the properties
you should first call Device.start(callback), where
"callback" is the function that will be called after the initialization
has finished.
Properties
Are we on a supported device?
id
- String
The Unique ID of the device if available.
Default Value: ""
True if running on an iPhone OS device.
Default Value: false
Name of the current device.
On iPhone OS these values can be: "iPhone", "iPhone Simulator"
or "iPod touch".
XXX Should be "false" by default.
Default Value: false
os
- private String
The name of the devices operation system (OS). For now this can only
be "iPhone OS".
Methods
void
alert
(
message
)
Opens a system alert if it is not suported by the UIWebView (iPhone OS 2.0)
- Parameters:
-
message
<String>
- Returns:
void
Deprecated Use Device.msgbox() now to avoid confusion
private
Boolean
exec
(
command
,
value
)
Send a command to the device. If the command has been accepted true is
returned from this method. You should not use this method directly,
wrappers functions exist for each functionality available.
- Parameters:
-
command
<String>
-
value
<Object>
- Returns:
Boolean
private
void
execStack
(
command
)
Send command to Big Five and make sure that there is not other command
that is executed in the same moment.
- Parameters:
-
command
<String>
- Returns:
void
void
exit
(
)
If launched in a wrapper like the Big Five App from the Apple App Store
you can leave the current view and return to the outer view (like
the "bookmark list") calling this command.
void
getNetworkStatus
(
onsuccess
)
Return an object with network status informations
- Parameters:
-
onsuccess
<Object>
- Returns:
void
private
void
init
(
)
Sets the properties of this class that are send form the device
via "window.bigfive". Due to a bug in iPhone OS this should not
be called directly. Use Device.start() instead.
void
msgbox
(
message
)
Opens a non blocking system alert popup
- Parameters:
-
message
<String>
- Returns:
void
void
safari
(
url
)
Opens the URL in Safari. Be aware that this closes the
current application you are running in!
- Parameters:
-
url
<String>
- Returns:
void
private
void
setBool
(
name
,
value
)
Send a boolean property to device. Don't use this directly because
wrapper functions are available for all properties supported.
- Parameters:
-
name
<String>
-
value
<Boolean>
- Returns:
void
void
setNavigationBar
(
value
)
Show navigation bar of Big Five browser application
- Parameters:
-
value
<Boolean>
- Returns:
void
void
setRotation
(
value
)
Enable rotation of the view
- Parameters:
-
value
<Boolean>
- Returns:
void
void
setScale
(
value
)
Enable scaling of page elements by double tapping and zooming gestures.
- Parameters:
-
value
<Boolean>
- Returns:
void
void
setStatusBar
(
value
)
Show status bar
- Parameters:
-
value
<Boolean>
- Returns:
void
private
void
setStr
(
name
,
value
)
Send a string property to the device. Don't use this directly because
wrapper functions are available for all properties supported.
- Parameters:
-
name
<String>
-
value
<String>
- Returns:
void
void
start
(
successCallback
)
Sets the properties of Device class. Call this before you access the
properties of this class. If you provided a "callback" function this
will be called after the properties are set.
- Parameters:
-
successCallback
<Object>
Function to be called when initialization has finished.
- Returns:
void
void
vibrate
(
)
Start the vibration alarm. This is only supported by iPhones (not iPod touch).