Microsoft on{X} For Android: A Visual Tour
Microsoft--yes, Microsoft--has a new Android programming platform called on{x} and it's great. Developed by the Microsoft R&D team in Israel, on{x} lets anyone turn an Android phone into an uber event-driven notification gadget.
Unfortunately, the "Launch the music app when I am walking" script didn't work for my Android phone, a Nexus One. It's probably because the software underlying the modeOfTransport API call requires combination of an accelerometer and a gyroscope for determining when someone is walking--and the Nexus One does not have a gyroscope. So I decided to write my own script, above. on{X} code makes use of system triggers to create simple but potentially powerful and useful apps. I wanted a rule that would tell me when my phone's battery was fully charged. To do this, I wrote a script to make use of the "battery" API to trigger my code when a change in battery charge percentage is detected. My code checks if the battery is fully charged when a change occurs and then notifies me. Note that the code does not go into an endless loop when testing or if a charge is greater than 99% because the main trigger is the change of the battery charge level from 99 to 100%. The code inside of that trigger only gets executed when the charge level changes. The on{X} Web-based editor is very good. You can see from my screenshot that it provides syntax color coding. It also offers brace matching and syntax checking. It warned me I was missing a semi-colon.
E-mail | Share