如何阅读/拦截Android手机上的USSD消息 [英] How to read/intercept USSD message coming on Android phone
问题描述
所以我能解决的问题是,直到Android 4.2.2有两种方法可供我们使用:
-
使用logcat并从中提取信息
Runtime.getRuntime()。exec(
logcat -v time -b main PhoneUtils:D);
我用这段代码来读取logcat
并在这里找出displayMMIComplete
消息 -
使用提供的名为
com.android.ussd.IExtendedNetworkService
的意图并监听此意图并执行任务。
所以我直到现在才承认,自4.0以来这个意图已被删除,自4.2.2以来已删除 logcat
中的USSD消息信息的打印?
我到这儿是对的吗?
其次,现在阅读USSD消息的黑客或解决方案是什么,我们必须通过某种方式解决这个问题?
还没有Android框架提供的API可用于以便携方式读取/拦截USSD消息。
你提到的两种方法是迄今为止可用的方法,但正如你所提到的,从Android开源项目中删除了对它的支持。
请求/讨论继续,这清楚地表明许多开发人员正在请求此功能,但到目前为止,没有来自Google方面的更新/通信,以解释有关以便携方式添加对读取/拦截USSD消息的支持的未来路线图。 / p>
So unil this point all I can figure over was that until Android 4.2.2 there were two ways available to us :
Use the logcat and extract information from it
Runtime.getRuntime().exec( "logcat -v time -b main PhoneUtils:D");
I used this code to read thelogcat
and find out thedisplayMMIComplete
message hereUse the provided intent named
com.android.ussd.IExtendedNetworkService
and listen for this intent and do you task.
So what I've acknoweldge until now is, Since 4.0 onwards this intent has been removed and since 4.2.2 onwards printing of USSD message info in the logcat
has been removed?
Am I right until here? And secondly what's the hack or solution now to read the USSD message, there must be some way we can get through it?
There is no Android-framework provided API yet which can be used to "read/intercept" USSD Messages in a Portable way.
The 2 approaches that you mentioned is what was available till now, but as you mentioned, support for it is dropped from Android open source project.
There is a request/discussion going on, which clearly shows that many developers are requesting this feature, but so far there is no update/communication from Google's side to explain future roadmap about adding support to "read/intercept" USSD Messages in a Portable way.
这篇关于如何阅读/拦截Android手机上的USSD消息的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!