Is it possible to use Communications.makeJsonRequest in Widget (fenix3)?

Former Member
Former Member
Hi, playing around with SDK and my fenix 3 watch.
When I'm trying to retrieve some information from rest service with Communications.makeJsonRequest in my Widget I get two crossed lines on the screen.
Does it mean that this API is not supported? Yet? This page says http://developer.garmin.com/connect-iq/what-you-can-build/ that "Use BLE to communicate with mobile phones/Internet" is available in Widget.
  • I didn't think that widgets and apps are supported on devices yet. Are you running this widget under the emulator?
  • Former Member
    Former Member over 10 years ago
    I didn't think that widgets and apps are supported on devices yet. Are you running this widget under the emulator?


    I was trying to use it directly on device.
    As I understand to use Communications.makeJsonRequest on emulator you need to have an Android emulator running with installed Garmin Mobile Connect. Is there any instructions how to install Garmin Mobile Connect on emulator?
  • Former Member
    Former Member over 10 years ago
    outcoldman,
    The Fenix 3 isn't quite available to the public yet, so this forum isn't (yet) a good resource for that device. If you contact us via internal channels, we may be able to provide more detailed feedback.

    The Communications API is available to Widgets, but may not be enabled on Fenix 3 at this time.

    The makeJsonRequest API does not require a connected Android phone with ADB. This is only required for the transmit and mailbox Communications APIs.
  • Former Member
    Former Member over 10 years ago
    The Fenix 3 isn't quite available to the public yet.


    Not sure that I fully understand this statement. I purchased my fenix3 watch at REI as many others without any special programs or anything. So I guess I'm part of the public consumers. What did you mean by this statement? And what are the internal channels?

    The Communications API is available to Widgets, but may not be enabled on Fenix 3 at this time.

    This page says that Fenix 3 is supported http://developer.garmin.com/downloads/connect-iq/monkey-c/doc/Toybox/Communications.html
    Any estimates when it will be on Fenix 3?

    The makeJsonRequest API does not require a connected Android phone with ADB. This is only required for the transmit and mailbox Communications APIs.

    Still I'm curious how to install Garmin Mobile Connect on android emulator? Where I can get it if if I will want to build something with my phone and watch?
  • REI does have a limited quantity for sale right now, but I don't think this is well-known. :)

    You can download Garmin Connect Mobile from Google Play:

    https://play.google.com/store/apps/details?id=com.garmin.android.apps.connectmobile&hl=en

    Information about developing a mobile app for use with Connect IQ is included in the Connect IQ SDK (look in the 'android' subdirectory).
  • Former Member
    Former Member over 10 years ago
    Sorry, I knew Fenix 3 was going to hit stores very soon, but didn't think there were any out there yet. (So hey, you might be the first guy to buy one.)

    There should be a software update that enables the Communication module, I will try to make sure that is happening soon.
  • Former Member
    Former Member over 10 years ago
    REI does have a limited quantity for sale right now, but I don't think this is well-known. :)

    You can download Garmin Connect Mobile from Google Play:

    https://play.google.com/store/apps/details?id=com.garmin.android.apps.connectmobile&hl=en

    Information about developing a mobile app for use with Connect IQ is included in the Connect IQ SDK (look in the 'android' subdirectory).


    Yep, but there are 0 android emulators with Google Play installed ;)
    Of course it is possible to side load Google Play Services, but this against Google terms.

    I was just curious if you had some special build of Garmin Connect Mobile for developers, which they can install without Google Play.
  • Former Member
    Former Member over 10 years ago
    Sorry, I knew Fenix 3 was going to hit stores very soon, but didn't think there were any out there yet. (So hey, you might be the first guy to buy one.)

    There should be a software update that enables the Communication module, I will try to make sure that is happening soon.


    np, thank you for update!
  • Former Member
    Former Member over 10 years ago
    So I tried to just use "Communications.makeJsonRequest" from Widget - and my method "onReceive" is not getting called. After I tried several times I started to receive Communications.BLE_QUEUE_FULL which I guess is expected. Anything special I need to do to actually make it work? Maybe I need to place this call somewhere in special place?

    I have <iq:uses-permission id="Communications"/> in my manifest, also the call I'm trying to make is very simple
    Communications.makeJsonRequest("api.openweathermap.org/.../weather", {"lat"=> 22f, "lon"=> 23f}, {}, _view.method(:onReceive));

    Btw, what is the difference between Communications.makeJsonRequestNative and Communications.makeJsonRequest?

    Also I tried to download Garmin Connection Mobile on Genymotion, but getting "Your device isn't compatible with this version". Any workarounds? Other ways to use Android with Garmin Connect Mobile?
  • Did you have any luck just building and running the Weather example in the emulator? Last I checked, that code worked most of the time.