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. QAndroidJni - Is it possible to pass a native callback function to java class?
Forum Update on Monday, May 27th 2025

QAndroidJni - Is it possible to pass a native callback function to java class?

Scheduled Pinned Locked Moved Unsolved Mobile and Embedded
1 Posts 1 Posters 292 Views
  • 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.
  • D Offline
    D Offline
    drwho
    wrote on last edited by
    #1

    For example, Android's network service discovery manager has a method called registerService(), which the third parameter is a callback for success / fail. I see there is a way to register native methods, but I'm not sure if it is possible to do callbacks / the glue needed.

    nsdm.callObjectMethod("registerService", "(Ljava/lang/Object;ILjava/lang/some_type?;)V", nsdServiceInfo, port, my_static_cpp_method);
    
    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