Problem Show/hide Bluethoot icon

Former Member
Former Member
Hi, i have a problem when i try to show a bluethoot icon, when i install the program in the watch works well, but a coupple minutes later the button disapears even when the watch is conected to the celphone. maybe im doing something wrong, please help.

var btImage;

//! Constructor
function initialize()
{

btImage= Ui.loadResource(Rez.Drawables.BluethootIcon);

}

function onUpdate(dc) {

//Draw Bluethoot
var phoneConected = Sys.getDeviceSettings().phoneConnected;
if(phoneConected==true)
{
dc.drawBitmap((screenWidth/2)+10,(screenHeight/4)-5,btImage);
}

}
  • Hi, i have a problem when i try to show a bluethoot icon, when i install the program in the watch works well, but a coupple minutes later the button disapears even when the watch is conected to the celphone. maybe im doing something wrong, please help.

    var btImage;

    //! Constructor
    function initialize()
    {

    btImage= Ui.loadResource(Rez.Drawables.BluethootIcon);

    }

    function onUpdate(dc) {

    //Draw Bluethoot
    var phoneConected = Sys.getDeviceSettings().phoneConnected;
    if(phoneConected==true)
    {
    dc.drawBitmap((screenWidth/2)+10,(screenHeight/4)-5,btImage);
    }

    }


    Make sure the Garmin Connect app on your mobile is open and running.
    As far as I know the phoneConnected property is true when this is the case.
    When closing / killing the app, it is "disconnected" although your phone Bluetooth shows it is connected.
  • What happens in the simulator? Does it react properly when you toggle "phone Connected" in settings on the simulator, if this is a watch face, togging low power mode?

    Based on code you posted, I can see this appearing, but not going away, as it's not doing a dc.clear() at the start of onUpdate(). Could it be that under some conditions you bypass the code that displays the icon? (like checking for low power mode or something similar)
  • Former Member
    Former Member over 9 years ago
    That's rigth

    Make sure the Garmin Connect app on your mobile is open and running.
    As far as I know the phoneConnected property is true when this is the case.
    When closing / killing the app, it is "disconnected" although your phone Bluetooth shows it is connected.



    Hi, i did what you say, and this is it, when i close the Connect application the bluethoot icon dissapears. Thanks for the tip. ;). Do you now, other way to show the bluethoot status conecction without depend the Connect application. Thanks you ;););)
  • Hi, i did what you say, and this is it, when i close the Connect application the bluethoot icon dissapears. Thanks for the tip. ;). Do you now, other way to show the bluethoot status conecction without depend the Connect application. Thanks you ;););)



    Not as far as I know.
    We should ask Garmin to add something to the SDK or fix it if it is a bug (ever seen so many "i" s in adjacent words!) :-)
  • Hi, i did what you say, and this is it, when i close the Connect application the bluethoot icon dissapears. Thanks for the tip. ;). Do you now, other way to show the bluethoot status conecction without depend the Connect application. Thanks you ;););)


    The only way a watch can (or should, really) connect to a phone is with the GC Mobile app running, and the watch paired in that app. If paired in the phone settings in addition to GCM, the BT is kind of flakey at best. Watches use "Bluetooth Low Energy", which isn't like the BT for headphones, etc.

    Checking "phoneConnected" is the way to see if the watch is connected with BT. If phoneConnected is false, nothing can be done over BT to the phone.

    Are you looking for a way to see if BT is enabled in the system settings? Today, there is no way to know that in CIQ
  • Former Member
    Former Member over 9 years ago
    Thanks

    The only way a watch can (or should, really) connect to a phone is with the GC Mobile app running, and the watch paired in that app. If paired in the phone settings in addition to GCM, the BT is kind of flakey at best. Watches use "Bluetooth Low Energy", which isn't like the BT for headphones, etc.

    Checking "phoneConnected" is the way to see if the watch is connected with BT. If phoneConnected is false, nothing can be done over BT to the phone.

    Are you looking for a way to see if BT is enabled in the system settings? Today, there is no way to know that in CIQ


    Ok.. thanks you for you reply, i hope the garmin developer's team fix this 'Bug', i goingto let the code asking just for the phone connect.;)4892