登录
首页 » Android » 蓝牙寻找

蓝牙寻找

于 2022-03-17 发布 文件大小:63.35 kB
0 260
下载积分: 2 下载次数: 1

代码说明:

1.使用registerReceiver注册BroadcastReceiver来获取蓝牙状态、搜索设备等消息;2.使用BlueAdatper的搜索;3.在BroadcastReceiver的onReceive()里取得搜索所得的蓝牙设备信息(如名称,MAC,RSSI);4.通过设备的MAC地址来建立一个BluetoothDevice对象;5.由BluetoothDevice衍生出BluetoothSocket,准备SOCKET来读写设备;6.通过BluetoothSocket的createRfcommSocketToServiceRecord()方法来选择连接的协议/服务,这里用的是SPP(UUID:00001101-0000-1000-8000-00805F9B34FB);7.Connect之后(如果还没配对则系统自动提示),使用BluetoothSocket的getInputStream()和getOutputStream()来读写蓝牙设备。 

下载说明:请别用迅雷下载,失败请重下,重下不扣分!

发表评论

0 个回复

  • Plane_war_game
    基于android的飞机大战游戏,不过不能触屏控制,只能通过DAPD板控制上下左右,对初学者有用(Plane war game based on android, but can t touch screen control, only through DAPD board to control the up and down or so, useful for beginners)
    2013-12-07 21:49:44下载
    积分:1
  • android 高仿qq完整源码下载(含服务器端源码)
    高仿qq源码,含 服务器端源码以及数据库sql
    2014-12-15下载
    积分:1
  • DERNull
    A NULL object Source Code for Andriod.
    2014-01-01 21:21:31下载
    积分:1
  • DevsmartLib-Android
    Horizontal ListView的android布局使用例子,Android 水平Listview列表视图实例,有源码包和实例包,注释比较多,不过是英文的,使用ListView开发android应用时,这是个实用的技巧,闲暇时可参考下(Android layout Horizontal ListView using examples, Android Listview level list view instance, there are examples of packages and source packages, comment more, but in English, when using ListView android application development, this is a practical tips, refer to the following leisure)
    2014-04-21 09:42:07下载
    积分:1
  • test_musicplayer
    android 音乐播放 功能:播放 停止 快进(play music)
    2014-07-21 00:18:31下载
    积分:1
  • android 裁剪图片,多功能2D绘图 例子
    android 2d绘图例子
    2014-09-18下载
    积分:1
  • android 手写签名
    安卓平台下对手写签名的DEMO一个用于学习的手势记录和图片生成例子没有多余的业务代码只是最精简的学习案例
    2022-12-17 06:40:04下载
    积分:1
  • Gallery
    android gallary桌面切换效果,超炫,带翻转效果(android gallary desktop switching effects, stunning, with rollover effects)
    2011-07-02 12:48:05下载
    积分:1
  • 活动的生命周期
    Android活动生命周期代码
    2022-02-02 11:21:10下载
    积分:1
  • flappybird
    刚刚学完Cocoos2dx之后编写的FlappyBrid小游戏。玩法一样,只是有些数值可能设置的没有原版那么好。可以编译到Android上的。(Just after completing Cocos2dx written Flappy Bird game. Play the same, but some values are not as good as the original may be set. It can be compiled to Android s.)
    2015-11-20 14:33:11下载
    积分:1
  • 696516资源总数
  • 106914会员总数
  • 0今日下载