MIFARE SDK for Android

Forum / MIFARE SDK / MIFARE SDK for Android

  • 9. June 2014 at 15:02

    I'm trying to develop an application for Samsung Galaxy S4 (Android 4.4.2) using MIFARE SDK for Android.

    But there is an exception when I try to instantiate NxpNfcLibLite for MIFARE Classic 1k card:

    06-09 09:56:49.124: E/AndroidRuntime(4468): FATAL EXCEPTION: main
    06-09 09:56:49.124: E/AndroidRuntime(4468): Process: com.example.samplelitelib, PID: 4468
    06-09 09:56:49.124: E/AndroidRuntime(4468): java.lang.ArrayIndexOutOfBoundsException: length=4; index=4
    06-09 09:56:49.124: E/AndroidRuntime(4468): at com.nxp.nfclib.icode.ICodeFactory.get(:90)
    06-09 09:56:49.124: E/AndroidRuntime(4468): at com.nxp.nfcliblite.Interface.NxpNfcLibLite.filterIntent(:229)
    06-09 09:56:49.124: E/AndroidRuntime(4468): at com.example.samplelitelib.MainLiteActivity.onNewIntent(MainLiteActivity.java:189)
    06-09 09:56:49.124: E/AndroidRuntime(4468): at android.app.Instrumentation.callActivityOnNewIntent(Instrumentation.java:1161)
    06-09 09:56:49.124: E/AndroidRuntime(4468): at android.app.ActivityThread.deliverNewIntents(ActivityThread.java:2317)
    06-09 09:56:49.124: E/AndroidRuntime(4468): at android.app.ActivityThread.performNewIntents(ActivityThread.java:2330)
    06-09 09:56:49.124: E/AndroidRuntime(4468): at android.app.ActivityThread.handleNewIntent(ActivityThread.java:2339)
    06-09 09:56:49.124: E/AndroidRuntime(4468): at android.app.ActivityThread.access$1600(ActivityThread.java:138)
    06-09 09:56:49.124: E/AndroidRuntime(4468): at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1270)
    06-09 09:56:49.124: E/AndroidRuntime(4468): at android.os.Handler.dispatchMessage(Handler.java:102)
    06-09 09:56:49.124: E/AndroidRuntime(4468): at android.os.Looper.loop(Looper.java:136)
    06-09 09:56:49.124: E/AndroidRuntime(4468): at android.app.ActivityThread.main(ActivityThread.java:5050)
    06-09 09:56:49.124: E/AndroidRuntime(4468): at java.lang.reflect.Method.invokeNative(Native Method)
    06-09 09:56:49.124: E/AndroidRuntime(4468): at java.lang.reflect.Method.invoke(Method.java:515)
    06-09 09:56:49.124: E/AndroidRuntime(4468): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1264)
    06-09 09:56:49.124: E/AndroidRuntime(4468): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1080)
    06-09 09:56:49.124: E/AndroidRuntime(4468): at dalvik.system.NativeStart.main(Native Method)

    I got the same result for MIFARE Plus.
    Could someone help me?
    + 0  |  - 0

    Re: MIFARE SDK for Android

    10. June 2014 at 20:42
    follow the below steps for accessing :
    1- private NxpNfcLibLite libInstacne = null;
    2- Activity Oncreate method
    libInstacne = NxpNfcLibLite.getInstance();

    3-Activity onNewIntent method override classic and plus
    libInstacne.filterIntent(intent, new Nxpnfcliblitecallback() {
    public void onMifareClassicCardDetected(final MFClassic objMFCCard) {

    public void onMifarePlusCardDetected(final Plus objMFPlus) {

    Note: Classic will not detect in Samsung S4 due to Brcm controller.
    + 0  |  - 0

    Re: MIFARE SDK for Android

    12. June 2014 at 15:16
    Thanks man, I already did this.
    Unfortunately, is not possible to use MIFARE with Samsung S4. That's my problem.
    + 0  |  - 0

    Re: MIFARE SDK for Android

    13. June 2014 at 23:10
    I am using a Nexus 5 and I am running into the same issue as above. The sample application is crashing on the filterIntent with the same ArrayIndexOutOfBounds error. I cannot go into the code to monitor it.

    I know that the card can be read, because I am using another application on the phone which can read the card, but unfortunately your library isnt working so well as it crashes everytime it runs. I have also applied the suggestion in your follow up post to that of the original poster.
    + 0  |  - 0

    Re: MIFARE SDK for Android

    17. June 2014 at 13:19
    Can anyone from NXP confirms that the new released MIFARE SDK for Android still doesn't solve the incompatibility issue with Broadcom controller?

    + 0  |  - 0

    Re: MIFARE SDK for Android

    17. June 2014 at 13:21

    When you said another application can read the card, how much it can read actually? Is it limited to the tag type and UID only?
    + 0  |  - 0

    Re: MIFARE SDK for Android

    17. June 2014 at 19:03
    The other application accesses all the data on the card. fare information, etc etc.
    + 0  |  - 0

    Re: MIFARE SDK for Android

    18. June 2014 at 5:14

    May I know what is the name of the application? Thanks.
    + 0  |  - 0

    Re: MIFARE SDK for Android

    18. June 2014 at 5:31
    Yeah, sorry I should have put those details in.


    Its the myciti bus application that some guy in my city has created. I wish I could give you more information about the card itself but my understanding of NFC is not enough to give you an answer.

    I will try and also post some of the error codes that I have received from my own attempts to use the android SDK directly to access the information on the card.

    + 0  |  - 0

    Re: MIFARE SDK for Android

    18. June 2014 at 6:06
    From googling, i think MyCiti Cape Town is a Mastercard's Paypass application running on mifare smartmx, which is not covered by Mifare SDK.
    + 0  |  - 0

    Re: MIFARE SDK for Android

    18. June 2014 at 7:17
    Oh wow. Thanks a lot for that. I was probably using the incorrect search terms when making my queries about the card. I will try and use this info to see if I can get more information on communicating with the card.
    + 0  |  - 0

    Re: MIFARE SDK for Android

    18. June 2014 at 22:19
    Regarding crashing issue in nexus 5, can you try to install the given apk(SampleNxpNfcLiteLib.apk) in mifare sdk SampleApps.
    and after installing check your specific card/tag is detecting or not.
    if it still crash then share the nexus-5 Android version and the card/tag you are using.

    Note: Even though the mifare classic is not detecting by non-nxp controller but the application should not be crashed in any controller.
    + 0  |  - 0

    Re: MIFARE SDK for Android

    23. June 2014 at 12:56
    Hi guys,

    I confirm that sdk sample is also crashing on nexus 4 with same crash log:(

    The card is being used for scanning is MIFARE Classic 1K.
    + 0  |  - 0

    Re: MIFARE SDK for Android

    22. July 2014 at 5:18
    Hi emerson, Did you check with latest SDK?
    + 0  |  - 0
Viewing 14 posts - 1 through 14 (of 14 total)

You must be logged in to reply to this topic.