Return Types
[SolutionHelper]
{column:width=80px|padding=0px}{column}{column}{column}
Property Summary
[SolutionHelper]
solutionHelper
Mobile helper is used as a complementary tool to solution model.
{column:width=80px|padding=0px}{column}{column}{column}
Method Summary
void
call(telNumber)
Initiate a phone call
void
email(emailAddress)
Initiate an email sending
void
getCurrentPosition(successCallback, errorHandler, options)
Wrapper function around HTML5 getCurrentPosition.
getUsedStorageSpace()
Retrieves amount of used bytes from browser local storage.
void
syncData()
Synchronizes data between Mobile Client and Servoy Application Server.
{column:width=100%|padding=0px}{column}
Property Details
Mobile helper is used as a complementary tool to solution model.
Components/solution structure in mobile client needs special tags which are not supported by solution model API,
but this mobile helper can be used to apply them. For example a button can be the right header button or the left header button and so on.
Since
Replace with version info
Parameters
Returns
[SolutionHelper]
Also see
External links
Sample
var f = solutionModel.newForm("created_by_sm_1","udm","contacts",null,false,100,380); var backMethod; var b = f.newButton("back",0,0,10,10,backMethod = f.newMethod("function goBack() { history.back(); }")); plugins.mobile.solutionHelper.markLeftHeaderButton(b); plugins.mobile.solutionHelper.setIconType(b,plugins.mobile.SolutionHelper.ICON_BACK); b = f.newButton("doSomething",0,0,10,10,f.newMethod("function goForward() { globals.doSomething(); }")); plugins.mobile.solutionHelper.markRightHeaderButton(b); plugins.mobile.solutionHelper.setIconType(b,plugins.mobile.SolutionHelper.ICON_FORWARD); var lbl = f.newLabel("Generated form",0,0,10,10); plugins.mobile.solutionHelper.markHeaderText(lbl); b = f.newButton("ok",0,0,10,10,backMethod); plugins.mobile.solutionHelper.setIconType(b,plugins.mobile.SolutionHelper.ICON_CHECK); plugins.mobile.solutionHelper.markFooterItem(b);
{column:width=100%|padding=0px}{column}
Method Details
void
call
(telNumber)
Initiate a phone call
Since
Replace with version info
Parameters
{String} telNumber – telephone number to call
Returns
void
Also see
External links
Sample
plugins.mobile.call("+490111111")
void
(emailAddress)
Initiate an email sending
Since
Replace with version info
Parameters
{String} emailAddress – destination email address
Returns
void
Also see
External links
Sample
plugins.mobile.email("[email protected]")
void
getCurrentPosition
(successCallback, errorHandler, options)
Wrapper function around HTML5 getCurrentPosition. Method will call successCallback method with a Position object parameter if GPS position was retrieved. Otherwise will call errorHandler with an error parameter. This method has dummy implementation in developer.
NOTE: For options you can specify (a) Accuracy of the returned location information (b) Timeout for retrieving the location information and (c) Use of cached location information
Since
Replace with version info
Parameters
{Function} successCallback – Method to be called if the coordinates are retrieved.
{Function} errorHandler – Method to be called if an error occurs while retrieving GPS coordinates. Can be null.
{Object} options – JSON string with different options that are supported by HTML5 function (accuracy, timeout, caching).
Returns
void
Also see
External links
Sample
plugins.mobile.getCurrentPosition(forms.myform.showLocation,scopes.globals.errorHandler,{timeout:5000});
getUsedStorageSpace
()
Retrieves amount of used bytes from browser local storage. The storage amount depends on used browser, but, from specification, the browser should allow at least 5MB of local storage. Note: Some browsers take two bytes per character.
Since
Replace with version info
Parameters
Also see
External links
Sample
var usedSpace = plugins.mobile.getUsedStorageSpace()
isOnline
()
Returns whether mobile device is online. Returns true in developer implementation.
Since
Replace with version info
Parameters
Also see
External links
Sample
plugins.mobile.isOnline()
void
syncData
()
Synchronizes data between Mobile Client and Servoy Application Server.
Since
Replace with version info
Parameters
Returns
void
Also see
External links
Sample
plugins.mobile.syncData()