I want to implement a dialer-feature in my app. Actually, it\'s done, but it works the way I don\'t want to. When button is pressed, native dialer opens and waiting for pres
you will need the permission
in your AndroidManifest.xml
in java you would then do:
Intent dialIntent = new Intent(Intent.ACTION_CALL, Uri.parse("tel:+1123123"));
startActivity(dialIntent);
the equivalent Qt code is something like:
QAndroidJniObject action = QAndroidJniObject::fromString("android.intent.action.CALL");
QAndroidJniObject uriString = QAndroidJniObject::fromString("tel:+1123123");
QAndroidJniObject uri = QAndroidJniObject::callStaticObjectMethod("android/net/Uri", "parse", "(Ljava/lang/String)V", uriString);
QAndroidJniObject intent("android/content/Intent","(Ljava/lang/String, Landroid/net/Uri)V", action, uri);
QAndroidJniObject activity = QAndroidJniObject::callStaticObjectMethod("org/qtproject/qt5/android/QtNative", "activity", "()Landroid/app/Activity;");
activity.callObjectMethod("startActivity","(Landroid/content/Intent;)V",intent.object());
however, note that using ACTION_CALL may get you reject from the appstore, and google advises to use ACTION_DIAL, which opens the dialer instead of doing a direct call.