Android平台Contact Link客户端演示版

 Android平台Contact Link客户端演示版

 

★ 需要先在后台启动飞信服务,在状态栏上会显示“飞信服务启动中”的信息,灰色的飞信图标表示Contact Link客户端尚未连接到飞信服务。

 

 

★ 飞信服务在后台启动后,点击“连接飞信”。连接成功后,飞信图标会变成彩色,并且在状态栏显示“已连接到飞信服务”的信息。

 

 

★ 如果联系人改变其飞信状态,Contact Link客户端会及时更新其飞信状态。

 

 

 

★ 点击“断开飞信”,会在状态栏显示“已从飞信服务断开”的信息,并且飞信图标变为灰色。

 

 

 ★ 如下是飞信Contact Link客户端演示版的程序流程图: 

★ Contact Link客户端和飞信服务之间通讯的AIDL(Android Interface Definition Language)接口

IFetionService.aidl:

  1. // Declare the interface IFetionService.aidl
  2. interface IFetionService {

  3.     // All non-Java primitive parameters (e.g., int, bool, etc) require
  4.     // a directional tag indicating which way the data will go. Available
  5.     // values are in, out, inout. (Primitives are in by default, and cannot be otherwise).
  6.     // Limit the direction to what is truly needed, because marshalling parameters
  7.     // is expensive.
  8.     Map getContactStatus(in String[] contactUriAry);
  9.     
  10.     boolean getFetionLoginStatus();
  11.     
  12.     /**
  13.      * Often you want to allow a service to call back to its clients.
  14.      * This shows how to do so, by registering a callback interface with
  15.      * the service.
  16.      */
  17.     void registerCallback(IFetionServiceCallback cb);
  18.     
  19.     /**
  20.      * Remove a previously registered callback interface.
  21.      */
  22.     void unregisterCallback(IFetionServiceCallback cb);
  23. }
IFetionServiceCallback.aidl:

  1. // Declare the interface IFetionServiceCallback.aidl
  2. interface IFetionServiceCallback {
  3.     /**
  4.      * Called when the service has a new value for you.
  5.      */
  6.     void valueChanged(int respType, int respCode, in Map respBody);
  7. }

 

 

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值