简体   繁体   English

Android应用,与未知的蓝牙设备连接

[英]Android app, connect with an unknown bluetooth device

I am currently (for testing) using 我目前(用于测试)正在使用

private static String address = "07:12:05:16:66:69";

to connect to my own Bluetooth device, but can't figure out how to enable my app to get the MAC address of a device so that it can connect to others. 连接到我自己的蓝牙设备,但无法弄清楚如何使我的应用程序能够获取设备的MAC地址,以便它可以与其他设备连接。 I have attached my working MainActivity. 我已附上工作中的MainActivity。

http://pastebin.com/KJPvJXG1 http://pastebin.com/KJPvJXG1

You have to go through device discovery process to see what device addresses are around you. 您必须经过设备发现过程才能查看您周围的设备地址。 See the documentation here: http://developer.android.com/guide/topics/connectivity/bluetooth.html#DiscoveringDevices 请参见此处的文档: http : //developer.android.com/guide/topics/connectivity/bluetooth.html#DiscoveringDevices

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM