最近有接触到Android的Binder通信,把自己的测试记录下来。
百度Binder很容易知道Binder在Android中的重要性,所以,这边就结合代码说明下Binder的使用sample。 使用Binder首选需要创建一个接口类,就是平常我们所见的“Ixxx”类型,它是继承了IInterface类。
ITest.hpp
class ITest: public IInterface{
public:
/** @brief Declaration of TvplayerTsDemux class */
DECLARE_META_INTERFACE(Test);
virtual void DisplayText()=0;
};
DECLARE_META_INTERFACE(..)是将类型申明为接口必须的宏,展开后:
#define DECLARE_META_INTERFACE(INTERFACE)