net.rim.device.api.io.nfc.readerwriter
Class Target

java.lang.Object
  extended by net.rim.device.api.io.nfc.readerwriter.Target

public class Target
extends Object

Represents a card or tag that the NFC controller detected. Also identifies the protocol that is used to connect to the card or tag. The NFC controller can read targets using the following protocols:

Since:
BlackBerry API 7.0.0

Field Summary
static int ISO_14443_3
          Represents ISO 14443 A-3, B-3.
static int ISO_14443_4
          Represents ISO 14443 A-4, B-4.
static int NDEF_TAG
          Represents NFC tag types 1, 2, 3, 4.
 
Method Summary
 Enumeration getProperties()
          Returns an Enumeration containing all the available properties for this target.
 String getProperty(String propertyName)
          Returns the property value for the property name specified.
 int[] getTypes()
          Returns the array of types for this target.
 String getUri(int connectionType)
          Returns a URI that can be used to establish a connection with the tag.
 boolean isTargetHandled()
          Returns the flag whether the target has been handled by application.
 boolean isType(int type)
          Indicates whether this target is the type specified.
 void setTargetHandled(boolean handled)
          Set a flag to indicate whether the target has been handled by the application.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 



Field Detail

ISO_14443_4

public static final int ISO_14443_4
Represents ISO 14443 A-4, B-4.

See Also:
Constant Field Values
Since:
BlackBerry API 7.0.0

ISO_14443_3

public static final int ISO_14443_3
Represents ISO 14443 A-3, B-3.

See Also:
Constant Field Values
Since:
BlackBerry API 7.0.0

NDEF_TAG

public static final int NDEF_TAG
Represents NFC tag types 1, 2, 3, 4.

See Also:
Constant Field Values
Since:
BlackBerry API 7.0.0


Method Detail

getUri

public String getUri(int connectionType)
Returns a URI that can be used to establish a connection with the tag. See Connector.open() for more information about opening connections.

Parameters:
connectionType - Target.ISO_14443_3, Target.ISO_14443_4, or Target.NDEF_TAG
Returns:
The URI to open a connection to a target.
Since:
BlackBerry API 7.0.0

getProperty

public String getProperty(String propertyName)
Returns the property value for the property name specified.

Parameters:
The - name of a property.
   Supported properties:
       "Name" name of a NFC target. Possible values: 
           "Desfire D40" 
           "Desfire EV1 2K" 
           "Desfire EV1 4K" 
           "Desfire EV1 8K" 
           "Jewel" 
           "Mifare UL" 
           "Mifare UL C" 
           "Topaz" 
           "Topaz 512" 
           "Unknown"
        "ISO_14443_3_TYPE" either "A" or "B"
        "ISO_14443_4_TYPE" either "A" or "B"
        "FreeSpaceSize" in bytes
        "IsLockable" either "TRUE" or "FALSE"
        "IsLocked" either "TRUE" or "FALSE"
        "SerialNumberLength" in bytes
        "SerialNumber"
        "TagType" either "1", "2", "3" or "4"
        "IsNDEFCapable" either "TRUE" or "FALSE"
        "RawTagSize" in bytes
        
   Only "Name" property is always present the other properties depend on the target.
 
Returns:
The content of the property.
Since:
BlackBerry API 7.0.0

getProperties

public Enumeration getProperties()
Returns an Enumeration containing all the available properties for this target. See getProperty(String) for a list of supported properties.

Returns:
Enumeration containing all properties available for this target, or null if none are available
Since:
BlackBerry API 7.0.0

isType

public boolean isType(int type)
Indicates whether this target is the type specified.

Parameters:
type - Target.ISO_14443_3, Target.ISO_14443_4 or Target.NDEF_TAG
Returns:
true if the target is the type specified; false otherwise.
Since:
BlackBerry API 7.0.0

getTypes

public int[] getTypes()
Returns the array of types for this target. The type determines connection options available for this target. Pass one entry from the array returned as a parameter to getUri to obtain the URI used to connect to the tag.

Returns:
The type of target: Target.ISO_14443_3, Target.ISO_14443_4, Target.NDEF_TAG
Since:
BlackBerry API 7.0.0

setTargetHandled

public void setTargetHandled(boolean handled)
Set a flag to indicate whether the target has been handled by the application. If the flag is set to false, extra handling might be applied to the target. The default value is true.

Parameters:
A - boolean value indicating whether this target has been processed by an application.
Since:
BlackBerry API 7.1.0

isTargetHandled

public boolean isTargetHandled()
Returns the flag whether the target has been handled by application. This method is internal.

Returns:
true if the target has been handled by the application, false otherwise.
Since:
BlackBerry API 7.1.0





Copyright 1999-2011 Research In Motion Limited. 295 Phillip Street, Waterloo, Ontario, Canada, N2L 3W8. All Rights Reserved.
Java is a trademark of Oracle America Inc. in the US and other countries.
Legal