Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Behind the Scenes
  3. Qt.io webservices
  4. QAndroidJniObject to QHash conversion in Qt.
QtWS25 Last Chance

QAndroidJniObject to QHash conversion in Qt.

Scheduled Pinned Locked Moved Qt.io webservices
1 Posts 1 Posters 966 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.
  • J Offline
    J Offline
    Jivika
    wrote on last edited by
    #1

    Hi..

    I want to call java function (that returns HashMap) from c++.
    for this my c++ function is below.

    @QHash<QString, QString> NotificationClient::getDeviceInfo() {
    QAndroidJniObject obj= QAndroidJniObject::callStaticObjectMethod("org/tradeindia/apps/messenger/TIMessenger/TIMessenger", "deviceInfo","()QHash<QString,QString>");
    }@

    and java function is

    @ public static HashMap<String, String> deviceInfo() {
    HashMap<String, String> map = new HashMap<String, String>();
    map.put("HELLO", "WORLD");
    return map;
    }@

    In the C++ function i am not able to convert QAndroidJniObject to QHash.
    or i am not following the right way of doing this.

    Please help..

    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