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

Native Development

Reply
New Developer
Posts: 13
Registered: ‎10-07-2013
My Device: Q10
My Carrier: HKCSL

Native NFC smartcard reader app (Octopus/Oyster card, etc)

Hi all, I am intending to create a smartcard (such as Octopus card in Hong Kong) reader using the NFC functionality provided in the native API. In addition to invoking the relevant NFC related functions to read the card, anyone can share with me your experience on how to deal with the remaining part of the app (eg server connection, authentication, etc). Currently i'm struggling to build this part of the whole app with limited info in this regard. Many thanks in advance!
Retired
Posts: 170
Registered: ‎09-06-2010
My Device: None
My Carrier: None

Re: Native NFC smartcard reader app (Octopus/Oyster card, etc)

Have you looked at the list of resources we've written for NFC on  BlackBerry 10 here: http://supportforums.blackberry.com/t5/Java-Development/NFC-Article-and-Code-Index/ta-p/1538775

 

And, there are a large number of BlackBerry sample applications on GitHub here: http://blackberry.github.io/Catalogs/All_Samples.html#samplesNative

 

In particular https://github.com/blackberry/Cascades-Samples/tree/master/httptest may be of relevance to you.

Developer
Posts: 16,987
Registered: ‎07-29-2008
My Device: Z10 LE, Z30, Passport
My Carrier: O2 Germany

Re: Native NFC smartcard reader app (Octopus/Oyster card, etc)

I have heard that the NFC tags of the Octopus card are not readable as they are older than the current standards.
We tried to read them with the NFC sample in Hong Kong but without success.

Before you invest too much into the app i would suggest that you check if the tags are readable with a bb10 smartphone at all.
----------------------------------------------------------
feel free to press the like button on the right side to thank the user that helped you.
please mark posts as solved if you found a solution.
@SimonHain on twitter
Retired
Posts: 170
Registered: ‎09-06-2010
My Device: None
My Carrier: None

Re: Native NFC smartcard reader app (Octopus/Oyster card, etc)

The issue, as I understand it, is that many of these transport cards originally started use the MiFARE Classic.

 

BlackBerry 10 does not support the MIFARE classic for reading or writing from a BlackBerry application. It does not support ISO7816-4, has some proprietory aspects to its ISO14443-3 implementation, uses a proprietary crypto algorithm and has special licensing requirements.

 

You need to check the precise type of NFC card you're intending to read and verify that it's not a MiFARE Classic.

Developer
Posts: 16,987
Registered: ‎07-29-2008
My Device: Z10 LE, Z30, Passport
My Carrier: O2 Germany

Re: Native NFC smartcard reader app (Octopus/Oyster card, etc)


jomurray wrote:

You need to check the precise type of NFC card you're intending to read and verify that it's not a MiFARE Classic.


"A spokesman for Octopus Cards said it used the Sony FeliCa card - not the Mifare Classic"

http://www.scmp.com/article/631075/octopus-card-not-vulnerable-hacking-system-operator-says

 

We talked among the developers on BB Jam Asia about an app that could read the cards. It would be quite cool, but due to security restrictions i don't think it is possible.

----------------------------------------------------------
feel free to press the like button on the right side to thank the user that helped you.
please mark posts as solved if you found a solution.
@SimonHain on twitter
New Developer
Posts: 13
Registered: ‎10-07-2013
My Device: Q10
My Carrier: HKCSL

Re: Native NFC smartcard reader app (Octopus/Oyster card, etc)

Thanks a lot for all the clarifications and information which are very useful! By the way, given there exist android apps which allow android phones to read octopus cards, originally I was thinking of studying how those apps work, as well as comparing the NFC related api with those in BB10 and see how similar design can be made possible in BB10. Anyway, seems such thought might not be that helpful given the information I got today!
Developer
Posts: 16,987
Registered: ‎07-29-2008
My Device: Z10 LE, Z30, Passport
My Carrier: O2 Germany

Re: Native NFC smartcard reader app (Octopus/Oyster card, etc)

Well, maybe it is. If there are android apps it seems unlikely that reading the cards is somehow restricted. Most likely writing is protected (as you otherwise could modify the value on the card)
----------------------------------------------------------
feel free to press the like button on the right side to thank the user that helped you.
please mark posts as solved if you found a solution.
@SimonHain on twitter
Retired
Posts: 170
Registered: ‎09-06-2010
My Device: None
My Carrier: None

Re: Native NFC smartcard reader app (Octopus/Oyster card, etc)

Check out https://github.com/jcmurray/Cascades-Community-Samples/tree/master/NfcTool -- I added an extra function to this for an earlier BBJam Europe in Amsterdam to read the Amsterdam Transport Pass. Luckily these passes were MiFare Ultralight tags so easily read.

 

When I was in Hong Kong BBJam Asia last week I took a look at the single use tickets on the Airport Express and they were simple Ultralight C tags ... didn't manage to lay my hands on an Octopus one :-)

Retired
Posts: 170
Registered: ‎09-06-2010
My Device: None
My Carrier: None

Re: Native NFC smartcard reader app (Octopus/Oyster card, etc)

rry that link should have been https://github.com/blackberry/Cascades-Community-Samples/tree/master/NfcTool rather than my own forked repo.

New Developer
Posts: 13
Registered: ‎10-07-2013
My Device: Q10
My Carrier: HKCSL

Re: Native NFC smartcard reader app (Octopus/Oyster card, etc)

Thx John! Will have a look at that and play with it on my cards! Should have approached you and others developers for some chat on this after your presentation in BBJam Asia!