Stay organized with collections
Save and categorize content based on your preferences.
NfcManager
class NfcManager
High level manager used to obtain an instance of an NfcAdapter
.
Use android.content.Context#getSystemService(java.lang.String)
with Context.NFC_SERVICE
to create an NfcManager
, then call getDefaultAdapter
to obtain the NfcAdapter
.
Alternately, you can just call the static helper NfcAdapter.getDefaultAdapter(android.content.Context)
.
Summary
Public methods |
NfcAdapter! |
Get the default NFC Adapter for this device.
|
Public methods
getDefaultAdapter
fun getDefaultAdapter(): NfcAdapter!
Get the default NFC Adapter for this device.
Content and code samples on this page are subject to the licenses described in the Content License. Java and OpenJDK are trademarks or registered trademarks of Oracle and/or its affiliates.
Last updated 2025-02-10 UTC.
[null,null,["Last updated 2025-02-10 UTC."],[],[],null,["# NfcManager\n\nAdded in [API level 10](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels)\n\nNfcManager\n==========\n\n*** ** * ** ***\n\nKotlin \\|[Java](/reference/android/nfc/NfcManager \"View this page in Java\") \n\n```\nclass NfcManager\n```\n\n|---|-----------------------------|\n| [kotlin.Any](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-any/index.html) ||\n| ↳ | [android.nfc.NfcManager](#) |\n\nHigh level manager used to obtain an instance of an [NfcAdapter](/reference/kotlin/android/nfc/NfcAdapter).\n\nUse [android.content.Context#getSystemService(java.lang.String)](../content/Context.html#getSystemService(kotlin.String)) with [Context.NFC_SERVICE](../content/Context.html#NFC_SERVICE:kotlin.String) to create an [NfcManager](#), then call [getDefaultAdapter](#getDefaultAdapter()) to obtain the [NfcAdapter](/reference/kotlin/android/nfc/NfcAdapter).\n\nAlternately, you can just call the static helper [NfcAdapter.getDefaultAdapter(android.content.Context)](/reference/kotlin/android/nfc/NfcAdapter#getDefaultAdapter(android.content.Context)).\n|\n| ### Developer Guides\n|\n| For more information about using NFC, read the [Near Field Communication](https://developer.android.com/guide/topics/nfc/index.html) developer guide.\n\nSummary\n-------\n\n| Public methods ||\n|---------------------------------------------------------|--------------------------------------------------------------------------------------------|\n| [NfcAdapter](/reference/kotlin/android/nfc/NfcAdapter)! | [getDefaultAdapter](#getDefaultAdapter())`()` Get the default NFC Adapter for this device. |\n\nPublic methods\n--------------\n\n### getDefaultAdapter\n\nAdded in [API level 10](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels) \n\n```\nfun getDefaultAdapter(): NfcAdapter!\n```\n\nGet the default NFC Adapter for this device.\n\n| Return ||\n|---------------------------------------------------------|-------------------------|\n| [NfcAdapter](/reference/kotlin/android/nfc/NfcAdapter)! | the default NFC Adapter |"]]