有没有人知道如何运行USSD命令来检查手机的信用余额(号码是*123#)并得到结果(信用余额)做进一步处理?谢谢
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 代码,但您将无法在应用程序中解析结果.将来可能会将此功能添加到 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 命令?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持html5模板网!
上传进度侦听器未触发(Google 驱动器 API)Upload progress listener not fired (Google drive API)(上传进度侦听器未触发(Google 驱动器 API))
使用 Google Drive SDK 将文件保存在特定文件夹中Save file in specific folder with Google Drive SDK(使用 Google Drive SDK 将文件保存在特定文件夹中)
Google Drive Android API - 无效的 DriveId 和 Null ResourcGoogle Drive Android API - Invalid DriveId and Null ResourceId(Google Drive Android API - 无效的 DriveId 和 Null ResourceId)
谷歌驱动api服务账户查看上传文件到谷歌驱动使Google drive api services account view uploaded files to google drive using java(谷歌驱动api服务账户查看上传文件到谷歌驱动使用java
Google Drive 服务帐号返回 403 usageLimitsGoogle Drive service account returns 403 usageLimits(Google Drive 服务帐号返回 403 usageLimits)
com.google.api.client.json.jackson.JacksonFactory;Google Drcom.google.api.client.json.jackson.JacksonFactory; missing in Google Drive example(com.google.api.client.json.jackson.JacksonFactory;Google Drive 示例