BluetoothAdapter adapter = BluetoothAdapter.getDefaultAdapter();
if(adapter != null)
{
if(adapter.isEnabled()
{
Intent intent = new Intent(BluetoothAdapter.ACTION_REQUEST_ENABLE);
startActivity(intent);
}

set<BluetoothDevice>devices = adapter.getBondedDevices();
if(devices.size()>0)
{
for(Iterator iterator = devices.iterator();iterator.hasNext();)
{
BluetoothDevices bluetoothDevice =(BluetoothDevice)iterator.next();
}
}

}

更多相关文章

  1. 代码中设置drawableleft
  2. android 3.0 隐藏 系统标题栏
  3. Android开发中activity切换动画的实现
  4. Android(安卓)学习 笔记_05. 文件下载
  5. Android中直播视频技术探究之—摄像头Camera视频源数据采集解析
  6. 技术博客汇总
  7. android 2.3 wifi (一)
  8. AndRoid Notification的清空和修改
  9. Android中的Chronometer

随机推荐

  1. MySQL 百万级数据的4种查询优化方式
  2. MySQL 全文检索的使用示例
  3. MySQL 常见的数据表设计误区汇总
  4. 浅谈MySQL next-key lock 加锁范围
  5. MySQL为id选择合适的数据类型
  6. MySQL单表千万级数据处理的思路分享
  7. MySQL 时间类型的选择
  8. MySQL索引失效的典型案例
  9. MySQL库表名大小写的选择
  10. mysql 带多个条件的查询方式