Android平台Contact Link客户端演示版
★ 需要先在后台启动飞信服务,在状态栏上会显示“飞信服务启动中”的信息,灰色的飞信图标表示Contact Link客户端尚未连接到飞信服务。
★ 飞信服务在后台启动后,点击“连接飞信”。连接成功后,飞信图标会变成彩色,并且在状态栏显示“已连接到飞信服务”的信息。
★ 如果联系人改变其飞信状态,Contact Link客户端会及时更新其飞信状态。
★ 点击“断开飞信”,会在状态栏显示“已从飞信服务断开”的信息,并且飞信图标变为灰色。
★ 如下是飞信Contact Link客户端演示版的程序流程图:
★ Contact Link客户端和飞信服务之间通讯的AIDL(Android Interface Definition Language)接口
IFetionService.aidl:
- // Declare the interface IFetionService.aidl
- interface IFetionService {
- // All non-Java primitive parameters (e.g., int, bool, etc) require
- // a directional tag indicating which way the data will go. Available
- // values are in, out, inout. (Primitives are in by default, and cannot be otherwise).
- // Limit the direction to what is truly needed, because marshalling parameters
- // is expensive.
- Map getContactStatus(in String[] contactUriAry);
- boolean getFetionLoginStatus();
- /**
- * Often you want to allow a service to call back to its clients.
- * This shows how to do so, by registering a callback interface with
- * the service.
- */
- void registerCallback(IFetionServiceCallback cb);
- /**
- * Remove a previously registered callback interface.
- */
- void unregisterCallback(IFetionServiceCallback cb);
- }
- // Declare the interface IFetionServiceCallback.aidl
- interface IFetionServiceCallback {
- /**
- * Called when the service has a new value for you.
- */
- void valueChanged(int respType, int respCode, in Map respBody);
- }