Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6385431
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 25, 20262026-05-25T02:53:56+00:00 2026-05-25T02:53:56+00:00

I’ve been working for a couple of months with a NFC based Android Application.

  • 0

I’ve been working for a couple of months with a NFC based Android Application. This one can read&write NFC Tags as the Android NFC docs explain. (pretty good docs about NFC api). I’ve been playing with the NFCDemo app when I need some example to follow.

Here is my current XML Manifest:

<manifest xmlns:android="http://schemas.android.com/apk/res/android"
      package="com.my.package"
      android:versionCode="1"
      android:versionName="1.0.0">
    <uses-sdk android:minSdkVersion="10" />
    <uses-feature android:name="android.hardware.nfc" android:required="true" />  
    <uses-permission android:name="android.permission.NFC" />
    <uses-permission android:name="android.permission.INTERNET" />
   <application android:icon="@drawable/icon" 
                android:label="@string/app_name"
                android:launchMode="singleTask">
        <activity android:name=".MainActivity"
                  android:label="@string/app_name"
                  android:screenOrientation="portrait">
            <!-- the following actions and categories let the App be in Android Action Chooser and also Scan Tags when the app si running -->      
            <intent-filter>
                <action android:name="android.intent.action.MAIN" /> <!-- Main application -->
                <category android:name="android.intent.category.LAUNCHER" /><!-- Logo Display in App List-->
            </intent-filter>

            <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" />
            <intent-filter>
                <action android:name="android.nfc.action.TAG_DISCOVERED"/>
            </intent-filter>

        </activity>
    <activity  android:name=".RouteActivity">
            <intent-filter>
                <action android:name="android.nfc.action.NDEF_DISCOVERED"/>
                <category android:name="android.intent.category.DEFAULT"/>
                <data android:host="www.my.custom.tag.com" android:scheme="http" />
            </intent-filter>
    </activity>
 </application>
</manifest>

Here is the tech_filter file definition:

<resources xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
    <tech-list>
        <tech>android.nfc.tech.MifareUltralight</tech>
        <tech>android.nfc.tech.Ndef</tech>
        <tech>android.nfc.tech.NfcA</tech>
    </tech-list>
    <tech-list>
        <tech>android.nfc.tech.MifareClassic</tech>
        <tech>android.nfc.tech.Ndef</tech>
        <tech>android.nfc.tech.NfcA</tech>
    </tech-list>
    <tech-list>
          <tech>android.nfc.tech.MifareUltralight</tech> 
          <tech>android.nfc.tech.NdefFormatable</tech> 
          <tech>android.nfc.tech.NfcA</tech> 
    </tech-list>
    <tech-list>
          <tech>android.nfc.tech.Ndef</tech> 
          <tech>android.nfc.tech.NfcV</tech> 
    </tech-list>
    <tech-list>
        <tech>android.nfc.tech.NfcF</tech>
    </tech-list>
</resources>

I had also configured the Foreground Dispatch System:

public void setUpForegroundDispatchSystem(Activity activity) {
        this.nfcAdapter = NfcAdapter.getDefaultAdapter(activity);

        this.pendingIntent = PendingIntent.getActivity(activity, 0, new Intent(activity, activity.getClass()).addFlags(Intent.FLAG_ACTIVITY_SINGLE_TOP), 0);

        IntentFilter ndef = new IntentFilter(NfcAdapter.ACTION_NDEF_DISCOVERED);
        this.intentFiltersArray = new IntentFilter[] { ndef };
        this.techListsArray = new String[][] {
                new String[] { MifareUltralight.class.getName(),
                        Ndef.class.getName(), NfcA.class.getName() },
                new String[] { MifareClassic.class.getName(),
                        Ndef.class.getName(), NfcA.class.getName() },
                new String[] { MifareUltralight.class.getName(),
                        NdefFormatable.class.getName(), NfcA.class.getName() },
                new String[] { Ndef.class.getName(), NfcV.class.getName() },
                new String[] { NfcF.class.getName() }};
    }

But now, I want to add p2p capabilities to my Android application. So when I push a Tag to other phone with my app already installed I want the Android Action chooser being fired with my app. And also if my app is already running, it must handle a p2p request.
I could push p2p Tags correctly, using the Android docs about it, but the only app that can handle this Tags is the Google’s one (Tags application that becomes with Nexus S), despite of I’ve several NFC apps already installed in my phone. Any ideas? Any useful documentation about it?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-25T02:53:57+00:00Added an answer on May 25, 2026 at 2:53 am

    Already solved. If you need to handle P2P NFC requests in your Android App. You need to handle the android.nfc.action.TAG_DISCOVERED nfc type.

    So your manifest must include (note that the category is DEFAULT):

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

    This will display the Android Action Chooser and your app will be listed here. If you wanna also add foreground capabilities, you need to edit the foreground dispatch system in this way (look at the original one, wrote above):

    IntentFilter ndef = new IntentFilter(NfcAdapter.ACTION_NDEF_DISCOVERED);
    IntentFilter tag = new IntentFilter(NfcAdapter.ACTION_TAG_DISCOVERED);
    this.intentFiltersArray = new IntentFilter[] { ndef , tag };
    

    And that’s all.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm parsing an RSS feed that has an &#8217; in it. SimpleXML turns this
I have a string like this: La Torre Eiffel paragonata all&#8217;Everest What PHP function
I have a jquery bug and I've been looking for hours now, I can't
link Im having trouble converting the html entites into html characters, (&# 8217;) i
Does anyone know how can I replace this 2 symbol below from the string
For some reason, after submitting a string like this Jack’s Spindle from a text
I'm new to using the Perl treebuilder module for HTML parsing and can't figure
this is what i have right now Drawing an RSS feed into the php,
I have this code: - (void)parser:(NSXMLParser *)parser foundCDATA:(NSData *)CDATABlock { NSString *someString = [[NSString
Configuring TinyMCE to allow for tags, based on a customer requirement. My config is

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.