Back to project page ELM327.
The source code is released under:
Apache License
If you think the Android project ELM327 listed in this page is inappropriate, such as containing malicious code/tools or violating the copyright, please email info at java2s dot com, thanks.
package com.grabtaxi.elm327; //w w w . j a v a 2 s . c om import android.bluetooth.BluetoothDevice; import android.content.BroadcastReceiver; import android.content.Context; import android.content.Intent; import android.util.Log; import de.greenrobot.event.EventBus; /** * Created by admin on 12/15/14 */ public class DeviceBroadcastReceiver extends BroadcastReceiver { private static final String TAG = "DeviceBroadcastReceiver"; @Override public void onReceive(Context context, Intent intent) { String action = intent.getAction(); if (BluetoothDevice.ACTION_FOUND.equals(action)) { BluetoothDevice device = intent.getParcelableExtra(BluetoothDevice.EXTRA_DEVICE); EventBus.getDefault().post(device); displayLog("Device found: " + device.getName() + " (" + device.getAddress() + ")"); } } private void displayLog(String msg) { Log.d(TAG, msg); } }