How to execute USSD?
Unsolved
QML and Qt Quick
-
Do you mean
Uri.encode("#")
doesn't do the job ? -
Does anyone know how to do these in Qt?
private void dailNumber(String code) { String ussdCode = "*" + code + Uri.encode("#"); startActivity(new Intent("android.intent.action.CALL", Uri.parse("tel:" + ussdCode))); }
I apologize for that, but now I'm learning
-
Take a look at the QtAndroidExtras module.
It allows you to interface easily with Java code.
-
Well, I have already implemented the function in a java class. But I can not find the way to call it ... the problem is with startActivity (intent) the function in java is:
public void dailNumber(String code) { String ussdCode = "*" + code + Uri.encode("#"); startActivity(new Intent("android.intent.action.CALL", Uri.parse("tel:" + ussdCode))); }
While the method with which we call it is:
void CallDirectly::runUSSD(QString code) { QAndroidJniObject ussdCode = QAndroidJniObject::fromString(code); QAndroidJniObject::callStaticObjectMethod("cu/myapp/javaclases", "dialNumber", "(Ljav/lang/String;)V", ussdCode.object<jstring>()); }
-
What is exactly your problem ?