我正在尝试实现一个应用程序来发送,接收和解析Android上的USSD代码.到目前为止,我使用http://commandus.com/blog/?p=58上的代码来获得此功能.为了使服务正常工作,需要重新启动手机.这在用户第一次安装应用程序时不会出现问题,但我在仿真器上测试时注意到的是,即使服务没什么新功能,手机也需要在每次更新时重新启动.我想知道的是以下内容:
作为参考,我已经包含了我用于服务的代码,因为界面部分与原始网站上发布的代码不同.
接口:
* This file is auto-generated. DO NOT MODIFY.
package com.android.internal.telephony;
/**
* Interface used to interact with extended MMI/USSD network service.
*/
public interface IExtendedNetworkService extends android.os.IInterface {
/** Local-side IPC implementation stub class. */
public static abstract class Stub extends android.os.Binder implements
com.android.internal.telephony.IExtendedNetworkService {
private static final java.lang.String DESCRIPTOR = "com.android.internal.telephony.IExtendedNetworkService";
/** Construct the stub at attach it to the interface. */
public Stub() {
this.attachInterface(this, DESCRIPTOR);
}
/**
* Cast an …Run Code Online (Sandbox Code Playgroud) 我正在尝试开发一个静默地拒绝USSD响应的应用程序.我已经使用http://commandus.com/blog/?p=58中的代码进行了微小的更改.我已经IExtendedNetworkService.aidl在包中com.android.internal.telephony和包USSDDumbExtendedNetworkService内创建了它com.commandus.ussd.问题是,运行应用程序后没有任何反应(即使重新启动手机后).有人能指出我做错了什么吗?我应该写任何额外的代码来使其工作吗?
IExtendedNetworkService.aidl
package com.android.internal.telephony;
/**
* Interface used to interact with extended MMI/USSD network service.
*/
interface IExtendedNetworkService {
/**
* Set a MMI/USSD command to ExtendedNetworkService for further process.
* This should be called when a MMI command is placed from panel.
* @param number the dialed MMI/USSD number.
*/
void setMmiString(String number);
/**
* return the specific string which is used to prompt MMI/USSD is running
*/
CharSequence …Run Code Online (Sandbox Code Playgroud)