QAndroidJniObject to QHash conversion in Qt.



  • 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..


Log in to reply
 

Looks like your connection to Qt Forum was lost, please wait while we try to reconnect.