1

Am building a app that gets data from the bluetooth device. So my android mobile has to be pair with the bluetooth device to start the app. So am trying to implement the logic of launching my app after the user manually pairs the bluetooth device and his mobile. I did find a open source project,

https://github.com/evancharlton/bluetooth-launcher

but this is not working. Has anyone worked on this logic or can help me with an idea to start with ?

Vivek C A
  • 1,045
  • 1
  • 8
  • 14
  • Start by learning service here => http://developer.android.com/guide/components/services.html – Neige Jan 14 '15 at 10:48
  • See: http://stackoverflow.com/questions/14228289/android-device-bluetooth-pairing – Riad Jan 14 '15 at 10:54

1 Answers1

0

You can write a braodcast receiver that will listen for a bluetooth connection and onReceive, it can check whether the connection is with the device you need. And if so, then it can open your app from the broadcast using the intent.

You need to add these actions in manifest for your receiver

<action android:name="android.bluetooth.adapter.action.STATE_CHANGED" />
<action android:name="android.bluetooth.device.action.UUID" />
<action android:name="android.bluetooth.device.action.BOND_STATE_CHANGED" />

And this is the permission you would have to add

<uses-permission android:name="android.permission.BLUETOOTH" />