自拍偷在线精品自拍偷,亚洲欧美中文日韩v在线观看不卡

藍牙4.0BLE開發(fā)

移動開發(fā)
集成目前主流藍牙的demo

源碼簡介:集成目前主流藍牙的demo

源碼效果:

源碼片段:

  1. final BluetoothManager bluetoothManager = (BluetoothManager) getSystemService(Context.BLUETOOTH_SERVICE); 
  2. mBluetoothAdapter = bluetoothManager.getAdapter(); 
  3.    
  4. // Checks if Bluetooth is supported on the device. 
  5. if (mBluetoothAdapter == null) { 
  6.     Toast.makeText(this, R.string.error_bluetooth_not_supported, 
  7.             Toast.LENGTH_SHORT).show(); 
  8.      finish(); 
  9.      return
  10. // 開啟藍牙 
  11. mBluetoothAdapter.enable(); 
  12.    
  13. mBLE = new BluetoothLeClass(this); 
  14. if (!mBLE.initialize()) { 
  15.     Log.e(TAG, "Unable to initialize Bluetooth"); 
  16.     finish(); 
  17. // 發(fā)現(xiàn)BLE終端的Service時回調(diào) 
  18. mBLE.setOnServiceDiscoverListener(mOnServiceDiscover); 
  19. // 收到BLE終端數(shù)據(jù)交互的事件 
  20. mBLE.setOnDataAvailableListener(mOnDataAvailable); 

下載地址:http://down.51cto.com/data/2096560

責(zé)任編輯:倪明 來源: devstore
相關(guān)推薦

2022-01-25 16:54:14

BLE操作系統(tǒng)鴻蒙

2023-03-08 21:30:33

2021-10-30 07:55:00

BLE 藍牙開發(fā)

2023-04-17 16:10:14

鴻蒙藍牙

2022-11-17 15:26:06

低功耗藍牙鴻蒙

2024-04-15 14:58:29

藍牙智能家居

2010-10-29 09:44:29

Wi-Fi直連藍牙4.0

2015-02-27 16:03:26

Android源碼Bluetooth_4BLE藍牙通信

2023-09-19 15:58:13

Zigbee藍牙

2010-07-07 10:32:33

藍牙無線

2024-01-18 15:24:06

Rust開發(fā)鴻蒙OH4.0

2011-06-08 12:42:08

Android 藍牙

2010-04-29 15:58:40

藍牙4.0

2023-09-20 11:46:54

藍牙物聯(lián)網(wǎng)IOT

2011-08-22 13:46:15

iPhone開發(fā)GameKit 藍牙

2010-09-10 10:46:58

Firefox 4.0

2012-07-30 14:57:35

Android 開發(fā)者

2009-09-03 17:42:07

C#開發(fā)CF藍牙模塊

2010-09-08 11:26:26

Windows PhoXNA 4.0 3D游戲開發(fā)

2024-05-07 09:04:27

Tailwind前端開發(fā)Rust
點贊
收藏

51CTO技術(shù)棧公眾號