[SOLVED] How can i call an other App from a Qt App for Androids?
-
Oh my Got, Thank you very much!! This is very complicated, i couldn't find it, never!!
-
Oh my Got, Thank you very much!! This is very complicated, i couldn't find it, never!!
-
@xmaze =) There is an much easier way
QDesktopServices::openUrl((QUrl("iqsrc://-f 1090000000 -s 2000000 - a 127.0.0.1 -g 100"))or just from QML
onClicked: Qt.openUrlExternally(iqsrc://-f 1090000000 -s 2000000 - a 127.0.0.1 -g 100")
-
@xmaze And it is very interesting for me. Does it work startActivity as i showed befor ? I have no chance to check it
QAndroidJniObject url=QAndroidJniObject::fromString("iqsrc://-f 1090000000 -p 5000 -s 2000000 -a 127.0.0.1 -g 100"); QAndroidJniObject intent=QAndroidJniObject::callStaticObjectMethod("marto/rtl_tcp_andro/DeviceOpenActivity","parseUri","(Ljava/lang/String;I)Lmarto/rtl_tcp_andro/DeviceOpenActivity;", url.object<jstring>(),0x00000001); QtAndroid::startActivity(intent,0,0);
I tried this code but i have a black screen, i call this in Constructor of the QMainWindow, i am not sure if i call right the Application, i am not sure about the
marto/rtl_tcp_andro/DeviceOpenActivity -
QAndroidJniObject url=QAndroidJniObject::fromString("iqsrc://-f 1090000000 -p 5000 -s 2000000 -a 127.0.0.1 -g 100"); QAndroidJniObject intent=QAndroidJniObject::callStaticObjectMethod("marto/rtl_tcp_andro/DeviceOpenActivity","parseUri","(Ljava/lang/String;I)Lmarto/rtl_tcp_andro/DeviceOpenActivity;", url.object<jstring>(),0x00000001); QtAndroid::startActivity(intent,0,0);
I tried this code but i have a black screen, i call this in Constructor of the QMainWindow, i am not sure if i call right the Application, i am not sure about the
marto/rtl_tcp_andro/DeviceOpenActivity -
QAndroidJniObject url=QAndroidJniObject::fromString("iqsrc://-f 1090000000 -p 5000 -s 2000000 -a 127.0.0.1 -g 100"); QAndroidJniObject intent=QAndroidJniObject::callStaticObjectMethod("marto/rtl_tcp_andro/DeviceOpenActivity","parseUri","(Ljava/lang/String;I)Lmarto/rtl_tcp_andro/DeviceOpenActivity;", url.object<jstring>(),0x00000001); QtAndroid::startActivity(intent,0,0);
I tried this code but i have a black screen, i call this in Constructor of the QMainWindow, i am not sure if i call right the Application, i am not sure about the
marto/rtl_tcp_andro/DeviceOpenActivity -
@jalomic code and receiver is not something, i change this to null.
ok, it calls the other app but how can i wait for the other app to complete the intialitation before to process the qt app. I am not sure also if all the arguments are right, i have to make some tests and i write the results the next hours!
thanks -
Thank you it's working!!
I made a workaround, i put a sleep() function for 4 seconds to wait until the other App is started!! -
@jalomic Hi, i am back to ask you, how can i have prompt message if the intent does not exist? Do you have an idea?