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

GnNfcEmulator

Widget XML tag
<com.ginstr.widgets.GnNfcEmulator>
Description
GnNfcEmulator is used to simulate NFC scans and consists of two text input fields and a button.
In the first text field, user should enter nfcId. In the second text field, user should enter NFC content. By pressing the button, a NFC-like event will be dispatched within the application.

XML Attributes Description

Attribute Description
gn:s_customLayoutXml Points to an XML file in “control” folder of ginstr app

Can be

  • hardcoded - i.e. = someXmlLayoutName.xml

Events

gn:act_setClick
gn:act_setLongClick

Example

<com.ginstr.widgets.GnNfcEmulator
  android:id="@+id/myEmulator"
  android:layout_width="wrap_content"
  android:layout_height="wrap_content" />

Enabling emulation widgets

To enable loading of emulation widgets on development, integration and staging server, open ginstr launcher Preferences screen and tick checkbox "emulation widgets" and then relaunch the application.
On production apk of ginstr launcher, loading of emulation widgets requires "common.xml" to be saved within "settings" folder, containing the following entry:
  <string name="emulatorWidgetsEnable">true</string>

Alternative layout

Alternative layout can be set into control folder. It must have valid XML structure.
Widget Name Description
EditText @+id/etNfcId this text field represents NFC tag id
EditText @+id/etNfcContent this text field represents NFC tag additional content
Button @+id/btnNfcDispatch this button is used to dispatch NFC data