Android Beam: mimetype between different apps

285 views Asked by At

I am working with android beam to send data using NFC between two different apps, I have tested code from different answer, I have changed parameters, etc., and I always obtain the same result: The other device open or try to open the same app in the other device. I need to open a different app. Can someone help me??

1) Sender application

public NdefMessage createNdefMessage(NfcEvent event) {

    SimpleDateFormat sdf = new SimpleDateFormat("dd-MM-yyyy");
    String currentDate= sdf.format(new Date());


    NdefMessage msg = new NdefMessage(NdefRecord.createMime("application/com.myapp", currentDate.getBytes()) );
    return msg;
}

2) The application that receives

<intent-filter>
    <action android:name="android.intent.action.VIEW" />
    <category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
<intent-filter>
    <action android:name="android.nfc.action.NDEF_DISCOVERED"/>
    <category android:name="android.intent.category.DEFAULT"/>
    <data android:mimeType="application/com.myapp" />
</intent-filter>
0

There are 0 answers