- Android Basics
- Android - Home
- Android - Overview
- Android - Environment Setup
- Android - Architecture
- Android - Application Components
- Android - Hello World Example
- Android - Resources
- Android - Activities
- Android - Services
- Android - Broadcast Receivers
- Android - Content Providers
- Android - Fragments
- Android - Intents/Filters
- Android - User Interface
- Android - UI Layouts
- Android - UI Controls
- Android - Event Handling
- Android - Styles and Themes
- Android - Custom Components
- Android Advanced Concepts
- Android - Drag and Drop
- Android - Notifications
- Location Based Services
- Android - Sending Email
- Android - Sending SMS
- Android - Phone Calls
- Publishing Android Application
- Android Useful Examples
- Android - Alert Dialoges
- Android - Animations
- Android - Audio Capture
- Android - AudioManager
- Android - Auto Complete
- Android - Best Practices
- Android - Bluetooth
- Android - Camera
- Android - Clipboard
- Android - Custom Fonts
- Android - Data Backup
- Android - Developer Tools
- Android - Emulator
- Android - Facebook Integration
- Android - Gestures
- Android - Google Maps
- Android - Image Effects
- Android - ImageSwitcher
- Android - Internal Storage
- Android - JetPlayer
- Android - JSON Parser
- Android - Linkedin Integration
- Android - Loading Spinner
- Android - Localization
- Android - Login Screen
- Android - MediaPlayer
- Android - Multitouch
- Android - Navigation
- Android - Network Connection
- Android - NFC Guide
- Android - PHP/MySQL
- Android - Progress Circle
- Android - ProgressBar
- Android - Push Notification
- Android - RenderScript
- Android - RSS Reader
- Android - Screen Cast
- Android - SDK Manager
- Android - Sensors
- Android - Session Management
- Android - Shared Preferences
- Android - SIP Protocol
- Android - Spelling Checker
- Android - SQLite Database
- Android - Support Library
- Android - Testing
- Android - Text to Speech
- Android - TextureView
- Android - Twitter Integration
- Android - UI Design
- Android - UI Patterns
- Android - UI Testing
- Android - WebView Layout
- Android - Wi-Fi
- Android - Widgets
- Android - XML Parsers
- Android Useful Resources
- Android - Questions and Answers
- Android - Useful Resources
- Android - Discussion
- Selected Reading
- UPSC IAS Exams Notes
- Developer's Best Practices
- Questions and Answers
- Effective Resume Writing
- HR Interview Questions
- Computer Glossary
- Who is Who
Android - NFC Guide
NFC stands for Near Field Communication, and as the name implies it provides a wireless communication mechanism between two compatible devices. NFC is a short range wireless technology having a range of 4cm or less for two devices to share data.
How It Works
Like Bluetooth and WiFi, and all manner of other wireless signals, NFC works on the principle of sending information over radio waves. Through NFC data is send through electromagnetic induction between two devices.
NFC works on the bases of tags , it allows you to share some amount of data between an NFC tag and an android powered device or between two android powered devices. Tags have various set of complexities. The Data stored in the tag can be written in a variety of formats, but android APIs are based around a NFC standard called as NFC Data Exchange Format(NDEF)..
The transmission frequency for data across NFC is 13.56 megahertz, and data can be sent at either 106, 212 or 424 kilobits per second, which is quick enough for a range of data transfers from contact details to swapping pictures, songs and videos.
Android powered devices with NFC supports following three main modes of operations −
Three Modes of Operation
Reader/Writer Mode − It allows the NFC device to read or write passive NFC tags.
P2P mode − This mode allows NFC device to exchange data with other NFC peers.
Card emulation mode − It allows the NFC device itself to act as an NFC card, so it can be accessed by an external NFC reader.
How it works with Android
To get the permission to access NFC Hardware, add the following permission in your Android.Manifest file.
<uses-sdk android:minSdkVersion="10"/>
First thing to note is that not all android powered devices provide NFC technology. So to make sure that your application shows up in google play for only those devices that have NFC Hardware, add the following line in your Android.Manifest file.
<uses-feature android:name="android.hardware.nfc" android:required="true"/>
Android provides a android.nfc package for communicating with another device. This package contains following classes −
Sr.No | Classes & Description |
---|---|
1 |
NdefMessage It represents an immutable NDEF Message. |
2 |
NdefRecord It represents an immutable NDEF Record. |
3 |
NfcAdapter It represents the local NFC adapter. |
4 |
NfcEvent It wraps information associated with any NFC event. |
5 |
NfcManager It is a high level manager used to obtain an instance of an NfcAdapter. |
6 |
Tag It represents an NFC tag that has been discovered. |
NFC tags system works in android with the help of some intent filters that are listed below:
Sr.No | Filters & Features |
---|---|
1 |
ACTION_NDEF_DISCOVERED This intent is used to start an Activity when a tag contains an NDEF payload. |
2 |
ACTION_TECH_DISCOVERED This intent is used to start an activity if the tag does not contain NDEF data, but is of known technology. |
3 |
ACTION_TAG_DISCOVERED This intent is started if no activities handle the ACTION_NDEF_DISCOVERED or ACTION_TECH_DISCOVERED intents. |
To code an application that uses NFC technology is complex so don't use it in your app unless necessary. The use of NFC is not common in devices but it is getting popular. Let's see what is the future of this technology −
Future Applications
With this technology growing day by day and due to introduction of contact less payment systems this technology is getting a boom. A service known as Google Wallet is already introduced in the US which purpose is to make our smartphones a viable alternative to credit and transport cards.