I am working on an NFC-application. To start my app, I am using a NDEF-tag with an AAR NDEF Record inside.
This works fine. But now I want to read the tag content with the app directly. How can I do this?
(It already works, when I remove the tag from the phone and touch it again, but I want to eliminate this step.)
Manifest:
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="nfctagscanner.mobileapps.lt.nfctagscanner" >
<uses-feature android:name="android.hardware.nfc" android:required="true"/>
<uses-permission android:name="android.permission.NFC" />
<application
android:allowBackup="true"
android:icon="@drawable/ic_launcher"
android:label="@string/app_name"
android:theme="@style/AppTheme" >
<activity
android:name=".MainActivity"
android:label="@string/app_name" >
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
<activity
android:name=".NFCScanActivity"
android:label="@string/app_name" >
<intent-filter>
<action android:name="android.nfc.action.NDEF_DISCOVERED" />
<category android:name="android.intent.category.DEFAULT" />
<data android:scheme="nfctagscanner.mobileapps.lt.nfctagscanner" android:host="ext"
android:pathPrefix="/android.com:pkg" />
</intent-filter>
</activity>
</application>
</manifest>
And I just want to get NDEF_DISCOVERED intent. But I always get action.MAIN/category.LAUNCHER Intent with my debugger.
Any help will be appreciated. I was doing my work based on this: Android / NFC: Get Tag in onCreate() without new Intent