任何问题请联系WX:uu16853

买模板送网站采集器 让你轻松放开双手运营网站!

购买更多有优惠!

Android蓝牙栈bluez使用方法 Android开发技术

很多开发人员在最新的Android 0.9 SDK中没有找到蓝牙栈相关的参考,不过在官方消息中我们已经看到了是采用的是org.bluez相关的Package。这里主要介绍下Android蓝牙SDP相关的例程,我们看到是.intent.action,分为4个阶段:  org.bluez.intent.action.DISCOVERY_STARTED 开始探测 org.bluez.intent.action.REMOTE_DEVICE_FOUND   远程设备找到 org.bluez.intent.action.REMOTE_NAME_UPDATED  获取远程设备名称 org.bluez.intent.action.DISCOVERY_COMPLETED  完成SDP   大概的使用方法如下,在开发板上可以测试下,首先移植下org.bluez库 public void onStart(int startId, Bundle args){           super.onStart( startId, args );           try{           IBluetoothService ibtservice = BluetoothServiceNative.getBluetoothService();  //获取一个实例,其实在Android中已经准备好了系统服务          if( ibtservice == null ) {                                  stopSelf();  //失败了就Exit                 return;                }                      manager=ibtservice.getManager();                if( manager == null ) {                                 stopSelf();                } […]

100% Secure Checkout

PayPal / MasterCard / Visa