Big5 API Documentation

device  1.1.0

Big5 API Documentation > device > Device
Search:
 
Filters

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

available - private Boolean

Are we on a supported device?

id - String

The Unique ID of the device if available.
Default Value: ""

isIPhone - Boolean

True if running on an iPhone OS device.
Default Value: false

model - String

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".

version - String

Default Value: "1.0.0"

Methods

alert

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

exec

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

execStack

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

exit

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.
Returns: void

getNetworkStatus

void getNetworkStatus ( onsuccess )
Return an object with network status informations
Parameters:
onsuccess <Object>
Returns: void

init

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.
Returns: void

msgbox

void msgbox ( message )
Opens a non blocking system alert popup
Parameters:
message <String>
Returns: void

safari

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

setBool

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

setNavigationBar

void setNavigationBar ( value )
Show navigation bar of Big Five browser application
Parameters:
value <Boolean>
Returns: void

setRotation

void setRotation ( value )
Enable rotation of the view
Parameters:
value <Boolean>
Returns: void

setScale

void setScale ( value )
Enable scaling of page elements by double tapping and zooming gestures.
Parameters:
value <Boolean>
Returns: void

setStatusBar

void setStatusBar ( value )
Show status bar
Parameters:
value <Boolean>
Returns: void

setStr

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

start

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

vibrate

void vibrate ( )
Start the vibration alarm. This is only supported by iPhones (not iPod touch).
Returns: void


Copyright © 2009 Dirk Holtwick. All rights reserved.