ykasidit / bluetooth_gnss

Bluetooth GNSS app on Google Play Store
https://play.google.com/store/apps/details?id=com.clearevo.bluetooth_gnss&hl=en&gl=US
GNU General Public License v2.0
72 stars 21 forks source link

Auto start on bt connect #1

Closed auricgoldfinger closed 3 years ago

auricgoldfinger commented 3 years ago

On my phone, the GPS reception is very unreliable. Sometimes it's very accurate, sometimes it just doesn't work. I bought an external GPS receiver and I am using Bluetooth GNSS to make the connection. It works perfectly!

However, I sometimes forget to make the connection through the app. So when I step into my car, I enable the bluetooth receiver and start driving, only to find out several minutes later that there isn't a connection with the phone.

In this change, I introduced a broadcast receiver that listens for the intent bluetooth.CONNECT and when received, it starts the connection with the GPS receiver. By default, the app configuration is used to make the connection, but there's also a possibility to override it with data in the intent. This way, you can configure an automated task (e.g. using Tasker) which triggers when a device is connected. E.g.: the mac address of the device can be transferred which is handy when you have multiple bluetooth devices.

Changes: