解析 Android 的 AIDL 介面
2010-07-21 01:11:00 来源:WEB开发网java.lang.String _result;
try {
_data.writeInterfaceToken(DESCRIPTOR);
mRemote.transact(Stub.TRANSACTION_EvAssignPress, _data, _reply, 0);
_reply.readException();
_result = _reply.readString();
}
finally {
_reply.recycle();
_data.recycle();
}
return _result;
}
}
static final int TRANSACTION_EvDigitPress = (IBinder.FIRST_CALL_TRANSACTION + 0);
static final int TRANSACTION_EvCPress = (IBinder.FIRST_CALL_TRANSACTION + 1);
static final int TRANSACTION_EvPlusPress = (IBinder.FIRST_CALL_TRANSACTION + 2);
static final int TRANSACTION_EvAssignPress = (IBinder.FIRST_CALL_TRANSACTION + 3);
}
public java.lang.String EvDigitPress(int d) throws android.os.RemoteException;
public java.lang.String EvCPress() throws android.os.RemoteException;
public java.lang.String EvPlusPress() throws android.os.RemoteException;
public java.lang.String EvAssignPress() throws android.os.RemoteException;
}
呃?calInterface.java?案是由aidl.exe工具程式所?出的。
首先,calInterface介面擂承了Android提供的IInterface介面,如下述程式瘁:
public interface calInterface extends android.os.IInterface
{
………
}
呃???定柳又?含有一?Stub??,其擂承Android提供的Binder父??,而且?作calInterface介面,如下述程式瘁:
public interface calInterface extends android.os.IInterface
{
……….
public static abstract class Stub extends android.os.Binder implements com.misoo.gx06.calInterface
{
……….
private static class Proxy implements com.misoo.gx06.calInterface
{
………
}
………..
}
由於Stub??擂承了Binder父??,而Binder又?作了IBinder介面,所以Stub??支持??介面:IBinder和calInterface。其?含的Proxy??也支持calInterface。
更多精彩
赞助商链接