Confused about the actual use case for System.getDeviceSettings().phoneConnected

It appears that you can be connected to bluetooth, but phoneConnected will return false unless you open up the Connect app and wait for the watch to sync/connect to the app. You can even access Weather and phone notifications with phoneConnected returning false, so then what does this value actually correspond to?

  • It just means you're connected to the Connect app :/. There are obviously certain things you can't do unless you're connected to the app, like syncing and getting the most up-to-date daily suggested workout.

    As someone who leaves bluetooth disabled and closes Connect whenever possible, I feel you on this one.

    If it makes you feel better, the various native bluetooth connection statuses and messages are kind of blurry too, imo. I think Garmin is really just optimizing for 2 cases: no connection with app (regardless of reason) and connection with app. Everything in between is kind of fuzzy.

    For example, on my 955, here's the various states for the phone icon on the native watchface, as correlated with the phone control in the controls menu:

    State Watchface Control
    Bluetooth disabled No phone icon (*) White phone icon with slash ("Phone: Off")
    Bluetooth enabled, no phone connection White phone icon with slash Flashing white/green phone icon ("Waiting for phone")
    Phone connection but no app connection White phone icon with slash White phone icon ("Open App on Phone")
    App connection White phone icon Green phone icon ("Phone: Connected")

    The situation here is better than CIQ, but the watchface icon still can't distinguish between "bluetooth enabled, but no phone connection" and "phone connected, no app connection". To be fair, there's only so many states that can be represented with a simple icon.

    I do feel like there's cases where the watch asks you to "connect to your phone" when they mean the app and vice versa.

    (*) But there's a bug where the watchface won't transition from "no phone icon" to "white phone icon with slash" and vice versa when you enable/disable bluetooth, unless you switch watchfaces, so many people will probably be unaware of the "no phone icon" state.

  • As far as an actual use case for your CIQ app goes, knowing whether you have a connection with the Connect app would be important if your CIQ app needs to access the network (e.g. makeWebRequest.)

  • With makeWebRequest, the phone is only one of three ways they work.  There's also LTE or wifi.  .

    On the va3 LTE, you can use LTE if there's no phone. and with edge devices, wifi can be connected if you aren't recording an activity, and no phone is required.

    instead of phoneConnected use connectionAvailable, as that will tell you if any of the 3 methods  are connected. 

    What I do generally do is don't check and do the makeWebRequest, and just check if there is was an error  (-104 if no connection).  A bit simpler to do, IMHO, as it's the same logic for any error.

  • I tried connectionAvailable as well as connectionInfo[:bluetooth].state == 2 and it's basically returning the same thing as phoneConnected. So looks like I have to run the app in the background 24/7 or my watchface will assume the phone is disconnected

  • So do you have a background service in your watch face?  I'm not sure I understand...

  • Sorry I meant the Connect mobile app. If I kill the app on my phone then it stops running in the background and then the watch thinks there is no connection, despite notifications and weather services still working through bluetooth.

  • I guess a question is, why aren't you running GCM all the time?  For me, if my phone (Android) is powered on, it's running GCM.

  • So looks like I have to run the app in the background 24/7 or my watchface will assume the phone is disconnected

    Well, like I said, even native watchfaces don't distinguish between "no phone connection" and "phone connection but no app connection".

    Since you mentioned that your app is a watchface, the most obvious use case for phoneConnected is to display your own bluetooth/phone icon in the UI. Yes, it will be limited to 2 states (app connection = false / true) as opposed to 3 states like native watchfaces, but it seems that most CIQ watchfaces have a bluetooth indicator regardless.

    I guess a question is, why aren't you running GCM all the time?  For me, if my phone (Android) is powered on, it's running GCM.

    To save battery

  • To save battery

    But how much do you save?  My phone can run for days with GCM running all the time.  And plugging it in while you sleep if needed isn't a hassle If you require the GCM functionally 24-7

  • I have a habit of fully closing out of apps instead of "alt tabbing". Keeps resource utilization lower and my work environment clean. I find it annoying having to scroll through 20 apps to find the one I want to access.

    Anyways, I don't think it's a good design feature to have phoneConnected switch to false when the app is killed. You might not even close the app on purpose and just do it accidentally or by habit like myself. If anything the variable should be "appConnected" and the various connection statuses should actually correspond to the connection status instead of the app status.