Android Open Source - BleSensorTag Bluetooth State Reciever

From Project

Back to project page BleSensorTag.


The source code is released under:

MIT License

If you think the Android project BleSensorTag listed in this page is inappropriate, such as containing malicious code/tools or violating the copyright, please email info at java2s dot com, thanks.

Java Source Code

package sample.ble.sensortag;
//w  ww .  j  av  a2  s. c o  m
import android.bluetooth.BluetoothAdapter;
import android.content.BroadcastReceiver;
import android.content.Context;
import android.content.Intent;
import sample.ble.sensortag.config.AppConfig;
import sample.ble.sensortag.ble.BleUtils;

public class BluetoothStateReciever extends BroadcastReceiver {

    public void onReceive(Context context, Intent intent) {
        if (!AppConfig.ENABLE_RECORD_SERVICE)

        final BluetoothAdapter adapter = BleUtils.getBluetoothAdapter(context);
        final Intent gattServiceIntent = new Intent(context, BleSensorsRecordService.class);
        if (adapter != null && adapter.isEnabled()) {
        } else {

Java Source Code List