SlideShare a Scribd company logo
Presenter: Jitendra Singh, Mindfire Solutions
Date: 12/feb/2015
NEAR FIELD COMMUNICATION
Presenter: Jitendra Singh, Mindfire Solutions
About Me
Jitendra Singh
Senior Android Developer
Mindfire Solutions
Skills: AndroidApplicationDevelopment, Blackberry,PhoneGap,
Struts, Hibernate, Servlets, JSP, J2EE, Apache, CoreJava,
SQL, SQLite, SQLServer, J2ME, JasperReport,NFC
Skype: mfsi_jitendra.singh
Email:jitendra.singh@mindfiresolutions.com
Presenter: Jitendra Singh, Mindfire Solutions
AGENDA
1) What is NFC?
2) Classes available in Android to use NFC
3) NDEF Structure
4) Tag Intent Dispatch System
5) NFC Intents
6) Filtering for NFC Intents
7) How to check whether a device supports NFC or not
8) NFC Tag Reading/Writing
9) Android Application Record
Presenter: Jitendra Singh, Mindfire Solutions
1) NFC is a high frequency short-range wireless communication technology that enables the exchange of
data between devices over about a 10 cm distance.
2) Near-field communication uses electromagnetic induction between two loop antennas located within each
others near field.
3) Android-powered devices with NFC mainly support two main modes of operation:
a) Reader/writer mode, allowing the NFC device to read and/or write passive NFC tags and stickers.
b) P2P mode, allowing the NFC device to exchange data with other NFC peers; this operation mode is
used by Android Beam.
Presenter: Jitendra Singh, Mindfire Solutions
1) NFC-related APIs in Android are introduced to users starting from API level 9.
2) Currently, there are two packages for NFC application development in the Android platform.
a) The first is the main package that you will use is android.nfc, which includes
necessary classes to enable applications to read and write NDEF messages
in/to NFC tags.
b) The second is the android.nfc.tech package, which includes necessary classes
to provide access to different tag technologies such as MIFARE Classic, NfcA
, NfcV, and so on.
Continued........
Presenter: Jitendra Singh, Mindfire Solutions
CLASS NAME DESCRIPTION
Tag Represents the discovered NFC tag
NfcAdapter Represents the NFC adapter of the
mobile phone
NfcManager Obtains an instance of the NFC adapter
NdefMessage Represents an NDEF message
NdefRecord Represents an NDEF record
Classes available in the android.nfc package are as follows
Presenter: Jitendra Singh, Mindfire Solutions
1) All the messages that are transferred between two android devices or between devices or a
NFC tag are mostly transferred in NDEF format.
2) NDEF is a binary format structured in messages, each of which can contain several records.
3) Each record is made up of a header, which contains meta data about the record, such as the
record type,length, and so forth, and the payload, which contains the content of the message.
Continued........
Presenter: Jitendra Singh, Mindfire Solutions
4) An NDEF record consists of a type name format (TNF), payload type, payload identifier, and the
payload.
5) The TNF tells you how to interpret the payload type. The payload type is an NFC-specific type,
MIME mediatype, or URI that tells you how to interpret the payload.
6) Another way to think about this is that the TNF is the metadata about the payload type, and the
payload type is the metadata about the payload.
Presenter: Jitendra Singh, Mindfire Solutions
1) The tag intent dispatch system is used to launch applications when the predefined tags or NDEF
data are identified in tags.
2) In short, you scan to an NFC tag, and if any application is registered to handle the tag, then the
registered application launches.
3) If more than one application is registered to handle the tag, a pop-up to select the application
(Activity Chooser) is displayed.
4)When an NFC tag is discovered in proximity, the type and payload data in the tag will be
encapsulated to intent, and the tag intent dispatch system in Android will run the corresponding
application that can handle the tag.
Continued........
Presenter: Jitendra Singh, Mindfire Solutions
ACTION_NDEF_DISCOVERED
The tag dispatch system uses the TNF and Type fields to try to map a known MIME type or URI to the NDEF message. If
successful, it encapsulates that information inside of a ACTION_NDEF_DISCOVERED intent along with the actual
payload.
This intent is used to start an Activity when a tag that contains an NDEF payload is scanned and is of a recognized type.
This is the highest priority intent, and the tag dispatch system tries to start an Activity with this intent before any other
intent, whenever possible.
ACTION_TECH_DISCOVERED
If the tag dispatch system cannot determine the Type of data based on the first NDEF record. This happens when the
NDEF data cannot be mapped to a MIME type or URI.
In such cases, a Tag object that has information about the tag's technologies and the payload are encapsulated inside of
a ACTION_TECH_DISCOVERED intent.
ACTION_TAG_DISCOVERED
This intent has the lowest priority. If no activities in the device can handle the corresponding above intents, then
ACTION_TAG_DISCOVERED is created.
Continued........
Presenter: Jitendra Singh, Mindfire Solutions
1)The tag dispatch system works as follows:
➤ If the payload contains NDEF data:
1. Try to start an activity with the ACTION_NDEF_DISCOVERED intent.
2. If no activities filter for the discovered NDEF data, try to start an activity with the
the ACTION_TECH_DISCOVERED intent.
➤ If the payload does not contain NDEF data but is of a known tag technology:
1. Try to start an activity with the ACTION_TECH_DISCOVERED intent.
2. If no activities filter for that intent, try to start an activity with the ACTION_TAG_DISCOVERED intent.
There are 3 types of NFC intents viz :
1) ACTION_NDEF_DISCOVERED
2) ACTION_TECH_DISCOVERED
3) ACTION_TAG_DISCOVERED
Presenter: Jitendra Singh, Mindfire Solutions
Presenter: Jitendra Singh, Mindfire Solutions
Filtering for ACTION_NDEF_DISCOVERED
This concept would be best explained by examples
Example 1
<intent-filter>
<action android:name="android.nfc.action.NDEF_DISCOVERED"/>
<category android:name="android.intent.category.DEFAULT"/>
<data android:mimeType="text/plain" />
</intent-filter>
Example 2
<intent-filter>
<action android:name="android.nfc.action.NDEF_DISCOVERED"/>
<category android:name="android.intent.category.DEFAULT"/>
<data android:scheme="http"
android:host="developer.android.com"
android:pathPrefix="/index.html" />
</intent-filter>
Continued........
Presenter: Jitendra Singh, Mindfire Solutions
Filtering for ACTION_TECH_DISCOVERED
If your activity filters for the ACTION_TECH_DISCOVERED intent, you must create an XML resource file that specifies the
technologies that your activity supports within a tech-list set. Your activity is considered a match if a tech-list set is a subset of
the technologies that are supported by the tag.
Example
<resources xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
<tech-list>
<tech>android.nfc.tech.IsoDep</tech>
<tech>android.nfc.tech.NfcA</tech>
<tech>android.nfc.tech.NfcB</tech>
<tech>android.nfc.tech.NfcF</tech>
<tech>android.nfc.tech.NfcV</tech>
<tech>android.nfc.tech.Ndef</tech>
<tech>android.nfc.tech.NdefFormatable</tech>
<tech>android.nfc.tech.MifareClassic</tech>
<tech>android.nfc.tech.MifareUltralight</tech>
</tech-list>
</resources>
In your AndroidManifest.xml file, specify the resource file that you just created in the <meta-data> element inside the
<activity> element like in the following example:
<activity>
<intent-filter>
<action android:name="android.nfc.action.TECH_DISCOVERED"/>
</intent-filter>
<meta-data android:name="android.nfc.action.TECH_DISCOVERED"
android:resource="@xml/nfc_tech_filter" />
</activity>
Presenter: Jitendra Singh, Mindfire Solutions
Filtering for ACTION_TECH_DISCOVERED
To filter for ACTION_TAG_DISCOVERED use the following intent filter:
<intent-filter>
<action android:name="android.nfc.action.TAG_DISCOVERED"/>
</intent-filter>
Presenter: Jitendra Singh, Mindfire Solutions
How to check whether a device supports NFC or not
The NFCAdapter class in the android.nfc package represents the NFC adapter for the local machine.
Checking if the NFCAdapter is available is the first thing to do in an NFC application. Here is the code to
create the necessary NfcAdapter:
private NfcAdapter myNfcAdapter;
private TextView myText;
@Override
public void onCreate(Bundle savedInstanceState)
{
super.onCreate(savedInstanceState);
setContentView(R.layout.main);
myNfcAdapter = NfcAdapter.getDefaultAdapter(this);
if (myNfcAdapter == null)
{
myText.setText("NFC is not available for the device!!!");
}
else
{
myText.setText("NFC is available for the device");
}
}
Presenter: Jitendra Singh, Mindfire Solutions
How to check whether a device supports NFC or not
The NFCAdapter class in the android.nfc package represents the NFC adapter for the device. Checking if
the NFCAdapter is available is the first thing to do in an NFC application. Here is the code to create the
necessary NfcAdapter:
private NfcAdapter myNfcAdapter;
private TextView myText;
@Override
public void onCreate(Bundle savedInstanceState)
{
super.onCreate(savedInstanceState);
setContentView(R.layout.main);
myNfcAdapter = NfcAdapter.getDefaultAdapter(this);
if (myNfcAdapter == null)
{
myText.setText("NFC is not available for the device!!!");
}
else
{
myText.setText("NFC is available for the device");
}
}
Presenter: Jitendra Singh, Mindfire Solutions
8) NFC Tag Writing
In the following code, the basic write operation to a tag is shown, in which the discovered tag has NDEF
payload.
if (NfcAdapter.ACTION_NDEF_DISCOVERED.equals(getIntent().getAction()))
{
Tag detectedTag = getIntent().getParcelableExtra(NfcAdapter.EXTRA_TAG);
Ndef ndef = Ndef.get(detectedTag);
//If ndef object is null it means that the tag is not NDEF-formatted and you cannot use Ndef class.
//If it is already NDEF-formatted, you will use Ndef class; otherwise, you need to use NdefFormatable
//class with following code
If(ndef == null)
NdefFormatable ndefFormat = NdefFormatable.get(detectedTag);
//If ndefFormat object is also null then it means that the tag does not support the NDEF
//and we need to break the operation.
ndef.connect();
ndef.writeNdefMessage(message);
ndef.close();
}
Presenter: Jitendra Singh, Mindfire Solutions
NFC Tag Reading
Tag detectedTag = getIntent().getParcelableExtra(NfcAdapter.EXTRA_TAG);
NdefMessage[] messages = getNdefMessages(getIntent());
NdefMessage[] getNdefMessages(Intent intent)
{
NdefMessage[] message = null;
if (NfcAdapter.ACTION_NDEF_DISCOVERED.equals(intent.getAction()))
{
Parcelable[] rawMessages =intent.getParcelableArrayExtraNfcAdapter.EXTRA_NDEF_MESSAGES);
if (rawMessages != null)
{
message = new NdefMessage[rawMessages.length];
for (int i = 0; i < rawMessages.length; i++)
{
message[i] = (NdefMessage) rawMessages[i];
}
}
else
{
Log.d("", "No messages inside tag");
}
}
else
{
Log.d("", "Unknown intent.");
finish();
}
return message;
}
Presenter: Jitendra Singh, Mindfire Solutions
Android Application Record
1) Android Application Record (AAR) is introduced in API level 14 and is a very powerful
property of Android NFC.
2) The main objective of AAR is to start the application when an NFC tag is scanned.
3) Despite the fact that the manifest file gives this property to NFC, AAR strengthens the
property because more than one application may have been registered for, and may filter, the
same intents on a mobile phone.
4) An AAR is the package name of an application. You need to insert the AAR record to an
NDEF message, similarly to the way it is done with an NDEF record.
When an NFC tag is scanned, Android searches the entire NDEF message for AAR. If it fi nds
an AAR in any of the NDEF records, it starts the corresponding application. If the application
is not installed on the device, Google Play is launched automatically to download the
corresponding application.
Police Scanner for Android - Locate and listen
to Police dispatch frequencies.
An application/tool for the Android, which can locate
police dispatch frequencies of various countries along
with cities, counties, and channels, was something that
one of our clients wanted to develop. Their objective
was to help people (users of the app) stay informed
about any major disaster (happened/forthcoming) by
listening to emergency broadcast streams in real time.
Their requirement revealed that they wanted the app
to stream the media buffer of a radio channel over
internet and play it with native media player. He also
required that all users of the app would be
automatically updated to the new list whenever there
is a new entry to the database that contained the list of
countries, cities or station. Their requirements were
stringent and needed someone who can understand
their vision and meet their expectations.
Click here for details >>
Sample Case Study
www.mindfiresolutions.com
www.mindfiresolutions.com
https://www.facebook.com/MindfireSolutions
http://www.linkedin.com/company/mindfire-solutions
http://twitter.com/mindfires

More Related Content

What's hot

NFC Bootcamp Seattle Day 1
NFC Bootcamp Seattle Day 1NFC Bootcamp Seattle Day 1
NFC Bootcamp Seattle Day 1
traceebeebe
 
Sto L Pa N@Nfc Academy 2009
Sto L Pa N@Nfc Academy 2009Sto L Pa N@Nfc Academy 2009
Sto L Pa N@Nfc Academy 2009
CATTID - University of Rome
 
NFS - Company presentation 2015
NFS - Company presentation 2015NFS - Company presentation 2015
NFS - Company presentation 2015
Near Field Solutions
 
NXP NFC Android Porting Guide_2017.Jun
NXP NFC Android Porting Guide_2017.JunNXP NFC Android Porting Guide_2017.Jun
NXP NFC Android Porting Guide_2017.Jun
Daniel Chiu
 
NFC TECHNOLOGY
NFC TECHNOLOGYNFC TECHNOLOGY
NFC TECHNOLOGY
manasvi sarkar
 
Webinar on Insider's Insight into NFC
Webinar on Insider's Insight into NFCWebinar on Insider's Insight into NFC
Webinar on Insider's Insight into NFC
Endeavour Software Technologies
 
Electronic Access Control Security / Безопасность электронных систем контроля...
Electronic Access Control Security / Безопасность электронных систем контроля...Electronic Access Control Security / Безопасность электронных систем контроля...
Electronic Access Control Security / Безопасность электронных систем контроля...
Positive Hack Days
 
Near Field Communication (NFC Architecture and Operating Modes)
Near Field Communication (NFC Architecture and Operating Modes)Near Field Communication (NFC Architecture and Operating Modes)
Near Field Communication (NFC Architecture and Operating Modes)Deepak Kl
 
NFC: Shaping the Future of the Connected Customer Experience
NFC: Shaping the Future of the Connected Customer ExperienceNFC: Shaping the Future of the Connected Customer Experience
NFC: Shaping the Future of the Connected Customer Experience
NFC Forum
 
Nfc kdr
Nfc kdrNfc kdr
Nfc kdr
Shahul Hameed
 
Security in Near Field Communication
Security in Near Field CommunicationSecurity in Near Field Communication
Security in Near Field CommunicationVinit Varghese
 
SIM application toolkit in the context of Near Field communication Applications
SIM application toolkit in the context of Near Field communication ApplicationsSIM application toolkit in the context of Near Field communication Applications
SIM application toolkit in the context of Near Field communication Applications
Mukta Gupta
 
NFC in direct mail: The pros and cons
NFC in direct mail: The pros and consNFC in direct mail: The pros and cons
NFC in direct mail: The pros and cons
CPS Cards
 
VISIONFC Automotive Summit
VISIONFC Automotive SummitVISIONFC Automotive Summit
VISIONFC Automotive Summit
NFC Forum
 
NFC technical presentation
NFC technical presentationNFC technical presentation
NFC technical presentationAkshat Rohatgi
 
NFC wallet
NFC walletNFC wallet
Enhancement of security in rfid using rsa algorithm
Enhancement of security in rfid using rsa algorithmEnhancement of security in rfid using rsa algorithm
Enhancement of security in rfid using rsa algorithmAlexander Decker
 
KEY GENERATION FRAMEWORK FOR MULTIPLE WIRELESS DEVICES USING MULTIPATH ROUTING
KEY GENERATION FRAMEWORK FOR MULTIPLE WIRELESS DEVICES USING MULTIPATH ROUTINGKEY GENERATION FRAMEWORK FOR MULTIPLE WIRELESS DEVICES USING MULTIPATH ROUTING
KEY GENERATION FRAMEWORK FOR MULTIPLE WIRELESS DEVICES USING MULTIPATH ROUTING
ecij
 
Merchant360 SP4G(tm) NFC Coverage Walls Counters and Floors
Merchant360 SP4G(tm) NFC Coverage Walls Counters and FloorsMerchant360 SP4G(tm) NFC Coverage Walls Counters and Floors
Merchant360 SP4G(tm) NFC Coverage Walls Counters and Floors
Merchant360, Inc.
 

What's hot (20)

NFC Bootcamp Seattle Day 1
NFC Bootcamp Seattle Day 1NFC Bootcamp Seattle Day 1
NFC Bootcamp Seattle Day 1
 
Sto L Pa N@Nfc Academy 2009
Sto L Pa N@Nfc Academy 2009Sto L Pa N@Nfc Academy 2009
Sto L Pa N@Nfc Academy 2009
 
NFS - Company presentation 2015
NFS - Company presentation 2015NFS - Company presentation 2015
NFS - Company presentation 2015
 
NXP NFC Android Porting Guide_2017.Jun
NXP NFC Android Porting Guide_2017.JunNXP NFC Android Porting Guide_2017.Jun
NXP NFC Android Porting Guide_2017.Jun
 
NFC TECHNOLOGY
NFC TECHNOLOGYNFC TECHNOLOGY
NFC TECHNOLOGY
 
Webinar on Insider's Insight into NFC
Webinar on Insider's Insight into NFCWebinar on Insider's Insight into NFC
Webinar on Insider's Insight into NFC
 
Electronic Access Control Security / Безопасность электронных систем контроля...
Electronic Access Control Security / Безопасность электронных систем контроля...Electronic Access Control Security / Безопасность электронных систем контроля...
Electronic Access Control Security / Безопасность электронных систем контроля...
 
Near Field Communication (NFC Architecture and Operating Modes)
Near Field Communication (NFC Architecture and Operating Modes)Near Field Communication (NFC Architecture and Operating Modes)
Near Field Communication (NFC Architecture and Operating Modes)
 
NFC: Shaping the Future of the Connected Customer Experience
NFC: Shaping the Future of the Connected Customer ExperienceNFC: Shaping the Future of the Connected Customer Experience
NFC: Shaping the Future of the Connected Customer Experience
 
Nfc kdr
Nfc kdrNfc kdr
Nfc kdr
 
Security in Near Field Communication
Security in Near Field CommunicationSecurity in Near Field Communication
Security in Near Field Communication
 
SIM application toolkit in the context of Near Field communication Applications
SIM application toolkit in the context of Near Field communication ApplicationsSIM application toolkit in the context of Near Field communication Applications
SIM application toolkit in the context of Near Field communication Applications
 
NFC in direct mail: The pros and cons
NFC in direct mail: The pros and consNFC in direct mail: The pros and cons
NFC in direct mail: The pros and cons
 
VISIONFC Automotive Summit
VISIONFC Automotive SummitVISIONFC Automotive Summit
VISIONFC Automotive Summit
 
NFC technical presentation
NFC technical presentationNFC technical presentation
NFC technical presentation
 
Nfc
NfcNfc
Nfc
 
NFC wallet
NFC walletNFC wallet
NFC wallet
 
Enhancement of security in rfid using rsa algorithm
Enhancement of security in rfid using rsa algorithmEnhancement of security in rfid using rsa algorithm
Enhancement of security in rfid using rsa algorithm
 
KEY GENERATION FRAMEWORK FOR MULTIPLE WIRELESS DEVICES USING MULTIPATH ROUTING
KEY GENERATION FRAMEWORK FOR MULTIPLE WIRELESS DEVICES USING MULTIPATH ROUTINGKEY GENERATION FRAMEWORK FOR MULTIPLE WIRELESS DEVICES USING MULTIPATH ROUTING
KEY GENERATION FRAMEWORK FOR MULTIPLE WIRELESS DEVICES USING MULTIPATH ROUTING
 
Merchant360 SP4G(tm) NFC Coverage Walls Counters and Floors
Merchant360 SP4G(tm) NFC Coverage Walls Counters and FloorsMerchant360 SP4G(tm) NFC Coverage Walls Counters and Floors
Merchant360 SP4G(tm) NFC Coverage Walls Counters and Floors
 

Viewers also liked

Windows (Phone) 8 NFC App Scenarios
Windows (Phone) 8 NFC App ScenariosWindows (Phone) 8 NFC App Scenarios
Windows (Phone) 8 NFC App Scenarios
Andreas Jakl
 
Vodafone Cash Service - NFC tag
Vodafone Cash Service - NFC tagVodafone Cash Service - NFC tag
Vodafone Cash Service - NFC tag
Deyaa Ahmed
 
Nfc tutorial
Nfc tutorialNfc tutorial
Nfc tutorial
Roy Chen
 
Razorfish nfc technologies presentation 2013
Razorfish nfc technologies presentation 2013Razorfish nfc technologies presentation 2013
Razorfish nfc technologies presentation 2013
Razorfish
 
Guide du tag NFC : quels usages dans quels contextes ?
Guide du tag NFC : quels usages dans quels contextes ?Guide du tag NFC : quels usages dans quels contextes ?
Guide du tag NFC : quels usages dans quels contextes ?
Olivier Devillers
 
Near field communication(nfc)
Near field communication(nfc)Near field communication(nfc)
Near field communication(nfc)Bhaumik Gagwani
 
Contactless NFC Tags For Mobile Loyalty
Contactless NFC Tags For Mobile LoyaltyContactless NFC Tags For Mobile Loyalty
Contactless NFC Tags For Mobile Loyalty
Merchant360, Inc.
 
Near field communication
Near field communicationNear field communication
Near field communicationNagesh Mishra
 
Nfc-Full Presentation
Nfc-Full PresentationNfc-Full Presentation
Nfc-Full Presentation
DILIN RAJ DS
 
NFC(Near Field Communication)
NFC(Near Field Communication)NFC(Near Field Communication)
NFC(Near Field Communication)
ADARSH KUMAR
 
Introduction to nfc
Introduction to nfcIntroduction to nfc
Introduction to nfc
Ray Cheng
 
Near field communication new
Near field communication newNear field communication new
Near field communication newSanu Varghese
 
RFID: a condensed overview
RFID: a condensed overviewRFID: a condensed overview
RFID: a condensed overview
Maarten Weyn
 
Track 4 session 5 - st dev con 2016 - simplifying the setup and use of iot ...
Track 4   session 5 - st dev con 2016 - simplifying the setup and use of iot ...Track 4   session 5 - st dev con 2016 - simplifying the setup and use of iot ...
Track 4 session 5 - st dev con 2016 - simplifying the setup and use of iot ...
ST_World
 
Nfc
NfcNfc

Viewers also liked (16)

Windows (Phone) 8 NFC App Scenarios
Windows (Phone) 8 NFC App ScenariosWindows (Phone) 8 NFC App Scenarios
Windows (Phone) 8 NFC App Scenarios
 
Vodafone Cash Service - NFC tag
Vodafone Cash Service - NFC tagVodafone Cash Service - NFC tag
Vodafone Cash Service - NFC tag
 
Nfc tutorial
Nfc tutorialNfc tutorial
Nfc tutorial
 
Razorfish nfc technologies presentation 2013
Razorfish nfc technologies presentation 2013Razorfish nfc technologies presentation 2013
Razorfish nfc technologies presentation 2013
 
Guide du tag NFC : quels usages dans quels contextes ?
Guide du tag NFC : quels usages dans quels contextes ?Guide du tag NFC : quels usages dans quels contextes ?
Guide du tag NFC : quels usages dans quels contextes ?
 
Near field communication(nfc)
Near field communication(nfc)Near field communication(nfc)
Near field communication(nfc)
 
Contactless NFC Tags For Mobile Loyalty
Contactless NFC Tags For Mobile LoyaltyContactless NFC Tags For Mobile Loyalty
Contactless NFC Tags For Mobile Loyalty
 
Near field communication
Near field communicationNear field communication
Near field communication
 
Nfc-Full Presentation
Nfc-Full PresentationNfc-Full Presentation
Nfc-Full Presentation
 
Nfc technology ppt
Nfc technology pptNfc technology ppt
Nfc technology ppt
 
NFC(Near Field Communication)
NFC(Near Field Communication)NFC(Near Field Communication)
NFC(Near Field Communication)
 
Introduction to nfc
Introduction to nfcIntroduction to nfc
Introduction to nfc
 
Near field communication new
Near field communication newNear field communication new
Near field communication new
 
RFID: a condensed overview
RFID: a condensed overviewRFID: a condensed overview
RFID: a condensed overview
 
Track 4 session 5 - st dev con 2016 - simplifying the setup and use of iot ...
Track 4   session 5 - st dev con 2016 - simplifying the setup and use of iot ...Track 4   session 5 - st dev con 2016 - simplifying the setup and use of iot ...
Track 4 session 5 - st dev con 2016 - simplifying the setup and use of iot ...
 
Nfc
NfcNfc
Nfc
 

Similar to Near field communication (NFC) in android

Android NFC
Android NFCAndroid NFC
Android NFC
Francesco Azzola
 
Nfc on Android
Nfc on AndroidNfc on Android
Nfc on Android
Fernando Cejas
 
NFC Bootcamp Seattle Day 2
NFC Bootcamp Seattle Day 2 NFC Bootcamp Seattle Day 2
NFC Bootcamp Seattle Day 2
traceebeebe
 
NFC on Android - Near Field Communication
NFC on Android - Near Field CommunicationNFC on Android - Near Field Communication
NFC on Android - Near Field Communication
Sven Haiges
 
NFiD: An NFC based system for Digital Business Cards
NFiD: An NFC based system for Digital Business CardsNFiD: An NFC based system for Digital Business Cards
NFiD: An NFC based system for Digital Business Cards
IRJET Journal
 
HyperRing SDK Documentation: Advanced NFC and Multi-Factor Authentication Int...
HyperRing SDK Documentation: Advanced NFC and Multi-Factor Authentication Int...HyperRing SDK Documentation: Advanced NFC and Multi-Factor Authentication Int...
HyperRing SDK Documentation: Advanced NFC and Multi-Factor Authentication Int...
hyperringco
 
NFC & RFID on Android
NFC & RFID on AndroidNFC & RFID on Android
NFC & RFID on Android
todbotdotcom
 
Kinectic vision looking deep into depth
Kinectic vision   looking deep into depthKinectic vision   looking deep into depth
Kinectic vision looking deep into depth
ppd1961
 
ANDROID
ANDROIDANDROID
ANDROID
DrMeftahZouai
 
Synapseindia android application development tutorial
Synapseindia android application development tutorialSynapseindia android application development tutorial
Synapseindia android application development tutorial
Synapseindiappsdevelopment
 
Synapseindia android apps development tutorial
Synapseindia android apps  development tutorialSynapseindia android apps  development tutorial
Synapseindia android apps development tutorial
Synapseindiappsdevelopment
 
How NFC tags Enhance Your Products’ Track and Trace System.pdf
How NFC tags Enhance Your Products’ Track and Trace System.pdfHow NFC tags Enhance Your Products’ Track and Trace System.pdf
How NFC tags Enhance Your Products’ Track and Trace System.pdf
TrackMatriX Technologies Limited
 
How NFC tags Enhance Your Products’ Track and Trace System.pptx
How NFC tags Enhance Your Products’ Track and Trace System.pptxHow NFC tags Enhance Your Products’ Track and Trace System.pptx
How NFC tags Enhance Your Products’ Track and Trace System.pptx
TrackMatriX Technologies Limited
 
A combined approach to search for evasion techniques in network intrusion det...
A combined approach to search for evasion techniques in network intrusion det...A combined approach to search for evasion techniques in network intrusion det...
A combined approach to search for evasion techniques in network intrusion det...
eSAT Journals
 
Android intents in android application-chapter7
Android intents in android application-chapter7Android intents in android application-chapter7
Android intents in android application-chapter7
Dr. Ramkumar Lakshminarayanan
 
Object Oriented Programming
Object Oriented ProgrammingObject Oriented Programming
Object Oriented Programming
Patricia Viljoen
 
The Technical Considerations for Creating a Decentralized Application
The Technical Considerations for Creating a Decentralized ApplicationThe Technical Considerations for Creating a Decentralized Application
The Technical Considerations for Creating a Decentralized Application
Gaming Arcade
 

Similar to Near field communication (NFC) in android (20)

Android NFC
Android NFCAndroid NFC
Android NFC
 
Nfc on Android
Nfc on AndroidNfc on Android
Nfc on Android
 
NFC Bootcamp Seattle Day 2
NFC Bootcamp Seattle Day 2 NFC Bootcamp Seattle Day 2
NFC Bootcamp Seattle Day 2
 
NFC on Android - Near Field Communication
NFC on Android - Near Field CommunicationNFC on Android - Near Field Communication
NFC on Android - Near Field Communication
 
NFiD: An NFC based system for Digital Business Cards
NFiD: An NFC based system for Digital Business CardsNFiD: An NFC based system for Digital Business Cards
NFiD: An NFC based system for Digital Business Cards
 
HyperRing SDK Documentation: Advanced NFC and Multi-Factor Authentication Int...
HyperRing SDK Documentation: Advanced NFC and Multi-Factor Authentication Int...HyperRing SDK Documentation: Advanced NFC and Multi-Factor Authentication Int...
HyperRing SDK Documentation: Advanced NFC and Multi-Factor Authentication Int...
 
NFC & RFID on Android
NFC & RFID on AndroidNFC & RFID on Android
NFC & RFID on Android
 
Kinectic vision looking deep into depth
Kinectic vision   looking deep into depthKinectic vision   looking deep into depth
Kinectic vision looking deep into depth
 
ANDROID
ANDROIDANDROID
ANDROID
 
Synapseindia android application development tutorial
Synapseindia android application development tutorialSynapseindia android application development tutorial
Synapseindia android application development tutorial
 
Synapseindia android apps development tutorial
Synapseindia android apps  development tutorialSynapseindia android apps  development tutorial
Synapseindia android apps development tutorial
 
draft.ResearchPoster
draft.ResearchPosterdraft.ResearchPoster
draft.ResearchPoster
 
How NFC tags Enhance Your Products’ Track and Trace System.pdf
How NFC tags Enhance Your Products’ Track and Trace System.pdfHow NFC tags Enhance Your Products’ Track and Trace System.pdf
How NFC tags Enhance Your Products’ Track and Trace System.pdf
 
How NFC tags Enhance Your Products’ Track and Trace System.pptx
How NFC tags Enhance Your Products’ Track and Trace System.pptxHow NFC tags Enhance Your Products’ Track and Trace System.pptx
How NFC tags Enhance Your Products’ Track and Trace System.pptx
 
Introduction to NFC
Introduction to NFCIntroduction to NFC
Introduction to NFC
 
A combined approach to search for evasion techniques in network intrusion det...
A combined approach to search for evasion techniques in network intrusion det...A combined approach to search for evasion techniques in network intrusion det...
A combined approach to search for evasion techniques in network intrusion det...
 
Android intents in android application-chapter7
Android intents in android application-chapter7Android intents in android application-chapter7
Android intents in android application-chapter7
 
Object Oriented Programming
Object Oriented ProgrammingObject Oriented Programming
Object Oriented Programming
 
The Technical Considerations for Creating a Decentralized Application
The Technical Considerations for Creating a Decentralized ApplicationThe Technical Considerations for Creating a Decentralized Application
The Technical Considerations for Creating a Decentralized Application
 
Ganesh
GaneshGanesh
Ganesh
 

More from Mindfire Solutions

Physician Search and Review
Physician Search and ReviewPhysician Search and Review
Physician Search and Review
Mindfire Solutions
 
diet management app
diet management appdiet management app
diet management app
Mindfire Solutions
 
Business Technology Solution
Business Technology SolutionBusiness Technology Solution
Business Technology Solution
Mindfire Solutions
 
Remote Health Monitoring
Remote Health MonitoringRemote Health Monitoring
Remote Health Monitoring
Mindfire Solutions
 
Influencer Marketing Solution
Influencer Marketing SolutionInfluencer Marketing Solution
Influencer Marketing Solution
Mindfire Solutions
 
ELMAH
ELMAHELMAH
High Availability of Azure Applications
High Availability of Azure ApplicationsHigh Availability of Azure Applications
High Availability of Azure Applications
Mindfire Solutions
 
IOT Hands On
IOT Hands OnIOT Hands On
IOT Hands On
Mindfire Solutions
 
Glimpse of Loops Vs Set
Glimpse of Loops Vs SetGlimpse of Loops Vs Set
Glimpse of Loops Vs Set
Mindfire Solutions
 
Oracle Sql Developer-Getting Started
Oracle Sql Developer-Getting StartedOracle Sql Developer-Getting Started
Oracle Sql Developer-Getting Started
Mindfire Solutions
 
Adaptive Layout In iOS 8
Adaptive Layout In iOS 8Adaptive Layout In iOS 8
Adaptive Layout In iOS 8
Mindfire Solutions
 
Introduction to Auto-layout : iOS/Mac
Introduction to Auto-layout : iOS/MacIntroduction to Auto-layout : iOS/Mac
Introduction to Auto-layout : iOS/Mac
Mindfire Solutions
 
LINQPad - utility Tool
LINQPad - utility ToolLINQPad - utility Tool
LINQPad - utility Tool
Mindfire Solutions
 
Get started with watch kit development
Get started with watch kit developmentGet started with watch kit development
Get started with watch kit development
Mindfire Solutions
 
Swift vs Objective-C
Swift vs Objective-CSwift vs Objective-C
Swift vs Objective-C
Mindfire Solutions
 
Material Design in Android
Material Design in AndroidMaterial Design in Android
Material Design in Android
Mindfire Solutions
 
Introduction to OData
Introduction to ODataIntroduction to OData
Introduction to OData
Mindfire Solutions
 
Ext js Part 2- MVC
Ext js Part 2- MVCExt js Part 2- MVC
Ext js Part 2- MVC
Mindfire Solutions
 
ExtJs Basic Part-1
ExtJs Basic Part-1ExtJs Basic Part-1
ExtJs Basic Part-1
Mindfire Solutions
 
Spring Security Introduction
Spring Security IntroductionSpring Security Introduction
Spring Security Introduction
Mindfire Solutions
 

More from Mindfire Solutions (20)

Physician Search and Review
Physician Search and ReviewPhysician Search and Review
Physician Search and Review
 
diet management app
diet management appdiet management app
diet management app
 
Business Technology Solution
Business Technology SolutionBusiness Technology Solution
Business Technology Solution
 
Remote Health Monitoring
Remote Health MonitoringRemote Health Monitoring
Remote Health Monitoring
 
Influencer Marketing Solution
Influencer Marketing SolutionInfluencer Marketing Solution
Influencer Marketing Solution
 
ELMAH
ELMAHELMAH
ELMAH
 
High Availability of Azure Applications
High Availability of Azure ApplicationsHigh Availability of Azure Applications
High Availability of Azure Applications
 
IOT Hands On
IOT Hands OnIOT Hands On
IOT Hands On
 
Glimpse of Loops Vs Set
Glimpse of Loops Vs SetGlimpse of Loops Vs Set
Glimpse of Loops Vs Set
 
Oracle Sql Developer-Getting Started
Oracle Sql Developer-Getting StartedOracle Sql Developer-Getting Started
Oracle Sql Developer-Getting Started
 
Adaptive Layout In iOS 8
Adaptive Layout In iOS 8Adaptive Layout In iOS 8
Adaptive Layout In iOS 8
 
Introduction to Auto-layout : iOS/Mac
Introduction to Auto-layout : iOS/MacIntroduction to Auto-layout : iOS/Mac
Introduction to Auto-layout : iOS/Mac
 
LINQPad - utility Tool
LINQPad - utility ToolLINQPad - utility Tool
LINQPad - utility Tool
 
Get started with watch kit development
Get started with watch kit developmentGet started with watch kit development
Get started with watch kit development
 
Swift vs Objective-C
Swift vs Objective-CSwift vs Objective-C
Swift vs Objective-C
 
Material Design in Android
Material Design in AndroidMaterial Design in Android
Material Design in Android
 
Introduction to OData
Introduction to ODataIntroduction to OData
Introduction to OData
 
Ext js Part 2- MVC
Ext js Part 2- MVCExt js Part 2- MVC
Ext js Part 2- MVC
 
ExtJs Basic Part-1
ExtJs Basic Part-1ExtJs Basic Part-1
ExtJs Basic Part-1
 
Spring Security Introduction
Spring Security IntroductionSpring Security Introduction
Spring Security Introduction
 

Recently uploaded

Cyaniclab : Software Development Agency Portfolio.pdf
Cyaniclab : Software Development Agency Portfolio.pdfCyaniclab : Software Development Agency Portfolio.pdf
Cyaniclab : Software Development Agency Portfolio.pdf
Cyanic lab
 
Corporate Management | Session 3 of 3 | Tendenci AMS
Corporate Management | Session 3 of 3 | Tendenci AMSCorporate Management | Session 3 of 3 | Tendenci AMS
Corporate Management | Session 3 of 3 | Tendenci AMS
Tendenci - The Open Source AMS (Association Management Software)
 
In 2015, I used to write extensions for Joomla, WordPress, phpBB3, etc and I ...
In 2015, I used to write extensions for Joomla, WordPress, phpBB3, etc and I ...In 2015, I used to write extensions for Joomla, WordPress, phpBB3, etc and I ...
In 2015, I used to write extensions for Joomla, WordPress, phpBB3, etc and I ...
Juraj Vysvader
 
Webinar: Salesforce Document Management 2.0 - Smarter, Faster, Better
Webinar: Salesforce Document Management 2.0 - Smarter, Faster, BetterWebinar: Salesforce Document Management 2.0 - Smarter, Faster, Better
Webinar: Salesforce Document Management 2.0 - Smarter, Faster, Better
XfilesPro
 
Software Testing Exam imp Ques Notes.pdf
Software Testing Exam imp Ques Notes.pdfSoftware Testing Exam imp Ques Notes.pdf
Software Testing Exam imp Ques Notes.pdf
MayankTawar1
 
Globus Compute wth IRI Workflows - GlobusWorld 2024
Globus Compute wth IRI Workflows - GlobusWorld 2024Globus Compute wth IRI Workflows - GlobusWorld 2024
Globus Compute wth IRI Workflows - GlobusWorld 2024
Globus
 
How Does XfilesPro Ensure Security While Sharing Documents in Salesforce?
How Does XfilesPro Ensure Security While Sharing Documents in Salesforce?How Does XfilesPro Ensure Security While Sharing Documents in Salesforce?
How Does XfilesPro Ensure Security While Sharing Documents in Salesforce?
XfilesPro
 
Field Employee Tracking System| MiTrack App| Best Employee Tracking Solution|...
Field Employee Tracking System| MiTrack App| Best Employee Tracking Solution|...Field Employee Tracking System| MiTrack App| Best Employee Tracking Solution|...
Field Employee Tracking System| MiTrack App| Best Employee Tracking Solution|...
informapgpstrackings
 
Paketo Buildpacks : la meilleure façon de construire des images OCI? DevopsDa...
Paketo Buildpacks : la meilleure façon de construire des images OCI? DevopsDa...Paketo Buildpacks : la meilleure façon de construire des images OCI? DevopsDa...
Paketo Buildpacks : la meilleure façon de construire des images OCI? DevopsDa...
Anthony Dahanne
 
Vitthal Shirke Microservices Resume Montevideo
Vitthal Shirke Microservices Resume MontevideoVitthal Shirke Microservices Resume Montevideo
Vitthal Shirke Microservices Resume Montevideo
Vitthal Shirke
 
Accelerate Enterprise Software Engineering with Platformless
Accelerate Enterprise Software Engineering with PlatformlessAccelerate Enterprise Software Engineering with Platformless
Accelerate Enterprise Software Engineering with Platformless
WSO2
 
Beyond Event Sourcing - Embracing CRUD for Wix Platform - Java.IL
Beyond Event Sourcing - Embracing CRUD for Wix Platform - Java.ILBeyond Event Sourcing - Embracing CRUD for Wix Platform - Java.IL
Beyond Event Sourcing - Embracing CRUD for Wix Platform - Java.IL
Natan Silnitsky
 
Strategies for Successful Data Migration Tools.pptx
Strategies for Successful Data Migration Tools.pptxStrategies for Successful Data Migration Tools.pptx
Strategies for Successful Data Migration Tools.pptx
varshanayak241
 
Visitor Management System in India- Vizman.app
Visitor Management System in India- Vizman.appVisitor Management System in India- Vizman.app
Visitor Management System in India- Vizman.app
NaapbooksPrivateLimi
 
Advanced Flow Concepts Every Developer Should Know
Advanced Flow Concepts Every Developer Should KnowAdvanced Flow Concepts Every Developer Should Know
Advanced Flow Concepts Every Developer Should Know
Peter Caitens
 
Explore Modern SharePoint Templates for 2024
Explore Modern SharePoint Templates for 2024Explore Modern SharePoint Templates for 2024
Explore Modern SharePoint Templates for 2024
Sharepoint Designs
 
Using IESVE for Room Loads Analysis - Australia & New Zealand
Using IESVE for Room Loads Analysis - Australia & New ZealandUsing IESVE for Room Loads Analysis - Australia & New Zealand
Using IESVE for Room Loads Analysis - Australia & New Zealand
IES VE
 
First Steps with Globus Compute Multi-User Endpoints
First Steps with Globus Compute Multi-User EndpointsFirst Steps with Globus Compute Multi-User Endpoints
First Steps with Globus Compute Multi-User Endpoints
Globus
 
Multiple Your Crypto Portfolio with the Innovative Features of Advanced Crypt...
Multiple Your Crypto Portfolio with the Innovative Features of Advanced Crypt...Multiple Your Crypto Portfolio with the Innovative Features of Advanced Crypt...
Multiple Your Crypto Portfolio with the Innovative Features of Advanced Crypt...
Hivelance Technology
 
Prosigns: Transforming Business with Tailored Technology Solutions
Prosigns: Transforming Business with Tailored Technology SolutionsProsigns: Transforming Business with Tailored Technology Solutions
Prosigns: Transforming Business with Tailored Technology Solutions
Prosigns
 

Recently uploaded (20)

Cyaniclab : Software Development Agency Portfolio.pdf
Cyaniclab : Software Development Agency Portfolio.pdfCyaniclab : Software Development Agency Portfolio.pdf
Cyaniclab : Software Development Agency Portfolio.pdf
 
Corporate Management | Session 3 of 3 | Tendenci AMS
Corporate Management | Session 3 of 3 | Tendenci AMSCorporate Management | Session 3 of 3 | Tendenci AMS
Corporate Management | Session 3 of 3 | Tendenci AMS
 
In 2015, I used to write extensions for Joomla, WordPress, phpBB3, etc and I ...
In 2015, I used to write extensions for Joomla, WordPress, phpBB3, etc and I ...In 2015, I used to write extensions for Joomla, WordPress, phpBB3, etc and I ...
In 2015, I used to write extensions for Joomla, WordPress, phpBB3, etc and I ...
 
Webinar: Salesforce Document Management 2.0 - Smarter, Faster, Better
Webinar: Salesforce Document Management 2.0 - Smarter, Faster, BetterWebinar: Salesforce Document Management 2.0 - Smarter, Faster, Better
Webinar: Salesforce Document Management 2.0 - Smarter, Faster, Better
 
Software Testing Exam imp Ques Notes.pdf
Software Testing Exam imp Ques Notes.pdfSoftware Testing Exam imp Ques Notes.pdf
Software Testing Exam imp Ques Notes.pdf
 
Globus Compute wth IRI Workflows - GlobusWorld 2024
Globus Compute wth IRI Workflows - GlobusWorld 2024Globus Compute wth IRI Workflows - GlobusWorld 2024
Globus Compute wth IRI Workflows - GlobusWorld 2024
 
How Does XfilesPro Ensure Security While Sharing Documents in Salesforce?
How Does XfilesPro Ensure Security While Sharing Documents in Salesforce?How Does XfilesPro Ensure Security While Sharing Documents in Salesforce?
How Does XfilesPro Ensure Security While Sharing Documents in Salesforce?
 
Field Employee Tracking System| MiTrack App| Best Employee Tracking Solution|...
Field Employee Tracking System| MiTrack App| Best Employee Tracking Solution|...Field Employee Tracking System| MiTrack App| Best Employee Tracking Solution|...
Field Employee Tracking System| MiTrack App| Best Employee Tracking Solution|...
 
Paketo Buildpacks : la meilleure façon de construire des images OCI? DevopsDa...
Paketo Buildpacks : la meilleure façon de construire des images OCI? DevopsDa...Paketo Buildpacks : la meilleure façon de construire des images OCI? DevopsDa...
Paketo Buildpacks : la meilleure façon de construire des images OCI? DevopsDa...
 
Vitthal Shirke Microservices Resume Montevideo
Vitthal Shirke Microservices Resume MontevideoVitthal Shirke Microservices Resume Montevideo
Vitthal Shirke Microservices Resume Montevideo
 
Accelerate Enterprise Software Engineering with Platformless
Accelerate Enterprise Software Engineering with PlatformlessAccelerate Enterprise Software Engineering with Platformless
Accelerate Enterprise Software Engineering with Platformless
 
Beyond Event Sourcing - Embracing CRUD for Wix Platform - Java.IL
Beyond Event Sourcing - Embracing CRUD for Wix Platform - Java.ILBeyond Event Sourcing - Embracing CRUD for Wix Platform - Java.IL
Beyond Event Sourcing - Embracing CRUD for Wix Platform - Java.IL
 
Strategies for Successful Data Migration Tools.pptx
Strategies for Successful Data Migration Tools.pptxStrategies for Successful Data Migration Tools.pptx
Strategies for Successful Data Migration Tools.pptx
 
Visitor Management System in India- Vizman.app
Visitor Management System in India- Vizman.appVisitor Management System in India- Vizman.app
Visitor Management System in India- Vizman.app
 
Advanced Flow Concepts Every Developer Should Know
Advanced Flow Concepts Every Developer Should KnowAdvanced Flow Concepts Every Developer Should Know
Advanced Flow Concepts Every Developer Should Know
 
Explore Modern SharePoint Templates for 2024
Explore Modern SharePoint Templates for 2024Explore Modern SharePoint Templates for 2024
Explore Modern SharePoint Templates for 2024
 
Using IESVE for Room Loads Analysis - Australia & New Zealand
Using IESVE for Room Loads Analysis - Australia & New ZealandUsing IESVE for Room Loads Analysis - Australia & New Zealand
Using IESVE for Room Loads Analysis - Australia & New Zealand
 
First Steps with Globus Compute Multi-User Endpoints
First Steps with Globus Compute Multi-User EndpointsFirst Steps with Globus Compute Multi-User Endpoints
First Steps with Globus Compute Multi-User Endpoints
 
Multiple Your Crypto Portfolio with the Innovative Features of Advanced Crypt...
Multiple Your Crypto Portfolio with the Innovative Features of Advanced Crypt...Multiple Your Crypto Portfolio with the Innovative Features of Advanced Crypt...
Multiple Your Crypto Portfolio with the Innovative Features of Advanced Crypt...
 
Prosigns: Transforming Business with Tailored Technology Solutions
Prosigns: Transforming Business with Tailored Technology SolutionsProsigns: Transforming Business with Tailored Technology Solutions
Prosigns: Transforming Business with Tailored Technology Solutions
 

Near field communication (NFC) in android

  • 1. Presenter: Jitendra Singh, Mindfire Solutions Date: 12/feb/2015 NEAR FIELD COMMUNICATION
  • 2. Presenter: Jitendra Singh, Mindfire Solutions About Me Jitendra Singh Senior Android Developer Mindfire Solutions Skills: AndroidApplicationDevelopment, Blackberry,PhoneGap, Struts, Hibernate, Servlets, JSP, J2EE, Apache, CoreJava, SQL, SQLite, SQLServer, J2ME, JasperReport,NFC Skype: mfsi_jitendra.singh Email:jitendra.singh@mindfiresolutions.com
  • 3. Presenter: Jitendra Singh, Mindfire Solutions AGENDA 1) What is NFC? 2) Classes available in Android to use NFC 3) NDEF Structure 4) Tag Intent Dispatch System 5) NFC Intents 6) Filtering for NFC Intents 7) How to check whether a device supports NFC or not 8) NFC Tag Reading/Writing 9) Android Application Record
  • 4. Presenter: Jitendra Singh, Mindfire Solutions 1) NFC is a high frequency short-range wireless communication technology that enables the exchange of data between devices over about a 10 cm distance. 2) Near-field communication uses electromagnetic induction between two loop antennas located within each others near field. 3) Android-powered devices with NFC mainly support two main modes of operation: a) Reader/writer mode, allowing the NFC device to read and/or write passive NFC tags and stickers. b) P2P mode, allowing the NFC device to exchange data with other NFC peers; this operation mode is used by Android Beam.
  • 5. Presenter: Jitendra Singh, Mindfire Solutions 1) NFC-related APIs in Android are introduced to users starting from API level 9. 2) Currently, there are two packages for NFC application development in the Android platform. a) The first is the main package that you will use is android.nfc, which includes necessary classes to enable applications to read and write NDEF messages in/to NFC tags. b) The second is the android.nfc.tech package, which includes necessary classes to provide access to different tag technologies such as MIFARE Classic, NfcA , NfcV, and so on. Continued........
  • 6. Presenter: Jitendra Singh, Mindfire Solutions CLASS NAME DESCRIPTION Tag Represents the discovered NFC tag NfcAdapter Represents the NFC adapter of the mobile phone NfcManager Obtains an instance of the NFC adapter NdefMessage Represents an NDEF message NdefRecord Represents an NDEF record Classes available in the android.nfc package are as follows
  • 7. Presenter: Jitendra Singh, Mindfire Solutions 1) All the messages that are transferred between two android devices or between devices or a NFC tag are mostly transferred in NDEF format. 2) NDEF is a binary format structured in messages, each of which can contain several records. 3) Each record is made up of a header, which contains meta data about the record, such as the record type,length, and so forth, and the payload, which contains the content of the message. Continued........
  • 8. Presenter: Jitendra Singh, Mindfire Solutions 4) An NDEF record consists of a type name format (TNF), payload type, payload identifier, and the payload. 5) The TNF tells you how to interpret the payload type. The payload type is an NFC-specific type, MIME mediatype, or URI that tells you how to interpret the payload. 6) Another way to think about this is that the TNF is the metadata about the payload type, and the payload type is the metadata about the payload.
  • 9. Presenter: Jitendra Singh, Mindfire Solutions 1) The tag intent dispatch system is used to launch applications when the predefined tags or NDEF data are identified in tags. 2) In short, you scan to an NFC tag, and if any application is registered to handle the tag, then the registered application launches. 3) If more than one application is registered to handle the tag, a pop-up to select the application (Activity Chooser) is displayed. 4)When an NFC tag is discovered in proximity, the type and payload data in the tag will be encapsulated to intent, and the tag intent dispatch system in Android will run the corresponding application that can handle the tag. Continued........
  • 10. Presenter: Jitendra Singh, Mindfire Solutions ACTION_NDEF_DISCOVERED The tag dispatch system uses the TNF and Type fields to try to map a known MIME type or URI to the NDEF message. If successful, it encapsulates that information inside of a ACTION_NDEF_DISCOVERED intent along with the actual payload. This intent is used to start an Activity when a tag that contains an NDEF payload is scanned and is of a recognized type. This is the highest priority intent, and the tag dispatch system tries to start an Activity with this intent before any other intent, whenever possible. ACTION_TECH_DISCOVERED If the tag dispatch system cannot determine the Type of data based on the first NDEF record. This happens when the NDEF data cannot be mapped to a MIME type or URI. In such cases, a Tag object that has information about the tag's technologies and the payload are encapsulated inside of a ACTION_TECH_DISCOVERED intent. ACTION_TAG_DISCOVERED This intent has the lowest priority. If no activities in the device can handle the corresponding above intents, then ACTION_TAG_DISCOVERED is created. Continued........
  • 11. Presenter: Jitendra Singh, Mindfire Solutions 1)The tag dispatch system works as follows: ➤ If the payload contains NDEF data: 1. Try to start an activity with the ACTION_NDEF_DISCOVERED intent. 2. If no activities filter for the discovered NDEF data, try to start an activity with the the ACTION_TECH_DISCOVERED intent. ➤ If the payload does not contain NDEF data but is of a known tag technology: 1. Try to start an activity with the ACTION_TECH_DISCOVERED intent. 2. If no activities filter for that intent, try to start an activity with the ACTION_TAG_DISCOVERED intent. There are 3 types of NFC intents viz : 1) ACTION_NDEF_DISCOVERED 2) ACTION_TECH_DISCOVERED 3) ACTION_TAG_DISCOVERED
  • 12. Presenter: Jitendra Singh, Mindfire Solutions
  • 13. Presenter: Jitendra Singh, Mindfire Solutions Filtering for ACTION_NDEF_DISCOVERED This concept would be best explained by examples Example 1 <intent-filter> <action android:name="android.nfc.action.NDEF_DISCOVERED"/> <category android:name="android.intent.category.DEFAULT"/> <data android:mimeType="text/plain" /> </intent-filter> Example 2 <intent-filter> <action android:name="android.nfc.action.NDEF_DISCOVERED"/> <category android:name="android.intent.category.DEFAULT"/> <data android:scheme="http" android:host="developer.android.com" android:pathPrefix="/index.html" /> </intent-filter> Continued........
  • 14. Presenter: Jitendra Singh, Mindfire Solutions Filtering for ACTION_TECH_DISCOVERED If your activity filters for the ACTION_TECH_DISCOVERED intent, you must create an XML resource file that specifies the technologies that your activity supports within a tech-list set. Your activity is considered a match if a tech-list set is a subset of the technologies that are supported by the tag. Example <resources xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2"> <tech-list> <tech>android.nfc.tech.IsoDep</tech> <tech>android.nfc.tech.NfcA</tech> <tech>android.nfc.tech.NfcB</tech> <tech>android.nfc.tech.NfcF</tech> <tech>android.nfc.tech.NfcV</tech> <tech>android.nfc.tech.Ndef</tech> <tech>android.nfc.tech.NdefFormatable</tech> <tech>android.nfc.tech.MifareClassic</tech> <tech>android.nfc.tech.MifareUltralight</tech> </tech-list> </resources> In your AndroidManifest.xml file, specify the resource file that you just created in the <meta-data> element inside the <activity> element like in the following example: <activity> <intent-filter> <action android:name="android.nfc.action.TECH_DISCOVERED"/> </intent-filter> <meta-data android:name="android.nfc.action.TECH_DISCOVERED" android:resource="@xml/nfc_tech_filter" /> </activity>
  • 15. Presenter: Jitendra Singh, Mindfire Solutions Filtering for ACTION_TECH_DISCOVERED To filter for ACTION_TAG_DISCOVERED use the following intent filter: <intent-filter> <action android:name="android.nfc.action.TAG_DISCOVERED"/> </intent-filter>
  • 16. Presenter: Jitendra Singh, Mindfire Solutions How to check whether a device supports NFC or not The NFCAdapter class in the android.nfc package represents the NFC adapter for the local machine. Checking if the NFCAdapter is available is the first thing to do in an NFC application. Here is the code to create the necessary NfcAdapter: private NfcAdapter myNfcAdapter; private TextView myText; @Override public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.main); myNfcAdapter = NfcAdapter.getDefaultAdapter(this); if (myNfcAdapter == null) { myText.setText("NFC is not available for the device!!!"); } else { myText.setText("NFC is available for the device"); } }
  • 17. Presenter: Jitendra Singh, Mindfire Solutions How to check whether a device supports NFC or not The NFCAdapter class in the android.nfc package represents the NFC adapter for the device. Checking if the NFCAdapter is available is the first thing to do in an NFC application. Here is the code to create the necessary NfcAdapter: private NfcAdapter myNfcAdapter; private TextView myText; @Override public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.main); myNfcAdapter = NfcAdapter.getDefaultAdapter(this); if (myNfcAdapter == null) { myText.setText("NFC is not available for the device!!!"); } else { myText.setText("NFC is available for the device"); } }
  • 18. Presenter: Jitendra Singh, Mindfire Solutions 8) NFC Tag Writing In the following code, the basic write operation to a tag is shown, in which the discovered tag has NDEF payload. if (NfcAdapter.ACTION_NDEF_DISCOVERED.equals(getIntent().getAction())) { Tag detectedTag = getIntent().getParcelableExtra(NfcAdapter.EXTRA_TAG); Ndef ndef = Ndef.get(detectedTag); //If ndef object is null it means that the tag is not NDEF-formatted and you cannot use Ndef class. //If it is already NDEF-formatted, you will use Ndef class; otherwise, you need to use NdefFormatable //class with following code If(ndef == null) NdefFormatable ndefFormat = NdefFormatable.get(detectedTag); //If ndefFormat object is also null then it means that the tag does not support the NDEF //and we need to break the operation. ndef.connect(); ndef.writeNdefMessage(message); ndef.close(); }
  • 19. Presenter: Jitendra Singh, Mindfire Solutions NFC Tag Reading Tag detectedTag = getIntent().getParcelableExtra(NfcAdapter.EXTRA_TAG); NdefMessage[] messages = getNdefMessages(getIntent()); NdefMessage[] getNdefMessages(Intent intent) { NdefMessage[] message = null; if (NfcAdapter.ACTION_NDEF_DISCOVERED.equals(intent.getAction())) { Parcelable[] rawMessages =intent.getParcelableArrayExtraNfcAdapter.EXTRA_NDEF_MESSAGES); if (rawMessages != null) { message = new NdefMessage[rawMessages.length]; for (int i = 0; i < rawMessages.length; i++) { message[i] = (NdefMessage) rawMessages[i]; } } else { Log.d("", "No messages inside tag"); } } else { Log.d("", "Unknown intent."); finish(); } return message; }
  • 20. Presenter: Jitendra Singh, Mindfire Solutions Android Application Record 1) Android Application Record (AAR) is introduced in API level 14 and is a very powerful property of Android NFC. 2) The main objective of AAR is to start the application when an NFC tag is scanned. 3) Despite the fact that the manifest file gives this property to NFC, AAR strengthens the property because more than one application may have been registered for, and may filter, the same intents on a mobile phone. 4) An AAR is the package name of an application. You need to insert the AAR record to an NDEF message, similarly to the way it is done with an NDEF record. When an NFC tag is scanned, Android searches the entire NDEF message for AAR. If it fi nds an AAR in any of the NDEF records, it starts the corresponding application. If the application is not installed on the device, Google Play is launched automatically to download the corresponding application.
  • 21. Police Scanner for Android - Locate and listen to Police dispatch frequencies. An application/tool for the Android, which can locate police dispatch frequencies of various countries along with cities, counties, and channels, was something that one of our clients wanted to develop. Their objective was to help people (users of the app) stay informed about any major disaster (happened/forthcoming) by listening to emergency broadcast streams in real time. Their requirement revealed that they wanted the app to stream the media buffer of a radio channel over internet and play it with native media player. He also required that all users of the app would be automatically updated to the new list whenever there is a new entry to the database that contained the list of countries, cities or station. Their requirements were stringent and needed someone who can understand their vision and meet their expectations. Click here for details >> Sample Case Study www.mindfiresolutions.com
  • 22.