Showing posts with label nfc p2p. Show all posts
Showing posts with label nfc p2p. Show all posts

Thursday, September 10, 2015

Android NFC and Android Beam Tutorial


ABOUT ANDROID NFC:

Below are the few important things you need to know before starting development for P2P communication using Android based NFC devices.

 NFC allows sharing of files/data between devices using wireless technology. Required distance is cm  or less to initiate connection. Maximum distance can be 10 cm.

 Data transmission rate 424 kbits/s.

 Peer to peer communication mode of NFC is known as Android Beam.

Android Beam only works when the application sending the data is running in the foreground and the device receiving the data is unlocked.

Android Beam has two API’s.

NDEF Transfer API (for small data like URL or contact)
File Transfer API (for large data like videos)

User can exchange URL’s, contacts, images, videos.

Both devices can recognize each other and can transmit data simultaneously.

NFC P2P mode communication is available since API level 14 (since 4.0, Ice Cream Sandwich).

Device identifications must be implemented in application protocols, when needed.

In Android Beam, it has two options NFCIP-1 and LLCP.

In NFCIP mode, before starting communication devices can be defined, meaning which device will start communication (initiate) and which device will respond (reply). However in LLCP mode after initial handshake, decision is made by application.

The Android Beam animation is normally is shown when two NFC-capable devices come into range.

If application has to send large data it can hand over connection to Wi-Fi/Bluetooth. This results in faster transfer speeds between devices.
For beaming of specific content, an app is allowed to control the content being sent when adding Android Beam support. If the app does not specify data, beaming the app will open it on the receiving device. If the receiving device does not have the app, it will open the application page in the Play Store.

References:
http://stackoverflow.com/questions/tagged/nfc-p2p
http://open-nfc.org/wp/home/features/
http://code.tutsplus.com/tutorials/sharing-files-with-nfc-on-android--cms-22501
http://www.nfc.cc/2011/12/28/development-android-beam-and-nfc-peer-2-peer/


Kotlin Android MVP Dagger 2 Retrofit Tutorial

http://developine.com/building-android-mvp-app-in-kotlin-using-dagger-retrofit/