Java Reference
In-Depth Information
These packages rely on the presence of CLDC 1.1 or greater on the device, or equiva-
lent support from another Java configuration.
Contactless communication devices come in a variety of flavors, but all are based
on some wireless protocol typically built around RFID tags. The Contactless Communica-
tion API presently supports the following kinds of contactless devices:
NDEF-compliant devices : Communication occurs through the exchange of
NDEFMessage objects that possess individual NDEFRecord objects.
ISO 144443-compliant devices : Communication occurs through a Connection
subclass that permits the exchange of APDUs represented as arrays of bytes.
Generic RFID tags : Communication with these devices occurs through a Connection
subclass that lets you exchange vectors of commands.
Not every implementation of the Contactless Communications API supports all of
these options.
When using the Contactless Communication API, your application typically performs
one or more of the following operations:
Register for notifications when a contactless target becomes available : You can do
this using the MIDP push registry (see Chapter 14 for how to use the MIDP push
registry) or the javax.microedition.contactless.DiscoveryManager class provided
by the API.
Communicate with a contactless communications device using the appropriate
Connection subclass provided by the Contactless Connection API : You can do this
when the device comes into range—reported either as an MIDP push or an event
from the DiscoveryManager .
Capture the image using MMAPI, if you require visual tag recognition : For details
about how to do this, see Chapter 16. You pass the image you capture to a
VisualTagConnection instance for recognition.
Create a stream of bytes to be encoded as a bar code and pass the bytes to a
VisualTagConnection to generate an image, if you require visual tag generation :
Once the image is generated, present it to the user.
Discovering Contactless Targets
Contactless communication poses a challenge, in that your application doesn't know
when it will encounter a target with which it can communicate. Your application may
need to always be listening for a target (applications that confirm payments at point of
 
Search WWH ::




Custom Search