Home

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.
Comments | Todd Ogasawara | June 06, 2012 02:48 PM

E-mail | Share

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.



Currently we allow the following HTML tags in comments:

Single tags

These tags can be used alone and don't need an ending tag.

<br> Defines a single line break

<hr> Defines a horizontal line

Matching tags

These require an ending tag - e.g. <i>italic text</i>

<a> Defines an anchor

<b> Defines bold text

<big> Defines big text

<blockquote> Defines a long quotation

<caption> Defines a table caption

<cite> Defines a citation

<code> Defines computer code text

<em> Defines emphasized text

<fieldset> Defines a border around elements in a form

<h1> This is heading 1

<h2> This is heading 2

<h3> This is heading 3

<h4> This is heading 4

<h5> This is heading 5

<h6> This is heading 6

<i> Defines italic text

<p> Defines a paragraph

<pre> Defines preformatted text

<q> Defines a short quotation

<samp> Defines sample computer code text

<small> Defines small text

<span> Defines a section in a document

<s> Defines strikethrough text

<strike> Defines strikethrough text

<strong> Defines strong text

<sub> Defines subscripted text

<sup> Defines superscripted text

<u> Defines underlined text

BYTE encourages readers to engage in spirited, healthy debate, including taking us to task. However, BYTE moderates all comments posted to our site, and reserves the right to modify or remove any content that it determines to be derogatory, offensive, inflammatory, vulgar, irrelevant/off-topic, racist or obvious marketing/SPAM. BYTE further reserves the right to disable the profile of any commenter participating in said activities.

Tune In to BYTE
Facebook Twitter LinkedIn Newsletter RSS
Whitepapers
whitepaper
In this paper you will learn the five trends shaping the future of enterprise mobility. Learn how the rise of social media as a business application, the lurring between work and home, the emergence of new mobile devices, the demand for tech savvy employees and changing expectations of corporate IT will fundamentally change the workplace.
whitepaper
In a survey of more than 1,700 information workers (iWorkers) in North America, notebooks, desktops, and smartphones were found to be “must-have” devices, while tablets, slates, and netbooks were relegated to “nice-to-have” status, according to a commissioned study conducted by Forrester Consulting on behalf of Dell and Intel.
Sponsored by: Dell
Upcoming Events