1

I am trying to develop an Android application that connects to a Sony Felica NFC chip and performs P2P read/write operations. While in debugging mode I can see that the phone establishes a connection to the device. When the phone is in the NFC device's range it repeatedly prints the following to the log:

DEBUG/NFC JNI(194): Discovered P2P Target

DEBUG/NfcService(194): LLCP Activation message

However, it does not start my application.

In my Manifest file I set the application to run when a tag is discovered

<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
      package="com.tec.example"
      android:versionCode="1"
      android:versionName="1.0">
    <uses-sdk android:minSdkVersion="10" />

    <uses-permission android:name="android.permission.NFC" />
    <uses-permission android:name="android.permission.INTERNET" />
    <application android:icon="@drawable/icon" android:label="@string/app_name">
        <activity android:name=".NFCTestActivity"
                  android:label="@string/app_name">
            <intent-filter>
                <action android:name="android.nfc.action.TAG_DISCOVERED"/>
                <category android:name="android.intent.category.DEFAULT"/>
            </intent-filter>
        </activity>
    </application>
    <uses-sdk android:minSdkVersion="10"/>
    <uses-feature android:name="android.hardware.nfc" android:required="true"/>
</manifest>

Any idea what I am missing? Any suggestions would be greatly appreciated.

NFC guy
  • 10,151
  • 3
  • 27
  • 58

1 Answers1

1
<intent-filter>
            <action android:name="android.nfc.action.TAG_DISCOVERED"/>
            <category android:name="android.intent.category.DEFAULT"/>
        </intent-filter>

change to :

<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" />

create a xml named nfc_tech_filter.xml,add content:

<resources xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
<tech-list>
   <tech>android.nfc.tech.NfcF</tech>
</tech-list>

colin
  • 31
  • 2
  • Thank you for your answer but it turned out that the code was correct. There was a problem with the microcontroller attached to the NFC chip. – Luke Waldron May 25 '12 at 12:10