Open Source course/FIT/GPX importer

Hi App Devs,

this is a call for participation in an open source project, which tries to tackle one of the most wanted feature, not (yet?) provided by the Garmin Connect app.

Imagine you are on the go and want to upload a course to your Garmin device to follow the track. As of now, this involves uploading the gpx file to the Garmin web site, somehow create a course from it and then select "Export to device" in the mobile app.

Current State

  • working android app
  • working connectiq app
  • tracks are served from /sdcard/Download
  • GPX tracks are converted to FIT on the fly
  • https to localhost will never work, because there will never be a trusted certificate


Source code is at https://github.com/gimportexportdevs

User support thread: https://forums.garmin.com/showthread.php?376890-gimporter-gexporter-import-FIT-GPX-courses-from-your-Android-phone

ConnectIQ App: https://apps.garmin.com/en-US/apps/de11adc4-fdbb-40b5-86ac-7f93b47ea5bb
Android App: https://play.google.com/store/apps/details?id=org.surfsite.gexporter

I hereby invite you to help me to make these apps enduser usable. You can add pull request on github, or request membership in the "gimportexportdevs" organization for direct commit access.
    • convert GPX to FIT (somehow GPX import does not work for most devices (yet?))
    • [/LIST]

    I can only speak for the 735xt but that one only supports fit format, so getting the conversion from gpx to fit done correctly is likely the number one priority. There was another guy (forgot his name) that already did a gpx to fit file converter in java.
  • Why not a web app?

    Happy to contribute to this project, would be great to easily import route from RunnerMaps (or any site that offers GPX files) into the Garmin watches on a mobile phone. Just wondering, maybe I overlooked something, but why did you choose an Android app, why not simply a web app, that could be used in the browser on any phone--Android or iPhone? You could select a route on the web app, then initiate downloading from the watch.

    Another question, which I have not figured out, using PersistentContent you can read course, track, routes, waypoints, but you can only save waypoints. So once a track or course is downloaded, how to proceed?

    Kind regards,

    Harry
  • BTW, something else to consider is what a device supports - .fit, .gpx, or none, when it comes to courses for example

    See post 4 in this thread:

    https://forums.garmin.com/showthread.php?372533-Comm-HTTP_RESPONSE_CONTENT_TYPE_GPX-2-working-on-CIQ-2-2-Fenix-5s

    The native FW has to understand the file, and for example, putting a course on a va-hr really does nothing - no way to use it.

    (disclaimer - I use Basecamp to get things on a f5 and Oregon :) )
  • Just wondering, maybe I overlooked something, but why did you choose an Android app, why not simply a web app, that could be used in the browser on any phone--Android or iPhone? You could select a route on the web app, then initiate downloading from the watch.

    Can a web app start an http server? Can a web app convert GPX to FIT?

    Another question, which I have not figured out, using PersistentContent you can read course, track, routes, waypoints, but you can only save waypoints. So once a track or course is downloaded, how to proceed?


    With the makeWebRequest() call a FIT file is already saved on the watch. With the PersistentContent::get*() you can then read (no need to write, as it was already downloaded) what is available on the watch and then start another activity on those directly from the app with an Intent. So, no need to use any PersistentContent::save*()
  • If you plan on using makeWebRequest() to get the .fit on a watch, here's something to note:

    https://developer.garmin.com/index.php/blog/post/connect-iq-important-updates

    (use https and not http. The check is coming to the sim, so it may also show up in the VM)
  • If you plan on using makeWebRequest() to get the .fit on a watch, here's something to note:

    https://developer.garmin.com/index.php/blog/post/connect-iq-important-updates

    (use https and not http. The check is coming to the sim, so it may also show up in the VM)


    Gah.. what a waste of resources for 127.0.0.1 :-/
  • Gah.. what a waste of resources for 127.0.0.1 :-/


    Send your "thank you" cards to apple! :)
  • Calle warren

    Happy to contribute to this project, would be great to easily import route from RunnerMaps (or any site that offers GPX files) into the Garmin watches on a mobile phone. Just wondering, maybe I overlooked something, but why did you choose an Android app, why not simply a web app, that could be used in the browser on any phone--Android or iPhone? You could select a route on the web app, then initiate downloading from the watch.

    Another question, which I have not figured out, using PersistentContent you can read course, track, routes, waypoints, but you can only save waypoints. So once a track or course is downloaded, how to proceed?


    You then use the Intents API to launch the course or route in the native maps/navigation/activity feature of the watch or Edge. eg, in our routeCourse app we download the GPX or FIT from our web service, and then we can either immediately launch it in the device's activity using its intents, or we can subsequent enumerate the routes/courses on the device and launch one.
  • Web app

    Can a web app start an http server? Can a web app convert GPX to FIT?


    With a web app, you would not need a http server to send local files to the device; instead, the watch app can download directly from the web app. In its simplest form, the web app just has an input line where you paste a URL of any external GPX file, and the web app gives this URL to the watch. So instead of downloading the GPX file to your phone and then transferring it to the watch, you copy the link of the GPX file to the web app and let the watch app download it from the web app.

    In practice, you link the watch to the web app, so the web app will not return the URL that anyone copied, but just the one that you copied. As it knows the watch, it can also convert the file first from GPX to FIT.

    In steps:
    • The watch app calls the server to register itself, receives a long key and a short code, it stores the key and shows the code
    • The user opens the web app, enters the code, web app checks the code with the server, receives the corresponding key and stores is in local storage
    • User enters one or more links to GPX files anywhere on the web, the web app stores them on the server together with the watch key
    • Watch app calls server and receives list of tracks
    • User selects a track, watch app downloads the track from the server, depending on the model in GPX format or converted to FIT.
  • With a web app, you would not need a http server to send local files to the device; instead, the watch app can download directly from the web app. In its simplest form, the web app just has an input line where you paste a URL of any external GPX file, and the web app gives this URL to the watch. So instead of downloading the GPX file to your phone and then transferring it to the watch, you copy the link of the GPX file to the web app and let the watch app download it from the web app.

    In practice, you link the watch to the web app, so the web app will not return the URL that anyone copied, but just the one that you copied. As it knows the watch, it can also convert the file first from GPX to FIT.

    In steps:
    • The watch app calls the server to register itself, receives a long key and a short code, it stores the key and shows the code
    • The user opens the web app, enters the code, web app checks the code with the server, receives the corresponding key and stores is in local storage
    • User enters one or more links to GPX files anywhere on the web, the web app stores them on the server together with the watch key
    • Watch app calls server and receives list of tracks
    • User selects a track, watch app downloads the track from the server, depending on the model in GPX format or converted to FIT.


    But then you have, what Mappicus already has created with routeCourse.

    I want a standalone, server-less version, which can also be used "offline". There is offline routing software, where you can save the track locally. I want to be able to upload this track to the watch without uploading it first to another server.