Start GPS

Navigation:  Knowledge Base > Page Editor > Actions > GPS Control >

Start GPS

Previous pageReturn to chapter overviewNext page

This action will start the GPS service which means that the application will start receiving the data from the Device GPS. This action is only applicable for Android, iOS and Windows runtimes. To use this action, Device GPS must be "on". To know more about the action please follow the steps given below:

 

Step 1: Open a Free Layout Page.

a.Drag and drop a RoundButton UI Part on the Page.

b.Browse to the "Functions" section on "Properties Palette window" of RoundButton for applying actions.

c.Click on the corresponding Edit(0) button of the Function on which user wants to apply the Action. To know more about the Functions click here.

 

mobilous_appexe_npe_myproject_Actions_gpscontrol_page mobilous_appexe_npe_myproject_Actions_roundbutton_edit

 

Step 2: Click on "Add" button on the Actions window to add an action.To know more about actions click here.

 

mobilous_appexe_npe_myproject_Actions

 

Step 3: Select the Actions Category as “GPS Control”.

 

mobilous_appexe_npe_myproject_Actions_category1

 

Step 4: Click on the "GPS Control" and then click on “Start GPS” action.

 

mobilous_appexe_npe_myproject_Actions_gpscontrol_startgps_setactions

Click here to know about "Doc" Button.

 

Step 5: Enter Action parameters:-

 

Parameter

Description

Accuracy

Select the Accuracy Parameter from the list. Options available are Best, 10m, 100m, 1km or 3km.

GPS variables can be updated on the basis of Accuracy Parameter i.e If user selects 1km then the variables get updated after 1km.

 

Note: GPS variables are Longitude, Latitude, Altitude etc.

 

 

mobilous_appexe_npe_myproject_Actions_gpscontrol_startgps_setparameters

 

 

 

Step 6: Click on "OK" button if the user doesn't want to add more actions.

 

mobilous_appexe_npe_myproject_Actions_gpscontrol_startgps_apply

 

Note: Define condition if required, by clicking on "+" Condition Button on the left. Click here to know more.

 

Note:

1. The device GPS must be on.

2. User should apply events on the GPS action to check the successful execution by clicking on the "+" Action Event Button on the right.

 

Events Definition:

1. Success: The actions associated with the Success event will trigger only if the Start GPS action is started successfully.

2. Error: The actions associated with the Error event will trigger only if there is an error or any issue in Start GPS action.

3. Not Available: The actions associated with this event will trigger only for those devices which does not support GPS feature.

4. Change Location: The actions associated with this event will trigger every time the device's location is changed.

 

 

 

Users can use variables to fetch values like latitude, longitude etc:-

 

Step 1: Drag and drop  TextFields on "Page1". Set Display Text as GPS variables as shown below. Click on "Before View Page" Edit(0) button to apply action.

 

mobilous_appexe_npe_myproject_Actions_gpscontrol_findlatitude_page mobilous_appexe_npe_myproject_Actions_gpscontrol_startgps_property

 

Step 2: Apply "Start GPS" Action as shown below. Click on Apply.

 

mobilous_appexe_npe_myproject_Actions_gpscontrol_findlatitude_successaction

 

Step 3: Preview the application. Following output is shown.

 

mobilous_appexe_npe_myproject_Actions_gpscontrol_startgps_output

 

 

 

GPS Variables

S. No.

Variable Name

Value

 

1

_LAT_

Latitude

Latitude is a geographic coordinate that specifies the north-south position of a point on the Earth's surface.

2

_LONG_

Longitude

Longitude is a geographic coordinate that specifies the east-west position of a point on the Earth's surface.

3

_ALT_

Altitude

Altitude is a measurement of distant, usually in the vertical or "up" direction.

4

_GPSDATE_

GPS Date/Time

GPS is a satellite navigation system used to determine ground position and velocity (Date/Time and Address). 

5

_ADDRESS_

GPS Address,Readable

6

__COURSE__

current headings


7

__MAPZOOM__

current map zoom level


 

Note:

1) Device's GPS must be turned on for all the above parameters.  

2) The System variables defined above :

  1. Should be Case sensitive

  2. Read Only

  3. Variable name format is written between 2 underscores no spaces, XXXX

3) If GPS ON , if user applies "Open target scope", the MapView pan and scaling is under control of end user and the values are displayed accordingly.

 

 

For Map Control user need to Add Google Map API

 

Map Variables

If Start GPS Action is applied using Map Control without adding Google Map API , then Error is triggered. User can display this Error using the Map Variables.

 

1. User can apply "Alert" action on "Error" event of Start GPS Action.

2. Enter "__ERR_CODE__" in the Alert Title parameter.

3. Enter "__ERR__MSG__" in the Alert Message parameter.

 

Map Variables

S. No.

Variable Name

Description

1

_ERR_CODE_

ERROR CODE is the Name of the

Error which is triggered during Map Action.

2

_ERR_MSG_

ERR_MSG is the Error Message of the Error which is triggered during Map Action.

 

Note: GPS Variables if applied, using Map Control without adding Google Map API , then Error is triggered.

 

If Google Maps API key  is NULL or INVALID

1)In Preview (If key=NULL)

If User continued with out specifying the API key and previewed the app then a default alert for key will  popup.

2) In Android and iOS (If Key=NULL)

In case of Android and iOS if the key is blank then "On alert" of Map actions will be triggered.

3) In MW, Android and iOS (If Key= Invalid)

In case Key is invalid or expired then all RTs will trigger "On Alert" event and the particular error message returned by the API will be stored in "__ERR_MSG__" Global variable

 

4) Preview/ MW cannot read API generated messages in case of API key NULL or expired. So "__ERR_MSG__" implementation is technical limitation.

 

5) The platforms behave differently as stated above when global error message (ERR_CODE) is used