Loading core/res/AndroidManifest.xml +1 −1 Original line number Original line Diff line number Diff line Loading @@ -341,7 +341,7 @@ android:description="@string/permdesc_bluetooth" android:description="@string/permdesc_bluetooth" android:label="@string/permlab_bluetooth" /> android:label="@string/permlab_bluetooth" /> <!-- Allows applications to directly communicate over NFC --> <!-- Allows applications to perform I/O operations over NFC --> <permission android:name="android.permission.NFC" <permission android:name="android.permission.NFC" android:permissionGroup="android.permission-group.NETWORK" android:permissionGroup="android.permission-group.NETWORK" android:protectionLevel="dangerous" android:protectionLevel="dangerous" Loading docs/html/guide/topics/nfc/index.jd +62 −49 Original line number Original line Diff line number Diff line Loading @@ -31,29 +31,33 @@ page.title=Near Field Communication </div> </div> </div> </div> <p>Near Field Communication (NFC) is a set of short-range wireless technologies, similar to RFID. <p>Near Field Communication (NFC) is a set of short-range wireless technologies, typically It typically requires a distance of 4 cm or less and operates at 13.56mhz and at rates ranging requiring a distance of 4cm or less. NFC operates at 13.56mhz, and at rates ranging from 106 kbit/s to 848 kbit/s. NFC communication always involves an initiator and a target. The from 106 kbit/s to 848 kbit/s. NFC communication always involves an initiator and a target. initiator actively generates an RF field that can power a passive target. This enables NFC The initiator actively generates an RF field that can power a passive target. This targets to take very simple form factors such as tags, stickers or cards that do not require enables NFC targets to take very simple form factors such as tags, stickers or cards that do power. NFC peer-to-peer communication is also possible, where both devices are powered.</p> not require power. NFC peer-to-peer communication is also possible, where both devices are powered. <p>Compared to other wireless technologies such as Bluetooth or WiFi, NFC provides much lower <p> bandwidth and range, but provides low-cost, un-powered targets and do not require discovery or Compared to other wireless technologies such as Bluetooth or WiFi, NFC provides much lower pairing. Users interact with NFC tags with just a tap. Targets can range in complexity. Simple bandwidth and range, but enables low-cost, un-powered targets tags just offer read and write capabilities, sometimes with one-time programmable areas to make and does not require discovery or pairing. Interactions can be initiated with just a tap. the card read-only. More complex tags offer math operations, and have cryptographic hardware to <p> authenticate access to a sector. The most sophisticated tags contain operating environments, An Android device with NFC hardware will typically act as an initiator when the screen is allowing complex interactions with applets that are running on the tag.</p> on. This mode is also known as NFC reader/writer. It will actively look for NFC tags and start activities to handle them. Android 2.3.3 also has some limited P2P support. <p>An Android device with NFC hardware typically acts as an initiator. This mode is also known as <p> NFC reader/writer. The device actively looks for NFC tags and starts activities to handle them in Tags can range in complexity, simple tags just offer read/write semantics, sometimes this mode. In Android 2.3.3, devices also have some limited peer-to-peer support.</p> with one-time-programmable areas to make the card read-only. More complex tags offer math operations, and have cryptographic hardware to authenticate access to a sector. The most sophisticated tags contain operating environments, allowing complex interactions with code executing on the tag. <h2 id="api">API Overview</h2> <h2 id="api">API Overview</h2> <p>The {@link android.nfc} package contain the high-level classes to interact with the local <p>The {@link android.nfc} package contains the high-level classes to interact device's NFC adapter, to represent discovered tags, and to use the NDEF data format.</p> with the local device's NFC adapter, to represent discovered tags, and to use the NDEF data format. <table> <table> <tr> <tr> Loading @@ -65,44 +69,52 @@ page.title=Near Field Communication <tr> <tr> <td>{@link android.nfc.NfcManager}</td> <td>{@link android.nfc.NfcManager}</td> <td>A high level manager class that enumerates the NFC adapters on this Android device. Since most Android devices only have one NFC adapter, you can just use the static helper {@link <td>A high level manager class that enumerates the NFC adapters on this Android device. android.nfc.NfcAdapter#getDefaultAdapter()} for most situations.</td> Since most Android devices only have one NFC adapter, you can just use the static helper {@link android.nfc.NfcAdapter#getDefaultAdapter(Context)} for most situations.</td> </tr> </tr> <tr> <tr> <td>{@link android.nfc.NfcAdapter}</td> <td>{@link android.nfc.NfcAdapter}</td> <td>Represents the local NFC adapter and defines the Intents that are used in the tag <td>Represents the local NFC adapter. Defines the intent's used to request dispatch system. It provides methods to register for foreground tag dispatching and tag dispatch to your activity, and provides methods to register for foreground foreground NDEF pushing. Foreground NDEF push is the only peer-to-peer support that is tag dispatch and foreground NDEF push. Foreground NDEF push is the only currently provided in Android.</td> peer-to-peer support that is currently provided in Android.</td> </tr> </tr> <tr> <tr> <td>{@link android.nfc.NdefMessage} and {@link android.nfc.NdefRecord}</td> <td>{@link android.nfc.NdefMessage} and {@link android.nfc.NdefRecord}</td> <td>NDEF is an NFC Forum defined data structure, designed to efficiently store data on NFC <td>NDEF is an NFC Forum defined data structure, designed to efficiently tags, such as Text, URLs, and other MIME types. An {@link android.nfc.NdefMessage} acts as a store data on NFC tags, such as text, URL's, and other MIME types. A {@link android.nfc.NdefMessage} acts as a container for the data that you want to transmit or read. One {@link android.nfc.NdefMessage} container for the data that you want to transmit or read. One {@link android.nfc.NdefMessage} object contains zero or more {@link android.nfc.NdefRecord}s. Each NDEF Record has a type object contains zero or more {@link android.nfc.NdefRecord}s. Each NDEF record such as Text, URL, Smart Poster, or any MIME type. The type of the first NDEF Record in the has a type such as text, URL, smart poster, or any MIME data. The type of the NDEF message is used to dispatch a tag to an Activity.</td> first NDEF record in the NDEF message is used to dispatch a tag to an activity on Android.</td> </tr> </tr> <tr> <tr> <td>{@link android.nfc.Tag}</td> <td>{@link android.nfc.Tag}</td> <td>Represents a passive NFC target. These can come in many form factors such as a tag, card, <td>Represents a passive NFC target. These can come in many form factors such as FOB, or an even more complex device doing card emulation. When a tag is discovered, a {@link a tag, card, key fob, or even a phone doing card emulation. When a tag is android.nfc.Tag} object is created and wrapped inside an Intent. The dispatch system sends discovered, a {@link android.nfc.Tag} object is created and wrapped inside an the Intent to a compatible Activity <code>startActivity()</code>. You can use the {@link Intent. The NFC dispatch system sends the intent to a compatible actvitiy using <code>startActivity()</code>. You can use the {@link android.nfc.Tag#getTechList getTechList()} method to determine the technologies supported by android.nfc.Tag#getTechList getTechList()} method to determine the technologies supported by this tag and create the corresponding {@link android.nfc.tech.TagTechnology} object with one this tag and create the corresponding {@link android.nfc.tech.TagTechnology} object with one of classes provided by {@link android.nfc.tech}.</td> of classes provided by {@link android.nfc.tech}.</td> </tr> </tr> </table> </table> <p>The {@link android.nfc.tech} package contains classes to query properties and perform I/O operations on a tag. The classes are divided to represent different NFC technologies that can be available on a tag. <p>The {@link android.nfc.tech} package contains classes to query properties and perform I/O <p>The {@link android.nfc.tech} package contains classes to query properties and perform I/O operations on a tag. The classes are divided to represent different NFC technologies that can be operations on a tag. The classes are divided to represent different NFC technologies that can be available on a Tag:</p> available on a Tag:</p> Loading @@ -117,7 +129,7 @@ page.title=Near Field Communication <tr> <tr> <td>{@link android.nfc.tech.TagTechnology}</td> <td>{@link android.nfc.tech.TagTechnology}</td> <td>The interface that all Tag Technology classes must implement.</td> <td>The interface that all tag technology classes must implement.</td> </tr> </tr> <tr> <tr> Loading Loading @@ -153,8 +165,8 @@ page.title=Near Field Communication <tr> <tr> <td>{@link android.nfc.tech.Ndef}</td> <td>{@link android.nfc.tech.Ndef}</td> <td>Provides access to NDEF data and operations on NFC Tags that have been formatted as <td>Provides access to NDEF data and operations on NFC tags that have been formatted as NDEF. NDEF.</td> </td> </tr> </tr> <tr> <tr> Loading @@ -166,15 +178,15 @@ page.title=Near Field Communication <tr> <tr> <td>{@link android.nfc.tech.MifareClassic}</td> <td>{@link android.nfc.tech.MifareClassic}</td> <td>Provides access to MIFARE Classic properties and I/O operations. Not all Android devices <td>Provides access to MIFARE Classic properties and I/O operations, if this provide implementations for this class.</td> Android device supports MIFARE.</td> </tr> </tr> <tr> <tr> <td>{@link android.nfc.tech.MifareUltralight}</td> <td>{@link android.nfc.tech.MifareUltralight}</td> <td>Provides access to MIFARE Ultralight properties and I/O operations. Not all Android <td>Provides access to MIFARE Ultralight properties and I/O operations, if this devices provide implementations for this class.</td> Android device supports MIFARE.</td> </tr> </tr> </table> </table> Loading @@ -191,12 +203,13 @@ page.title=Near Field Communication </li> </li> <li>The minimum SDK version that your application can support. API level 9 only supports <li>The minimum SDK version that your application can support. API level 9 only supports limited tag dispatching with {@link android.nfc.NfcAdapter#ACTION_TAG_DISCOVERED}, and only limited tag dispatch via {@link android.nfc.NfcAdapter#ACTION_TAG_DISCOVERED}, gives access to NDEF messages via the {@link android.nfc.NfcAdapter#EXTRA_NDEF_MESSAGES} extra. and only gives access to NDEF messages via the {@link android.nfc.NfcAdapter#EXTRA_NDEF_MESSAGES} No other tag properties or I/O operations are accessible. API level 10 adds comprehensive extra. No other tag properties or I/O operations are accessible. You probably want reader/writer support, so you probably want to use this for more functionality. to use API level 10 which includes comprehensive reader/writer support. <pre class="pretty-print"> <pre class="pretty-print"> <uses-sdk android:minSdkVersion="9|10"/> <uses-sdk android:minSdkVersion="10"/> </pre> </pre> </li> </li> Loading Loading
core/res/AndroidManifest.xml +1 −1 Original line number Original line Diff line number Diff line Loading @@ -341,7 +341,7 @@ android:description="@string/permdesc_bluetooth" android:description="@string/permdesc_bluetooth" android:label="@string/permlab_bluetooth" /> android:label="@string/permlab_bluetooth" /> <!-- Allows applications to directly communicate over NFC --> <!-- Allows applications to perform I/O operations over NFC --> <permission android:name="android.permission.NFC" <permission android:name="android.permission.NFC" android:permissionGroup="android.permission-group.NETWORK" android:permissionGroup="android.permission-group.NETWORK" android:protectionLevel="dangerous" android:protectionLevel="dangerous" Loading
docs/html/guide/topics/nfc/index.jd +62 −49 Original line number Original line Diff line number Diff line Loading @@ -31,29 +31,33 @@ page.title=Near Field Communication </div> </div> </div> </div> <p>Near Field Communication (NFC) is a set of short-range wireless technologies, similar to RFID. <p>Near Field Communication (NFC) is a set of short-range wireless technologies, typically It typically requires a distance of 4 cm or less and operates at 13.56mhz and at rates ranging requiring a distance of 4cm or less. NFC operates at 13.56mhz, and at rates ranging from 106 kbit/s to 848 kbit/s. NFC communication always involves an initiator and a target. The from 106 kbit/s to 848 kbit/s. NFC communication always involves an initiator and a target. initiator actively generates an RF field that can power a passive target. This enables NFC The initiator actively generates an RF field that can power a passive target. This targets to take very simple form factors such as tags, stickers or cards that do not require enables NFC targets to take very simple form factors such as tags, stickers or cards that do power. NFC peer-to-peer communication is also possible, where both devices are powered.</p> not require power. NFC peer-to-peer communication is also possible, where both devices are powered. <p>Compared to other wireless technologies such as Bluetooth or WiFi, NFC provides much lower <p> bandwidth and range, but provides low-cost, un-powered targets and do not require discovery or Compared to other wireless technologies such as Bluetooth or WiFi, NFC provides much lower pairing. Users interact with NFC tags with just a tap. Targets can range in complexity. Simple bandwidth and range, but enables low-cost, un-powered targets tags just offer read and write capabilities, sometimes with one-time programmable areas to make and does not require discovery or pairing. Interactions can be initiated with just a tap. the card read-only. More complex tags offer math operations, and have cryptographic hardware to <p> authenticate access to a sector. The most sophisticated tags contain operating environments, An Android device with NFC hardware will typically act as an initiator when the screen is allowing complex interactions with applets that are running on the tag.</p> on. This mode is also known as NFC reader/writer. It will actively look for NFC tags and start activities to handle them. Android 2.3.3 also has some limited P2P support. <p>An Android device with NFC hardware typically acts as an initiator. This mode is also known as <p> NFC reader/writer. The device actively looks for NFC tags and starts activities to handle them in Tags can range in complexity, simple tags just offer read/write semantics, sometimes this mode. In Android 2.3.3, devices also have some limited peer-to-peer support.</p> with one-time-programmable areas to make the card read-only. More complex tags offer math operations, and have cryptographic hardware to authenticate access to a sector. The most sophisticated tags contain operating environments, allowing complex interactions with code executing on the tag. <h2 id="api">API Overview</h2> <h2 id="api">API Overview</h2> <p>The {@link android.nfc} package contain the high-level classes to interact with the local <p>The {@link android.nfc} package contains the high-level classes to interact device's NFC adapter, to represent discovered tags, and to use the NDEF data format.</p> with the local device's NFC adapter, to represent discovered tags, and to use the NDEF data format. <table> <table> <tr> <tr> Loading @@ -65,44 +69,52 @@ page.title=Near Field Communication <tr> <tr> <td>{@link android.nfc.NfcManager}</td> <td>{@link android.nfc.NfcManager}</td> <td>A high level manager class that enumerates the NFC adapters on this Android device. Since most Android devices only have one NFC adapter, you can just use the static helper {@link <td>A high level manager class that enumerates the NFC adapters on this Android device. android.nfc.NfcAdapter#getDefaultAdapter()} for most situations.</td> Since most Android devices only have one NFC adapter, you can just use the static helper {@link android.nfc.NfcAdapter#getDefaultAdapter(Context)} for most situations.</td> </tr> </tr> <tr> <tr> <td>{@link android.nfc.NfcAdapter}</td> <td>{@link android.nfc.NfcAdapter}</td> <td>Represents the local NFC adapter and defines the Intents that are used in the tag <td>Represents the local NFC adapter. Defines the intent's used to request dispatch system. It provides methods to register for foreground tag dispatching and tag dispatch to your activity, and provides methods to register for foreground foreground NDEF pushing. Foreground NDEF push is the only peer-to-peer support that is tag dispatch and foreground NDEF push. Foreground NDEF push is the only currently provided in Android.</td> peer-to-peer support that is currently provided in Android.</td> </tr> </tr> <tr> <tr> <td>{@link android.nfc.NdefMessage} and {@link android.nfc.NdefRecord}</td> <td>{@link android.nfc.NdefMessage} and {@link android.nfc.NdefRecord}</td> <td>NDEF is an NFC Forum defined data structure, designed to efficiently store data on NFC <td>NDEF is an NFC Forum defined data structure, designed to efficiently tags, such as Text, URLs, and other MIME types. An {@link android.nfc.NdefMessage} acts as a store data on NFC tags, such as text, URL's, and other MIME types. A {@link android.nfc.NdefMessage} acts as a container for the data that you want to transmit or read. One {@link android.nfc.NdefMessage} container for the data that you want to transmit or read. One {@link android.nfc.NdefMessage} object contains zero or more {@link android.nfc.NdefRecord}s. Each NDEF Record has a type object contains zero or more {@link android.nfc.NdefRecord}s. Each NDEF record such as Text, URL, Smart Poster, or any MIME type. The type of the first NDEF Record in the has a type such as text, URL, smart poster, or any MIME data. The type of the NDEF message is used to dispatch a tag to an Activity.</td> first NDEF record in the NDEF message is used to dispatch a tag to an activity on Android.</td> </tr> </tr> <tr> <tr> <td>{@link android.nfc.Tag}</td> <td>{@link android.nfc.Tag}</td> <td>Represents a passive NFC target. These can come in many form factors such as a tag, card, <td>Represents a passive NFC target. These can come in many form factors such as FOB, or an even more complex device doing card emulation. When a tag is discovered, a {@link a tag, card, key fob, or even a phone doing card emulation. When a tag is android.nfc.Tag} object is created and wrapped inside an Intent. The dispatch system sends discovered, a {@link android.nfc.Tag} object is created and wrapped inside an the Intent to a compatible Activity <code>startActivity()</code>. You can use the {@link Intent. The NFC dispatch system sends the intent to a compatible actvitiy using <code>startActivity()</code>. You can use the {@link android.nfc.Tag#getTechList getTechList()} method to determine the technologies supported by android.nfc.Tag#getTechList getTechList()} method to determine the technologies supported by this tag and create the corresponding {@link android.nfc.tech.TagTechnology} object with one this tag and create the corresponding {@link android.nfc.tech.TagTechnology} object with one of classes provided by {@link android.nfc.tech}.</td> of classes provided by {@link android.nfc.tech}.</td> </tr> </tr> </table> </table> <p>The {@link android.nfc.tech} package contains classes to query properties and perform I/O operations on a tag. The classes are divided to represent different NFC technologies that can be available on a tag. <p>The {@link android.nfc.tech} package contains classes to query properties and perform I/O <p>The {@link android.nfc.tech} package contains classes to query properties and perform I/O operations on a tag. The classes are divided to represent different NFC technologies that can be operations on a tag. The classes are divided to represent different NFC technologies that can be available on a Tag:</p> available on a Tag:</p> Loading @@ -117,7 +129,7 @@ page.title=Near Field Communication <tr> <tr> <td>{@link android.nfc.tech.TagTechnology}</td> <td>{@link android.nfc.tech.TagTechnology}</td> <td>The interface that all Tag Technology classes must implement.</td> <td>The interface that all tag technology classes must implement.</td> </tr> </tr> <tr> <tr> Loading Loading @@ -153,8 +165,8 @@ page.title=Near Field Communication <tr> <tr> <td>{@link android.nfc.tech.Ndef}</td> <td>{@link android.nfc.tech.Ndef}</td> <td>Provides access to NDEF data and operations on NFC Tags that have been formatted as <td>Provides access to NDEF data and operations on NFC tags that have been formatted as NDEF. NDEF.</td> </td> </tr> </tr> <tr> <tr> Loading @@ -166,15 +178,15 @@ page.title=Near Field Communication <tr> <tr> <td>{@link android.nfc.tech.MifareClassic}</td> <td>{@link android.nfc.tech.MifareClassic}</td> <td>Provides access to MIFARE Classic properties and I/O operations. Not all Android devices <td>Provides access to MIFARE Classic properties and I/O operations, if this provide implementations for this class.</td> Android device supports MIFARE.</td> </tr> </tr> <tr> <tr> <td>{@link android.nfc.tech.MifareUltralight}</td> <td>{@link android.nfc.tech.MifareUltralight}</td> <td>Provides access to MIFARE Ultralight properties and I/O operations. Not all Android <td>Provides access to MIFARE Ultralight properties and I/O operations, if this devices provide implementations for this class.</td> Android device supports MIFARE.</td> </tr> </tr> </table> </table> Loading @@ -191,12 +203,13 @@ page.title=Near Field Communication </li> </li> <li>The minimum SDK version that your application can support. API level 9 only supports <li>The minimum SDK version that your application can support. API level 9 only supports limited tag dispatching with {@link android.nfc.NfcAdapter#ACTION_TAG_DISCOVERED}, and only limited tag dispatch via {@link android.nfc.NfcAdapter#ACTION_TAG_DISCOVERED}, gives access to NDEF messages via the {@link android.nfc.NfcAdapter#EXTRA_NDEF_MESSAGES} extra. and only gives access to NDEF messages via the {@link android.nfc.NfcAdapter#EXTRA_NDEF_MESSAGES} No other tag properties or I/O operations are accessible. API level 10 adds comprehensive extra. No other tag properties or I/O operations are accessible. You probably want reader/writer support, so you probably want to use this for more functionality. to use API level 10 which includes comprehensive reader/writer support. <pre class="pretty-print"> <pre class="pretty-print"> <uses-sdk android:minSdkVersion="9|10"/> <uses-sdk android:minSdkVersion="10"/> </pre> </pre> </li> </li> Loading