 Hello. I am audible. So, I am going to talk about NFC, Near Field Communications and what are the things we can do with it. So, first of all, a little bit of details about NFC. Like, NFC is Near Field Communications. It is a very short wireless signal. It uses modulated electrical waves for transferring our data. And, like, I think you all have experienced NFC right outside all the sponsors in the check-in desks. You can just tap your card using NFC counters. So, that's one of the places where you are able to use NFC. It's being used in payments, obviously, where everybody is using it. It's used in social media check-ins, hotel check-ins, and a lot of other things. So, I'll quickly run through a bit of history first. So, here's how NFC has come, where it is today. 2004, Nokia Phillips and Sony started working on it. 2006, the first phone with NFC came up. And, like you see, in 2011, Google, you know, at their I.O., they presented something about NFC, and that's when really NFC started coming up big on Android. And, finally, Apple is also in the bandwagon from 2014. So, I will first mention what are the positives we have about NFC. So, as you can see, first of all, pairing is not required. So, this is something interesting about a communication channel, where I guess you all know about there is Bluetooth or Wi-Fi, where you need some kind of authentication. You need a user input for pairing the devices. NFC is one where inherently that pairing is not needed because of the proximity. You know that they are physically close to each other. It's versatile. You can have NFC readers or NFC cards in various formats. You can have NFC readers stand alone on a laptop, on a mobile device, on a tablet. Minimal power usage because the NFC, generally, when it is not being used, it's not requiring any energy at all. So, again, another positive. User interaction, like I said, you don't need to interact a lot. I mean, there are a lot of ticketing facilities and hotel check-ins, where all you need to do is actually tap. You don't need to interact with the screen on your device at all. So, all these things leads to a very seamless procedure. Obviously, if there are pros, there will be some cons. So, one of the biggest cons of NFC is it has compatibility issues because NFC, where it is today, has come via various different companies, funding it, sponsoring it. So, at different points of time, different people have led the development. So, there is RFID, there are a lot of different protocols in NFC and not a lot of things are compatible with each other. The speed is very slow. For a practical usage, like if you do device-to-device data transfer or NFC, we can practically get around 10 kbps data transfer speed, which is comparable to something like Bluetooth or Wi-Fi is very speed. Also, the network channel itself is just a raw channel where you are sending bytes on it. So, any kind of encapsulation you have to do for security needs that you want to do, that the communication channel itself is not going to provide to you. So, that's something you have to add at the developer's level where you are going to make creative implementation. And due to the same reason, there is no error control or flow control on it. So, even your simple acknowledgement commands and the not-acknowledged commands that also you have to device out yourself because the channel is just a raw stream of bytes. So, when we talk about NFC on Android, here are the things that we can actually do with NFC on Android as of now. We can read NFC tags or cards, like a lot of you will have credit cards or like I'm from Delhi, so our metro cards are also NFC enabled. So, all these things, your Android device can read these kind of cards, that's one facility. You can use your mobile as a wallet. Most of the phones have an inbuilt secure element, so in India, Google wallet is not all that prevalent but outside, a lot of people use Google wallet and it's really widespread. We can beam data from one mobile to another. I think that's something that a lot of you might have tried already. You tap your mobile for sending something like contacts, I feel it is very helpful. You can just tap your mobile to friends mobile, beam the contact to him. Then, two of the more interesting things we have recently after Android KitKat is you can emulate a card. Basically, your device can work as a card, like if you have the kind of things I mentioned, library cards or metro cards or credit cards, these are all NFC tags. So, your device can work as such a card, which is a completely software based emulation. So, we call it host based card emulation. And regarding that, we also have a reader mode which also has been introduced in Android KitKat. So, this is basically a diagram that you can have a quick look. This is how the NFC software is implemented in Android. There is the Java layer and then there is the libNFC controller which is at the C layer. And your apps are directly conversing basically with the NFC adapter layer. So, first of all, let's talk about how you discover tags. So, basically in your Android device, these are the three intents that you can use as intent filters. So, if your NFC tag has a properly formatted NDF message on it, so this is the first intent that you can catch. In case this intent you are not catching, the action NDF discovered, or if your card does not have a properly formatted NDF message, just a couple of slides later, I'm going to show what the NDF message looks like. It falls back to this. And finally, if your card does not have any data or the data is not properly transferred, you at least get this intent which is a tag discovered. At least you know that you have tapped into something, you don't get any other data other than that. So, these are the three intents that you can use. Is a flow diagram that you can see like, if there is a NDF formatted tag, NDF discovered and it goes finally to the activity if it is an unmapped tag, then via tech discovered it can go and finally, none of these are caught, then you can get a tag discovered command and you can move on to your activity and start using the NFC data. A bit of example code which shows this is a very simple code that you can create this kind of an app like this and if somebody else taps onto your mobile, they will go into another website. So, if you have a NFC card somewhere, the NFC tag somewhere and that app is installed, you tap onto it, that app opens and that app takes you to the developer.android.com website for example. This is the format of the NDF message like I was saying. So, an NDF message contains records and each record has a header and a payload. So, if it is formatted in this manner, then it is the easiest way to work on Android using an NDF format. Now, we will move on to beaming, the second way that this was introduced in Android ICS 4.0. So, beaming as we all know, you can tap devices, we can send data from one to another. This uses SNEP which is simple NDF exchange protocol. Basically, your data is sent in format of an NDF message. The only thing is this is unidirectional in nature. When you tap, during one tap, you just can send data from either from A to B or from B to A. If you want to send any data back, you have to remove the devices, tap them back again. In 4.1, something very interesting happened. Layer was added, what it does is you cannot send a lot of data at 10 kbps period. You cannot send images, videos, or audio, stuff like that. So, what Android provided was, if the data is bigger than a certain set limit, which is usually 64 kbps, so what it does is it pairs the two devices via a secondary channel, which is like, say, Bluetooth for Android Beam. Samsung has an S Beam protocol which uses Wi-Fi Direct. As a developer, we can implement some other secondary channel, which is faster than NFC. So, the pairing data is shared via NFC. The devices get paired and the actual data gets transferred via the secondary channel. Then we come to the final thing, what NFC very recently has started allowing us on Android is the host-based card emulation. So, this was coined by SimplyTap in 2011 and Synogen Mod and SimplyTap had a partnership and they tried to bring host-based card emulation. Finally, in Android 4.4, Google has brought official host-based card emulation. So, you know, I will just show what the difference is. So, this is what happens in a device that is older than, say, Android KitKat which did not have host-based card emulation on it. So, when your NFC reader, that white part is your device, this is your reader, when it tries to read, your data is directly sent to the secure element. So, your device always has that same ID, which we get back from the secure element. There isn't a lot of documentation about the secure element. So, you can use your mobile only as one kind of a card, like your Google Valid card as it had been in practice. What host-based card emulation does is it allows you to, it allows your device to act as many different cards by different applications. So, you are not always forcefully redirected to use the secure element present in your phone. Your app can behave as a card. It can have its own security protocols. It can have its own ID. So, as you can see, there is, I think this one visible, it says select AIDX and that says select AIDY. So, depending on AID, AID is basically the ID that your reader sends out, what kind of card it wants to read. Depending on that, your NFC controller will either send data from the emulating app or it will use the secure element. So, here is a kind of an example system that using software-based HCE, what we can do is the security, we can move to the bank and use its own security layer in the cloud and not require to use the secure element that's present on your device. So, you can use the same device as a Visa card and also as a Mastercard card because they will all have their security implementation, their AID implementation, all of that, the software will handle it. So, in host-based card emulation, the data is transferred not via NDEF messages, instead each packet is called an APDU. An APDU is at least 256 byte in size, which is always. In some certain NFC chips, they support something that's called an extended length APDU, which is 64 KB in size. As a rule of thumb, you can say the NXP522 or the 532 chips made by NXP semiconductor, they don't have this extended length APDU supported as of now. Other than that, most other NFC chips do support 64 KB size packets. So, these are some of the example commands that you can send. The reader can send this kind of commands, select AID or put AID. So, using these commands, it can get the data. So, I'll just show how this works. So, for example, this is your reader device in your card device. When they come close to each other, on-tag discovered callback is generated on your reader. When you get the on-tag discovered callback, inside the implementation of your on-tag discovered, you will have to send the select AID command. So, when you do the select AID command, your card will, the device that is behaving as a card will reply back with a certain ID, which you have set already inside that app. And then after that, you can start doing a lot of get data and put data calls. So, get data is going to fetch data. With put data, you can change the data that's already in the card. And all of this, the card itself on the reader device is just a software stack. So, you can have a card with unlimited amount of data. And whatever you want to change on it. So, here, something interesting that happens is, host-based card emulation can also allow something that was not possible earlier. It can allow two-way sustained communication. How you can do it is something, a little hacky kind of implementation. When you do get data, you get something back. And it has got a status word, which says that the data was successfully sent. It's an okay status word. So, what you can do is, you can just ignore that fact. And you can ask or keep asking for more data. As long as the devices are close to each other, you can keep on running the get data commands. And you can keep on getting data. So, that way, if your data is larger than 64 kb in size, you can run it through an iterator and fetch the whole data. Again, you can run another iterator for using your put data calls. And you can send data to the other device. So, in this method, what we can do is actually you're not using the devices as a card or a reader. You're just using as two devices that are talking to each other. The channel will obviously be half-duplex in nature because at a time, only data can go or come. But when the whole communication is finished, you have actually been successfully done a two-way communication. You have sent data, you have got data. So, finally, this is just a diagram I wanted to show when I mentioned that there is a compatibility problem in NFC. As you can see, the top layer are some of the implementations. The NDEF is a protocol. SNEP and LLC are the layers by which these are implemented. The green boxes are the types of cards that we have today. And finally, the purple boxes at the bottom, they are showing the kind of hardware that we have today. So, you see, it's a very fragmented system. But still, we can make our way through it and achieve something out of it. These are the current users that NFC is used in. A lot of people think that NFC is used only in payments. But NFC is used like this smartwatch. So, I tap it to my phone and it gets paired. These kind of things are used. Social network check-ins, ticketing, healthcare, automation, a lot of things are being done. And there are a lot of new fields also coming up, which are using NFC. So, I'll talk about some of the limitations also. So, it's a very nascent stage in industrial application. I mean, I am yet to see somewhere where NFC is using really widespread. I mean, other than tapping your ID card for your attendance at office or something like payments, nothing else is becoming up. So, let's hope something happens. Secondly, again, due to the fragmentation at the hardware, the LibNFC library is very fragmented. Different devices have different implementations. And like I mentioned, some of the NXP semi-conductor chips, they don't support the extended APDU. They don't support host-based card emulation. These are the problems. So, with that, I'll be ending it. I think I have a typo. Thank you.