呼叫(并获得响应)一个USSD code,在后台?后台、USSD、code

2023-09-12 09:48:20 作者:①個人哭泣

我想编写一个插件播放用户的prepay余额,剩余的数据等。

I'm wanting to write a widget displays the users' prepay balance, remaining data etc.

我在想自动调用USSD code返回该数据(必须有一个正则表达式为每个网络)在区间(不常有,以节省电池)。这将必须在后台完成。我在其中运行USSD code和返回结果的那一刻的应用程序,所以我认为这应该是可能的 - 但我不知道怎么会在后台完成

I'm thinking of automatically calling the USSD code which returns this data (will have to have a regex for each network), at intervals (not often, to save battery). This would have to be done in the background. I have an app at the moment which runs the ussd code and returns the result, so I think this should be possible - but I'm not sure how it would be done in the background.

我见过的意图调用了一些,但我不知道怎么去的结果,我还在想,这一意图将导致呼叫屏幕上来推向了前台?

I've seen the intents for Calling a number, but I'm not sure how to get the result, and I'm also thinking that that intent would cause the call screen to come up into the foreground?

另外一种选择是通过屏幕抓取从运营商的网站/也许wap站点的结果,但会导致数据费用的用户得到的数据,所以我会使用USSD $ C preFER解决方案$ C。

The other option is to get the data by screen-scraping the result from the carrier's website/maybe wap site but that would result in data charges for the user, so I would prefer a solution using the USSD code.

在此先感谢您的帮助 - 才开始工作今天理解的Andr​​oid所以有相当多学习:)

Thanks in advance for any help - only started working on understanding android today so got quite a lot to learn :)

推荐答案

USSD尚不支持Android上。有它功能请求:http://$c$c.google.com/p/android/issues/detail?id=1285

USSD is not yet supported on Android. There is a feature request for it: http://code.google.com/p/android/issues/detail?id=1285