haven't had any luck using google for this so I thought i'd ask.
Does anyone have any experience / know how to send a simple string i.e "hello" from a Windows Phone 8 device to an Android Device?
so far we have been able to do android -> android and android -> windows phone 8 but we haven't been able to find out how to do from windows phone 8 to android.
Has anyone seen a guide online or know how to do such a thing?
The first step I guess would be to find out how to make the application on windows phone 8 realize its near an android NFC device .. and then it would be to figure out how to make the application on the android phone receive the message.
Thanks in advance!
* Answer *
Alright so here are some answers/tips
I ended up sending the NFC messages as external type because sending application/my.mimetype kept giving me a "sorry your phone cant recorgnize this type of file" on the windows phone even though the message was getting through.
@Override
public NdefMessage createNdefMessage(NfcEvent event) {
NdefMessage ndefMessage = new NdefMessage((
new NdefRecord[] {createMimeRecord("packageName:externalType",docId.getBytes())}));
return ndefMessage;
}
public NdefRecord createMimeRecord(String mimeType, byte[] payload) {
byte[] mimeBytes = mimeType.getBytes(Charset.forName("US-ASCII"));
NdefRecord mimeRecord = new NdefRecord(NdefRecord.TNF_EXTERNAL_TYPE, mimeBytes, new byte[0], payload);
return mimeRecord;
}
all you have to do in android is to follow the android example from the SDK samples (android-16/17 - AndroidBeamDemo) which is explained extremely thoroughly here - http://www.tappednfc.com/wp-content/uploads/TAPPED-NFCDeveloperGuide-Part1.pdf
but instead of using application mimetype use the above external type and in your manifest put the following instead of the mimetype in the intent filter:
<data
android:host="ext"
android:pathPrefix="/cco.drugformulary:externalType"
android:scheme="vnd.android.nfc" />
regarding reading and sending the message from the windows phone you can use what the accepted answer guy said to do and it should work but for the type put cco.drugformulary:externalType as from above (your project name of course though).
If you are running into any problems feel free to ask me