Thursday, February 16, 2012

[android-developers] handled the android.nfc.action.TRANSACTION_DETECTED event

I am struggling to handle android.nfc.action.TRANSACTION_DETECTED
event. The device is NFC and also contains secure element which
supports SWP to the UICC.
I have registered the following BroadCast receiver in my app.
public class TransactionReceiver extends BroadcastReceiver {

private String TAG = "TransactionReceiver";

@Override
public void onReceive(Context context, Intent intent) {
Log.d(TAG, "Transaction performed ...");

}

}

Below is my manifest.
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.mycompany.android.nfc.uicc.test"
android:versionCode="1"
android:versionName="1.0" >

<uses-sdk android:minSdkVersion="10" />

<application
android:icon="@drawable/ic_launcher"
android:label="@string/app_name" >
<activity
android:name=".AndroidUiccTestActivity"
android:label="@string/app_name" >
<intent-filter>
<action android:name="android.intent.action.MAIN" />

<category
android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>

<receiver
android:name=".TransactionReceiver"
android:enabled="true" >
<intent-filter>
<action
android:name="android.nfc.action.TRANSACTION_DETECTED" />
</intent-filter>
</receiver>
</application>

<uses-permission android:name="android.permission.NFC" />
</manifest>

I am not receiving the broadcast event when I present the device on
the contactless reader. Could anyone point out if I am missing
anything or if following the right route.
The android.nfc.action.TRANSACTION_DETECTED is hidden from the google
api but can found at http://www.androidjavadoc.com/2.3/android/nfc/NfcAdapter.html#ACTION_TRANSACTION_DETECTED.

thanks in advance

--
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscribe@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en

No comments:

Post a Comment