Join GitHub today
GitHub is home to over 28 million developers working together to host and review code, manage projects, and build software together.Sign up
Add AppleWatch Overland app #65
I have a cellular Apple Watch, but I don't ever want to leave my iPhone because I use it to track my location. I'd love to be able to just go out with my Apple Watch and continue to track my location. On the Series 3 Apple Watch you can track GPS with Cellular on for 4-5 hours. Series 4 increases that to 5-6 hours. Definitely not "all day" tracking, but helpful for exercising and even maybe just running errands around town and tracking driving locations, etc.
I'm thinking through a couple of things:
Compass, as well as this app, are all written with the assumption that there is only one source of location data. There are a bunch of edge cases that come up when you don't make this assumption which I wanted to avoid.
For example, I was able to simplify the storage format in Compass a ton by working under the assumption that data is always written in order. This allows me to use a drastically simplified filesystem structure instead of requiring a fancy database that can allow inserts at arbitrary locations.
Also querying the data becomes simpler when there is only one answer to "where were you at time X".
I'm not sure the best way to have the watch and phone coordinate on this, so it's worth a discussion.
Sounds good. I felt like that was probably the case but I didn't want to overthink it if it wasn't an issue.
You can push configuration settings between the Apple Watch app and the iPhone using a specific method. Essentially you could have a setting in the config that gets pushed between the apps that is called "activeDevice".
If you were tracking location on the phone, and you clicked to "start" tracking data on the watch. You could then change the
When the phone received the updated configuration, it would check the activeDevice against it's own UUID and if it doesn't match and it is currently tracking location, it would turn off location tracking and push all the data currently on device to the server. The same could happen in the reverse if you pick up the phone and turn on tracking.
I think the only potential issue is do they overlap for a minute or two if the watch starts tracking and it takes a couple minutes for the data to get pushed to the phone and for it to compare the UUID, etc. The watch could have tracking data that overlaps with the last couple of minutes from the iPhone.
There are a couple ways that come to mind that we could attempt to fix that:
Sync Tracking Times Tactic
The phone receives the configuration and stops tracking, sets the current time to the
When the watch receives the config option from the phone, it would check to make sure the lastTracked time has passed and it would begin tracking.