on{X} Provides Userscript Like Customization for Your Phone

Tim Lytle, July 19th, 2012

Wasn’t really expecting this – Microsoft recently released an event driven API for mobile devices, it’s only available on Android, you can only sign up with your Facebook account and the scripting language is Javascript.

Okay.

While I can’t answer some of the questions this raises, I did take it for a quick spin. For a while, I’ve wanted some way to automatically check a route before my wife goes to work. The commute is all highway, so any incident drastically changes the drive time. I’m sure there’s some application out there that does that (well, I assume there should be), but would it be automated? Can I easily set it to the two evenings she’s on shift? How well can it be configured?

Here’s how I did it with OnX in less than 100 lines of Javascript, for the most part copy and pasting from the documentation. To keep the scrolling to a minimum it’s just the main function – check the gist out for the full script.

Right now OnX does a few things. It allows subscribing to events on the mobile device – things like an incoming call or SMS, changing unlock state, moving in or out of a geo-region. It also allows you to access information about the device, instead of subscribing and waiting for an event, various statuses can be queried – battery levels, location, network information. Finally, OnX provides an interface to act on the device – sending email or SMS, alerting the user, even opening applications.

OnX also includes a basic HTTP Client, making integration with other APIs possible. There isn’t any callback/webhook support that I can find, so at this point any interaction must be initiated by the device.

Although describing new technology by saying it’s like the “X” for “Y” is a bit overused, in this case it may actually be beneficial to describe on{X} as Userscripts/Greasemonkey for Android (and I have to assume it will find its way to Windows Phone). And while – like userscripts – it’s possible to publish your scripts at any pastebin style site, on{X} also allows you to publicly publish your scripts on the site.

Since it’s really a userland API, the contract developer in me doesn’t see much usefulness for the projects I work on; however, the hacker/tinker in me is really looking forward to setting up interesting on{X} scripts, and seeing what other users build.

Tags: Examples
Both comments and pings are currently closed.

Comments are closed.

Follow the PW team on Twitter

ProgrammableWeb
APIs, mashups and code. Because the world's your programmable oyster.

John Musser
Founder, ProgrammableWeb

Adam DuVander
Executive Editor, ProgrammableWeb. Author, Map Scripting 101. Lover, APIs.