1.创建project
android IDE,SDK,NDK的安装,导入alljoyn.jar包和liballjoyn_java.so(放在armeabi)文件夹下。
2.Creating
an AllJoyn interface
load native library(alljoyn_java),创建AllJoyn
interface。
3.Connecting to the AllJoyn router
当连接到AllJoyn bus时,一个程序可以作为服务端或者客户端,或者两者都是。
3.1连接到一个service上的步骤
a.创建一个总线附件(BusAttchment)
b.通过绝对路径(absolute service path)注册一个BusObject
c.将总线附件(BusAttachment)连接到总线(Bus)上
d.从总线(Bus)上请求一个已知的名称
3.2连接到一个client上的步骤
a.创建一个总线附件(BusAttchment)
b.将总线附件(BusAttachment)连接到总线(Bus)上
c.创建一个带有指定参数(service name,absolute service path,interface of interest)的代理对象
d.实现指定AllJoyn接口的代理连接
e.(可选)如果感兴趣的接口有任何信号的话,或者对D-bus和AllJoyn中的指定信号感兴趣,需要注册信号
处理的handlers