Watchface to Phone Communications

I was hoping to build my own companion application to a watch face I have developed to allow the user to update watch settings similar to Connect IQ when it changes settings for a watch face.

It does not appear that an application that extends UI.watchface can support that level of communication with the phone ? The application needs to be an app or a widget rather than a watchface. I was looking at the new background function thinking I may be able to use a web request to fetch a json string with all the settings however that does not seem to be allowed from a watchface either.

With the new 2.4 SDK if you use the application.storage functions in one application would those settings be available to be used in another application or is that underlying database partitioned by application ?

Any ideas on a phone application communicating to watchface or writing a file on device (or url) for the watchface to access ?
  • With a watch face you can do communications from a background process, but as most, every 5 minutes (same with all backgrounding). In a widget or watch app, you can do it in the main process as well as a background one One of the common things done right now with watch faces is to pull weather data and display it (JSON data). I've seen a few watch faces where they are getting data (or in development to do so) from a companion app.

    The object store, be it the setProperty/getProperty or Application.Storage version, is only available to the app that created it. It can't be used to pass info between two different apps.

    To see the basics of how to do backgrounding, I did a Guest Blog Post that goes into it and links to a thread here with an ultra simple sample (no comm involved). and a bunch of Q&A's
  • I have kind of a basic question.. What are you trying to do that you can't just do with regular app settings? That might help in finding a solution.
  • Thanks Jim. I did use your example of how to do background processing to write a little test app. It was a great example, thanks! I was able to get the settings by writing them to a url and then using a makewebrequest I was able to pull the JSON data into the application. I didn't like that solution as it would mean the user would have to have to define a url key in their settings since I could not see a way to generate a unique key for each user and device in both my app and the device.

    The watch face I have has lots of different settings and some users get a bit confused trying to use them despite the web documentation. There are also some features that can conflict with one another. For example the user can set different colours for hands, second and minute indicators, icons, data dials, logo etc. however if you want to have an always on second hand for 1hz device I need to save a buffer for the device but this can only be a maximum of 4 colours in the palette due to memory usage. If the user defines more than four different colours and turns on the second hand then some colours will just default to whatever the device can display, usually dark grey. Naturally I get an email telling me that my application does not work and is rubbish! So what I wanted to do was to be able to build in some of those edit rules in my own application as well as offer users pre-configured setting to get the 'look' they want.

    This is the web site with some examples of the various settings and how they control the look of the face.

    http://www.alteredpt.com.au/GMT4-Home.html

  • For me, I'd stick with the standard settings, and handle a few things in the code. With the number of colors and the 4 color palette for 1hz for example, in the code, I'd just say that the color for the hour hand would be used for the minute and second hands if 1hz. And do something similar with other things to stay at or below 4 colors. Have the code protect itself no matter what a user sets. and just document it for the users.

    Much easier (and likely less problematic) than trying to do your own app settings, IMHO.
  • Thanks Jim. Good advice. I may just stick with that approach since building iOS and Android app seems like a lot more work...