如何在与应用程序配对时过滤蓝牙标签。例如,“平铺”不会与其授权标签以外的标签连接。我的问题是,他们如何通过应用程序识别他们的授权标签?如何通过Android应用程序过滤蓝牙标签
回答
一个简单的解决方案是连接到一个不受信任的设备,发送一个预期具体结果的信号,如果它收到罚款,然后“信任”该设备。
然后,在下一次的负荷,检查配对的MAC地址..
一种近乎:
private BluetoothDevice mDevice = null;
if (mDevice == null) {
BluetoothAdapter mBluetoothAdapter = BluetoothAdapter.getDefaultAdapter();
if (mBluetoothAdapter != null) {
if (mBluetoothAdapter.isEnabled()) {
Set<BluetoothDevice> bluetoothDevices = mBluetoothAdapter
.getBondedDevices();
if (bluetoothDevices != null && bluetoothDevices.size() > 0) {
String bondedID = SharedPreferences.getInstance(
getApplicationContext()
).getPairedAddress();
if (bondedID != null) {
for (final BluetoothDevice device : bluetoothDevices) {
if (device != null
&& device.getAddress().equals(bondedID)) {
mDevice = device;
break;
}
}
}
} else {
Logger.v(TAG, "There are no Bluetooth Paired devices");
}
}
}
}
你的意思是发送一个信号到蓝牙标签,作为回应,如果应用程序收到预期的结果,然后相信标签? –
是的,它可以工作(这和我一样),但其他方式也很常见,比如只信任特定的设备名称(使用'mDevice.getName()')等。 – Bonatti
我的想法与安全问题有关。如果有人使用我的应用销售自己的标签,我将如何防止我的应用信任这些标签。 –
- 1. android - 如何通过蓝牙传输应用程序
- 2. 通过蓝牙的Android MessagePassing
- 3. 通过蓝牙
- 4. 通过蓝牙
- 5. 通过蓝牙
- 6. Android蓝牙应用程序
- 7. Android应用程序蓝牙
- 8. 如何在Android中通过蓝牙连接应用程序和Arduino?
- 9. Android蓝牙LE屏蔽UUID过滤器
- 10. 读通过蓝牙
- 11. 通过蓝牙应用程序的视频流
- 12. 通过整个应用程序维护Gamekit蓝牙连接
- 13. 配对和iPhone应用程序通过蓝牙/ Blutooth LE连接
- 14. 通过蓝牙/ wifi控制从PC的iPad应用程序
- 15. 通过蓝牙从iOS应用程序发送联系人
- 16. 通过蓝牙接收文件时启动应用程序
- 17. 通过应用程序处理蓝牙spp配对请求
- 18. 通过蓝牙控制Java Swing应用程序
- 19. 通过蓝牙连接到设备,锁定的应用程序
- 20. 从iPhone应用程序通过蓝牙传输文件
- 21. 通过蓝牙发送文件在C#应用程序
- 22. 通过蓝牙通信
- 23. 如何通过蓝牙从Android列出远程文件?
- 24. 如何通过蓝牙连接到同一应用程序的用户
- 25. 如何通过使用蓝牙从J2me应用程序发送文件
- 26. 使用Android设备通过SPP通过蓝牙发送数据
- 27. iOS蓝牙通知应用程序蓝牙设备连接时
- 28. 如何通过蓝牙将蓝牙配件连接至iPhone?
- 29. 通过蓝牙进行Android调试
- 30. 可通过Android-TV发现蓝牙
你的意思是 '设备名称'? –
详细说明,如果我的蓝牙范围内有很多标签,我只想在应用中显示我公司的标签。其他标签不会显示在应用程序中。 –