From wiki.ginstr.com
Jump to: navigation, search

Gps coordinates Input

Widget obtains gps coordinates from gps module. After location is retrieved it's stored into widget as "latitude, longitude" pair. User can also modify the value of input field.

Widget id, ${gbamID}:

locationGPS

Back to GBAM widgets table

Datatypes

Value is stored from widget to database as GPS datatype

Predefined user data

PreLoaded

Properties panel

User will configure this data in properties panels of selected widget:

GENERAL
VALIDATIONS
    <columnGps required="true|false"></columnGps>
  • "gps data format", TextValidator#REGEX set to match pattern ^\d+,\d+ not changeable by user, only error message.
ACTION
  • -
ACTION MESSAGES
  • -
DATABASE
  • "is part of database", checkbox option by default is set as checked. When checked database column is created for this widget.

Code snippets

GBAM Code Variables

Variables which are used in code snippet below but not defined in user modifiable inputs.

Common widget code

<com.ginstr.widgets.GnTextView
    android:id="@+id/${widgetID}_label"
    android:layout_width="match_parent"
    android:layout_height="wrap_content"
    android:text="@string/${widgetID}"
    gn:style="@style/locationGPS_label"/>

<com.ginstr.widgets.GnEditText
    android:id="@+id/${widgetID}_input" 
    android:layout_width="match_parent" 
    android:layout_height="wrap_content"
    gn:s_sourceType="gps"
    gn:s_hint="@string/${widgetID}Hint"
    gn:dataType="GPS"
    gn:style="@style/locationGPS_input"/>

strings.xml

Lines to be added for each language.

<string name="${widgetID}">${widgetLabel}</string>
<string name="${widgetID}Hint">${widgetHint}</string>