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.
  • After some coding I now have a working android and connectiq app :-)

    I will publish both in the stores in the next days.

    The android app will serve GPX and FIT tracks in /sdcard/Download and will convert GPX to a FIT course on the fly.

    With the connectiq app you can scroll through the list of tracks and download any of them. You can later start any activity and use the downloaded course. The course name of the GPX converted files is the file name.

    Currently I inject some course points in the FIT. My guess is that it will help, if you resume the course.

    I tried https, but a certificate for "localhost" will never be valid. So the web request with https://localhost/... always fails :-/

    I hope this app combination is useful enough, so that I will see code contributions :)

    Side question:
    Is there a generic connectiq dialog to select items from a list? I know there are menus, but the amount of entries is limited. Just asking, so that on e.g. Edge devices we would not have to create a completely different code path.
  • It might be best to move this to a thread into the CIQ Showcase forum so non-developers will see it, interact there, etc.
  • great!
    (I've added links to your source code repo's on http://starttorun.info/connect-iq-apps-with-source-code/ and also opened a section on Android Companion Apps :) )
  • 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.


    Hmm, in my App I do Comm.makeWebRequest(... responseType => Comm.HTTP_RESPONSE_CONTENT_TYPE_FIT ..). It succeeds and I can later see the downloaded course, if I try to start an activity with the course.

    I want to offer the user System.exitTo(course.toIntent()), but, if I do PersistedContent.getCourses() after the makeWebRequest I only see the old course.. not the new one.

    Do I have to wait some random time after makeWebRequest???

    Btw, what is returned as "data" for HTTP_RESPONSE_CONTENT_TYPE_FIT in the callback?
  • Hmm, in my App I do Comm.makeWebRequest(... responseType => Comm.HTTP_RESPONSE_CONTENT_TYPE_FIT ..). It succeeds and I can later see the downloaded course, if I try to start an activity with the course.

    I want to offer the user System.exitTo(course.toIntent()), but, if I do PersistedContent.getCourses() after the makeWebRequest I only see the old course.. not the new one.

    Do I have to wait some random time after makeWebRequest???

    Btw, what is returned as "data" for HTTP_RESPONSE_CONTENT_TYPE_FIT in the callback?


    Ah, no my fault... did a Ui.popView(Ui.SLIDE_IMMEDIATE) after System.exitTo() so I never saw the Dialog :rolleyes:
  • Alright... The track selector is now a Menu with the last item being "[...]" if there are more entries.

    I also added the dialog to start the course immediately.

    Things are looking pretty now. Will test on my Edge1000 tonight and upload the apps to the stores ;)

    The android app now has the file list sorted and a minor bug with the elevation in the FIT converter was also fixed.

    Would be happy, if someone could test against devices != [ Fenix5, Edge1000 ]
  • Hello, nice to meet you. I'm in the middle of the development of an Android/iOS app using Mapplic to show gpx trails. I'm using NativeScript. Do you have any hint to be able to send a gpx trail to my Garmin from this app? Should I publish my own Garmin app to integrate it or maybe is possible to install gimporter? I see gimporter is only compatible with Android device, isn't it?

    Sorry, I probably just made some confusion but it'm quite a newbie here on garmin related things.

  • Some Garmin devices only let you download fit; some only allow you to download gpx. (This is slightly odd because some Garmin devices can convert gpx/tcx files into fit format.)

    The GImporter IQ app has a corresponding GExporter Android app. The GExporter app can convert gpx to fit. This app is a webserver that provides a JSON array for the list of files in a folder on the Android device.

    I have an IQ app (GRouteLoader) that does what GImporter does (and other stuff).

    Ideally, you'd do something that would work with existing apps.

    There are already quite a few iOS and Android apps that show gpx files. These apps also do much more than just that.

  • Thanks for your feedback .

    I aim to create an app for a regional institution to offer for free some certified trails. That app, should show some point of interests on the trails, must permit to download gpx and in the end should be possibile to send the gpx to your Garmin if you have one.

    I see that Wikiloc, for instance, has a button "send trail to garmin" which works because they have their own Wikiloc app on the Garmin marketplace. I really don't understand if I have to create my own app on the Garmin marketplace or not.

    Since I just need to send the gpx file, I thought it was possible to send the gpx to any Garmin app with an open source protocol, in order to push some gpx to the Garmin. But I'm not sure this is correct, or if my own Garmin app as an interface.