Welcome!

Welcome to the official BlackBerry Support Community Forums.

This is your resource to discuss support topics with your peers, and learn from each other.

inside custom component

Java Development

Reply
New Contributor
hansamann
Posts: 4
Registered: ‎11-12-2010
My Device: Not Specified

NFC SNEP - Push Message from NFC Reader to Device

I would like to program a NFC Reader (ACR 122) via the standard java.smartcardio API and have the message received by a mobile device, like a RIM Blackberry. Technically, I think I want the NFC Reader to be the Initiatior and push a NDEF Message to the receiver, in this case a mobile device with NFC. Can anyone provide some sample code or point me towards the right direction? Any help and tips are greatly appreciated. 

 

One other questions: will package records like they are available for Android also be supported by future versions of the RIM os? Is there a generic/standardized solution, too? 

 

Thx

Sven

Retired
mwoolley
Posts: 571
Registered: ‎06-25-2010
My Device: Z10

Re: NFC SNEP - Push Message from NFC Reader to Device

Hi Sven

 

if you intend to push a message from the reader to the BlackBerry smart phone then the smart phone application will simply need to implement and use the NDEFMessageListener interface (I assume this is about BlackBerry 7 rather than 10?).

 

As such, take a look at the articles and code samples relating to reading NFC tags since what you need to do is identical:

 

http://supportforums.blackberry.com/t5/Java-Development/NFC-Article-and-Code-Index/ta-p/1538775

 

I'm not sure I understand your closing questions about package records and standardised/generalised solutions. Could you ellaborate please?

 

Regards

 

Martin

--------------------------------------------------------------------------------------------
Feel free to press the like button on the right side if you liked my attempts to help :-)
And please mark posts as solved if you think I found the solution or set you on its path. Thanks!
Follow me on Twitter: @mdwrim
New Contributor
hansamann
Posts: 4
Registered: ‎11-12-2010
My Device: Not Specified

Re: NFC SNEP - Push Message from NFC Reader to Device

My problems are less with the receiving side, the BlackBerry in this case. My issue is the development of a javax.smartcardio Applicationb, that acts as the initiator. I have found a few examples out there, but none seems to work perfectly. I was hoping that you could share some Java SE code to program sucha reader (the receiving side, the phone, is relatively easy as there are nice APIs that you mentioned).

 

Package Records - that is not associated to the above qustion - but: On Android, there are package records which essentially are used by the OS to make sure that a NDEF message containing a package records for com.myapp (package name, java) will only be delivered to that app. It is not a strong security mechanism, but definitely solves the problem that a NDEF message might be easily received by an app that just registrered for the same MIME message for example. These Package Records are proprietary to Android right now. 

Retired
mwoolley
Posts: 571
Registered: ‎06-25-2010
My Device: Z10

Re: NFC SNEP - Push Message from NFC Reader to Device

OK, sorry I haven't used Java for the desktop side of things. The only desktop oriented stuff I've done has been with Python and the pyscard library. See http://pyscard.sourceforge.net/ . I'm no expert on it's use btw!

 

The package records mechanism sounds very similar to the NFC Forum's Type Name Format "EXTERNAL" where you invent your own type which comprises a domain and record type name. For example com.rim.nfc.example:myrecord

 

Is that what you mean?

--------------------------------------------------------------------------------------------
Feel free to press the like button on the right side if you liked my attempts to help :-)
And please mark posts as solved if you think I found the solution or set you on its path. Thanks!
Follow me on Twitter: @mdwrim
Retired
mwoolley
Posts: 571
Registered: ‎06-25-2010
My Device: Z10

Re: NFC SNEP - Push Message from NFC Reader to Device

Are you sure this reader supports NFC peer to peer mode by the way? I glanced through the documentation and everything I read seemed geared towards Reader/Writer mode which is probably what you'd expect. Suggest you look to the manufacturer first to check that it can do what you want to do unless you've done this already. I can help on the BlackBerry side of things but much less so with respect to some other company's product I'm afraid.

--------------------------------------------------------------------------------------------
Feel free to press the like button on the right side if you liked my attempts to help :-)
And please mark posts as solved if you think I found the solution or set you on its path. Thanks!
Follow me on Twitter: @mdwrim