V
V
Volodymyr Palamar2020-11-03 23:01:01
Java
Volodymyr Palamar, 2020-11-03 23:01:01

How to read ISODep NFC tag on Android?

Good evening
Tell me how to do this please
Activity with IntentFilter is registered in the manifest

here

AndroidManifest.xml
<activity
      android:theme="@style/NoA"
      android:noHistory="true"
      android:excludeFromRecents="true"
      android:showWhenLocked="true"
      android:turnScreenOn="true"
      android:name=".NFCDetectActivity">
      <intent-filter>
        <action android:name="android.nfc.action.TECH_DISCOVERED"/>
        <category android:name="android.intent.category.DEFAULT" />

      </intent-filter>
      <meta-data
        android:name="android.nfc.action.TECH_DISCOVERED"
        android:resource="@xml/nfc_filter"/>
    </activity>

nfc_filter.xml
<?xml version="1.0" encoding="utf-8"?>
<!-- This file is used as part of the filter for incoming NFC TECH_DISCOVERED intents. -->
<resources xmlns:android="http://schemas.android.com/apk/res/android">
    <tech-list>
        <tech>android.nfc.tech.IsoDep</tech>
    </tech-list>
</resources>


The logic of the program should be like this
  1. Getting data from NFC
  2. We write them to the Database

I'm stuck at the moment of receiving data from NFC
Because I did not find proper documentation.
Maybe someone came across? Or do you know where to get examples?

There is an article on Habré, but it doesn’t come to me onNewIntentonlyonCreate

Answer the question

In order to leave comments, you need to log in

1 answer(s)
V
Volodymyr Palamar, 2020-11-03
@GORNOSTAY25

https://github.com/nadam/nfc-reader/blob/master/sr...
https://github.com/pro100svitlo/Credit-Card-NFC-Reader
https://habr.com/en/post /367229/

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question