本文介绍了如何运行USSD对Android的命令?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

有没有人知道如何运行USSD命令检查手机的贷方余额(数量* 123#),并得到结果(贷方余额)进行进一步的处理? thankss

has anyone know how to runs USSD command for checking phone's credit balance (the number is *123#) and get the result (the credit balance) for further processing?? thankss

推荐答案

您可以在Android设备上运行USSD codeS,但你将无法解析结果在应用程序中。此功能可能被添加到了Android SDK的未来,但现在,你将不得不寻找一个替代品。

You can run USSD codes in Android devices but you would be unable to parse the result in your application. This feature might be added to the Android SDK in the future but for now, you would have to look for an alternative.

USSD可以通过简单的通话意图运行。见例子:

USSD can be run using simple Call intents. See Example:

String ussdCode = "*" + "123" + Uri.encode("#");
startActivity(new Intent(Intent.ACTION_CALL, Uri.parse("tel:" + ussdCode)));

如上述评价电话呼叫许可也是必需

as mentioned in the comments phone call permission is also required

<uses-permission android:name="android.permission.CALL_PHONE" /

这篇关于如何运行USSD对Android的命令?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

09-26 15:57