Zebra Link-OS Print Touch enables effortless device pairing and app launching by leveraging Near Field Communication. With Print Touch, you can pair Link-OS and NFC enabled devices to get you up and printing quickly.

Simplify the use of devices with Print Touch by creating apps that launch at a touch to ensure users get quick access to the data they need.

NFC OVERVIEW

Near Field Communication (NFC) is a set of short-range wireless technologies, typically requiring a distance of 4cm or less to initiate a connection. NFC allows you to share small payloads of data between an NFC tag and an Android-powered device, or between two Android-powered devices. The technology allows transferring of small amounts of data between two devices in close proximity.

 

NFC is an extension of RFID. While RFID waves can have very long ranges, NFC was set to a limited range of communication. Due to the short range, it is ideal to apply NFC in secure applications like payment. NFC has another advantage as it allows two-way communication, while RFID is a one-way reading technology.

 

This same technology can be found on our latest Zebra products. We have included an NFC tag with printer information that allows users to simply bump their Android and iOS devices to those printers to create a connection and print out their labels from the application. NFC Data Exchange in the format of “NDEF Records”, the standard method to store data in NFC tag is as follows:

 

The NFC tag embedded in the Zebra Printers contains printer information stored as NDEF record in the following format :

http://www.zebra.com/apps/r/nfc?mB=aabbccddeeff&mW=000000000000&mE=aabbccddeeff&c=123456789012345&s=12345678901234&v=0

 

HOW NFC TAGS ARE DISPATCHED TO APPLICATIONS

1. Before you can access a device’s NFC hardware and properly handle NFC intents, declare these items in your AndroidManifest.xml file

  • The NFC <uses-persmission> element to access the NFC hardware :
  • <uses-permission android:name="android.permission.NFC" />

2. To start your application when an NFC tag is scanned, your application can filter the NFC intents in the Android manifest.

<activity android:name=".MyActivity">
  <intent-filter>
    <action android:name="android.nfc.action.NDEF_DISCOVERED" />
    <category android:name="android.intent.category.DEFAULT" />
    <data android:scheme="http" android:host="zebra.com"
      android:path="/apps/r/nfc" />
    <data android:scheme="http" android:host="www.zebra.com"
      android:path="/apps/r/nfc" />
  </intent-filter>
</activity>

3. The example below will obtain the printer information from the NFC tag and try to established a connection with the printer (using Link-OS SDK for Android).

Parcelable[] scannedTags = intent.getParcelableArrayExtra(NfcAdapter.EXTRA_NDEF_MESSAGES);
  if (scannedTags != null && scannedTags.length > 0) {
    NdefMessage msg = (NdefMessage) scannedTags[0];
    final String payload = new String(msg.getRecords()[0].getPayload());
    new AsyncTask<Void, Void, Void>() {
      protected Void doInBackground(Void... params) {
        try {
            UrlPrinterDiscoverer.findPrinters(payload, new DiscoveryHandler() {
              public void foundPrinter(DiscoveredPrinter printer) {
                try {
                  Connection conn = printer.getConnection();
                  conn.open();
                  ZebraPrinterFactory.getInstance(conn).printConfigurationLabel();
                  conn.close();
                } catch (Exception e) { e.printStackTrace(); }
            }});
        } catch (DiscoveryException e) {
            e.printStackTrace();
        }
        return null;
      }
    }.execute((Void) null);
    intent.removeExtra(NfcAdapter.EXTRA_NDEF_MESSAGES);
  }
}

 

PRINT TOUCH WEB PAGE

We’ve covered how a developer can incorporate Print Touch to trigger their apps to establish a connection with a Link-OS printer when a user touches their NFC device with the printer. But if there is no app utilizing Print Touch on the user’s NFC device, the user will still be able to benefit from Print Touch.

 

The printer will pass its unique URL into the NFC device allowing it to display the printer’s own webpage. The webpage will feature links to useful information such as printer registration, product support, knowledge base articles, and various how-to videos. With these capabilities, Print Touch is a powerful Link-OS feature that will enhance the user’s experience.

MORE ABOUT NFC

Near Field Communications World maintains a list of mobile phones with NFC

NFC Tag in Zebra printer has a Virtual Tag Lock. So, you can re-encode the tag for your custom applications

 

Robin West

Solution Architect

Zebra ISV