Bypass Garmin's System.getDeviceSettings().phoneConnected

Hi all,

I am developing a Data Field that allows runners in a race to send information to their parent's/coach's phone via bluetooth.  I have also developed a companion app for iPhone and Android.  The product works, sometimes... Because Data Fields are only allowed to open background (and thus send bluetooth information) once every 5 minutes, my app checks System.getDeviceSettings().phoneConnected before launching the background to fire the data to the phone.  My problem is, System.getDeviceSettings().phoneConnected seems to require Garmin Connect to be open in the background.  Thus, even though my phone app will state that the watch is connected, if Garmin isn't open, my watch has no idea that it is actually connected to my phone.  My question is, is there a way for my watch to detect if my phone is connected without having to use the background?  

Thanks in advance,

Lance

  • Update: It appears that the notification count (System.getDeviceSettings().notificationCount) can be used as a workaround to detecting if a phone is connected, because the notification count is generated on the watch itself.  If there is a change in the notification count, the watch will know that it is connected to the phone, and Garmin Connect doesn't even have to be open.  Still, detecting a change in the phone's notification count is unreliable and slow.  I know that the watch itself knows that it is connected to my phone, even if System.getDeviceSettings().phoneConnected is false, because the little phone icon is solid green (I have a vivoactive 3), and isn't alternating green and white.  Any ideas?

  • i don't have phoneconnected in the background service.  it's in my main compute(info) method in my app.   not sure if bluetooth comms require background service or not, but wouldn't your use case require the parent/coach's phone be really close?  bluetooth doesn't have a very long range.

    phoneconnected should indicate if the phone is paired AND garmin connect is running.  i get lots of users saying phoneconnected is returning false even though they are paired, and the fix is to open garmin connect to let it run in the background of the phone.  that seems to be an undocumented requirement.

    my main complaint is even if phoneconnected returns true, you have no idea if the phone has service or not.  so i fire off a webrequest and if there is no service, i have to wait 5 mins again.  i wish there was a way to get signal strength before making the call.

  • Scottbeam, thanks for your response! I totally agree that phoneconnected could be made a whole lot better. The main reason I don’t want to use phoneconnected is that it takes a long time after the phone is connected for phoneconnected to return true. For example, if I disable Bluetooth with my watch nearby, then enable it, my app will almost instantly indicate that the watch is in range and paired. However, my watch takes 2-3 seconds to indicate that phoneconnected has returned true.  The theory with my app is that the Bluetooth will be sent when the runner runs by his coach. In a race, 2-3 seconds could be the only window I have to transfer the data. If I take up all that time just waiting for Garmin Connect to acknowledge my watch is in range, by the time I fire the background, the phone is out of range.  That’s another reason why I’m trying to find a workaround that doesn’t require Garmin Connect. 

  • I think the bigger flaw in your plan is the runner doesn’t have the phone, the coach/parent does. Whose phone is that?  If it’s the coaches then the athletes garmin isn’t going to be paired with that phone. It’s paired to the athletes phone. Unless the coach is going to hold the athletes phone instead?  You can only pair one garmin to one phone at a time. 

  • Yes, this is something I am looking into. I have accidentally paired my Garmin with two phones before... I have no idea how I did it. ;) But this is still a future problem. If the app doesn’t work with my phone (it hasn’t yet in a race), it surely won’t work with someone else’s phone! 

  • Alright, my app is now in public beta!  If anyone would like to test it (and see what I mean about the delay), you can download the app and it’s companion app below. 

    Connect IQ data field:

    apps.garmin.com/.../e8f5d135-6524-48c4-88e5-5afb6f69c08f

    Android app:

    play.google.com/.../details

    Thanks guys!

    -Lance