Browsed by
Category: Technology

API Automation on your wrist with Zones

API Automation on your wrist with Zones

Thanks to an August Smart Lock and a Raspberry Pi with a 5V Relay jury-rigged to the building door buzzer, I’ve exposed two Web API endpoints that allow me to unlock my building complex door, and my front door. In the past I’ve run a website1 that I access on my mobile browser to buzz in. It was clunky and had very low WAF but it worked.

untitled_clipping_090916_121838_pm

After Google I/O in 2014 I got a Samsung Gear Live smartwatch which faithfully adorned my wrist until the charger pad disintegrated2 and it sailed off into device heaven. Its replacement was a Moto Sport 360 watch. I’d tried in the past to integrate my Web APIs with my smartwatch with the IFTTT app and the Maker Channel, but the latency of the app and the web request action was high enough to negatively impact WAF, so I needed a different solution.

So I made an app: Zones! It was a good opportunity to try out Xamarin, which allows you to make native-ish apps. Recently made free for Visual Studio users through an acquisition by Microsoft, it was an interesting experience. It didn’t seem 100% polished but it did the job.

With Zones, you configure Geofences and then link those to Web APIs. The APIs can either be auto-activated on entry/exit, or can make notifications appear on your phone or smartwatch so you can activate them manually. This has worked well for me– I turned off notifications on the phone and only show them on the watch. Now I can quickly unlock the building complex door while walking up to it without having to pull out my phone, unlock it and navigate to a website or app. And any other location-dependent web service I expose could be added to the app easily.

This app is meant for developers (or at least someone with access to some Web APIs), which is okay with me–I did it more to see what developing a native app with a wearable component was like, not to make any money (it’s free in the Play Store) or have a ton of people use it. Can you think of other things to use Zones for? Here’s a few I thought of:

  • Timeclock integration – Clock in and out when you’re at the office
  • Garage door opener – I don’t have a garage but if I did I’d probably try to do this
  • Toggle security alarm activation – Would have to expose a web service for this
  • Turn off all the lights – There always seems to be one light left on when you go to bed… although it’d have to be a connected IoT light for this to work.

Anyway, hope the app is useful to someone else and if not it was an interesting intro to Android APIs, now I know about Xamarin for writing Android apps in C#, Google Play Location Services, backgrounding Android services, and Android Wear APIs.

screenshot_090916_053154_pmCheck it out in the Play Store:
https://play.google.com/store/apps/details?id=us.m4rc.zones

 

  1. nicknamed “OpenSesame”
  2. probably due to excessive exposure to sweat from hiking, marathons, etc