如何在與應用程序配對時過濾藍牙標籤。例如,「平鋪」不會與其授權標籤以外的標籤連接。我的問題是,他們如何通過應用程序識別他們的授權標籤?如何通過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發現藍牙
你的意思是 '設備名稱'? –
詳細說明,如果我的藍牙範圍內有很多標籤,我只想在應用中顯示我公司的標籤。其他標籤不會顯示在應用程序中。 –