Developer Blog

Disc IQ: The Connect IQ Disc Golf App

05/12/15 @ 10:19 AM

Our team was interested in seeing how we could combine some APIs together to push the boundaries of the SDK. With the single instruction of “make a watch app that uses a companion app” from our fearless Alpha Monkey we decided to set out writing a disc golf sample.

The basic idea was to use an Android app to create a course on a phone, send it to the watch via the Connect IQ companion SDK, score the course on the watch and then send the completed scorecard back to the phone. This would provide us a great way to get a more comprehensive look at the SDK and, of course, document what we found useful along the way. Without further ado, here are some of the key findings we made.

Using a Companion App
After downloading the Connect IQ Android Mobile SDK, creating an Android project based off the Android Comm sample included in the companion SDK and including the necessary jar file we had a simple app which sent a static “course” to the phone up and running in no time. Within the Connect IQ watch-app we were able to easily create a new project based off the Connect IQ Comm sample (included in the Connect IQ SDK samples folder) which received the course and displayed its name. As our only instruction from the Alpha Monkey was to do this, things were looking great.

App Design and Memory Management

If you have a mobile background you are probably used to the idea of pushing multiple views on top of each other. The problem with this approach in Connect IQ is that it can quickly drain the system resources; using switchToView() whenever possible helps alleviate this problem. In this app we decided that because the splash, course and round views were completely independent of each other we would design the app to switch between those views

User Input From Views
The input in our app is very simple. We wrote our own number picker to input a user’s score. Remember to keep your user input as simple as possible. If a user has to input too much information they will just end up using their phone instead.

Using the Layout System
The last interesting bit of the app was porting the views to work with a fenix 3 (the app was originally created for the vivoactive). The resource system allows you to specify device specific layouts; then at compile time the layout that matches the device being compiled for will be used. By using simple layouts for each view it only took us about an hour to create new layout files for the fenix 3 and get everything hooked up. A good separation of UI and logic code was also a key factor here.

You can download the Connect IQ app from the Connect IQ Store and the Android partner app from the Play Store. The source code for both applications is available on GitHub.

Thank you!
o/\o The Connect IQ Team

Categories: Connect IQ SDK