List of usage examples for android.content Context BLUETOOTH_SERVICE
String BLUETOOTH_SERVICE
To view the source code for android.content Context BLUETOOTH_SERVICE.
Click Source Link
From source file:no.nordicsemi.android.nrftoolbox.dfu.DfuService.java
/** * Initializes bluetooth adapter//from ww w. ja v a2 s . c om * * @return <code>true</code> if initialization was successful */ private boolean initialize() { // For API level 18 and above, get a reference to BluetoothAdapter through // BluetoothManager. final BluetoothManager bluetoothManager = (BluetoothManager) getSystemService(Context.BLUETOOTH_SERVICE); if (bluetoothManager == null) { loge("Unable to initialize BluetoothManager."); return false; } mBluetoothAdapter = bluetoothManager.getAdapter(); if (mBluetoothAdapter == null) { loge("Unable to obtain a BluetoothAdapter."); return false; } return true; }