Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. Mobile and Embedded
  4. NfcAdapter in c++ using QJniAndroidObject
Forum Updated to NodeBB v4.3 + New Features

NfcAdapter in c++ using QJniAndroidObject

Scheduled Pinned Locked Moved Unsolved Mobile and Embedded
1 Posts 1 Posters 149 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • C Offline
    C Offline
    Cristian Negru
    wrote on last edited by
    #1

    Hello,

    I'm kinda new to qt, so don't go to hard on me :D. I'm trying to develop an application for android that can scan mifare tags(1k 4k ultralight etc) and get the uid and sak of this cards. I know that you can use methods from qnearfieldmanager and qnearfieltarget and get the uid with target->getUid(), but the problem is that I don't know how to get the sak of this cards.

    I have tried using QAndroidJni object to call a method from java class nfcAdapter->getSak().. The problem is that i need to get the context for the application, then the nfcAdapter with getDefaultAdapter(Context context) and after that i can call getSak..

    The nfca adapter part i tried getting it with:

    QAndroidJniObject nfca = QAndroidJniObject::callStaticObjectMethod("android.nfc.NfcAdapter","getDefaultAdapter","(Landroid/content/Context;)Landroid/nfc/NfcAdapter;");
    
    

    But it gives me an JNI error: JNI DETECTED ERROR IN APPLICATION: use of invalid jobject 0xb5ffd99c. I have quest that i need the context to pass it as an argument for getDefaultAdapter(Context context).

    Does anyone know a way on how to do this thing, expecially the sak part?

    1 Reply Last reply
    0

    • Login

    • Login or register to search.
    • First post
      Last post
    0
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Groups
    • Search
    • Get Qt Extensions
    • Unsolved