Plug-in Conditions
The API currently allows different reactions if a situation starts. It would be great if you could extend the API, so that I can write my own condition (which would trigger a situation then).
There are already numerous requests for new / different conditions and this would be a way to integrate them quickly.
Preliminary support for plug-in conditions is now supported in Locale 1.0. Documentation of these APIs is available at http://www.twofortyfouram.com/developer.html
Locale 1.0 is available on the Android Market today in countries that support paid apps. Full release notes are here: http://www.twofortyfouram.com/notes.html
3 comments
-
jamesh
commented
I too am looking for condition plugins.
There are so many conditions which people are asking for, and this will only increase (personally, looking for an SMS query condition which will fire when contains a certain word, but this could be email from a particular person, or twitter, or... ).
There are two very naïve ways I can think of to mitigate concerns with battery/performance, and Locale getting the blame. Of course, these assume no knowledge of how Locale works now or how it is has been optimized and evolved in the past.
* make the polling conditions only fire intents when true; if the plugin is polling too much, then it will get the blame. The market place will take care of warning people not to use these plugins. From your comment above, this seems to be what is happening already.
* make the conditions declare performance (or measure it empirically), then rearrange the compound condition to poll the most costly conditions first.A final point in response to the battery/blame problem is that the existing plugins are quite capable of draining the batteries even when fired once.
-
AdminCarter
(Admin, two forty four a.m.)
commented
Hypothetical: Locale listens to an Intent from a plug-in condition. That plug-in could send Intents with arbitrary frequency (e.g. once per second), keeping Locale always active. So both Locale and the plug-in would be using up the battery. To a user, it may not be clear that the plug-in is actually at fault.
-
kristopher.dick
commented
These battery life/performance issues would be the responsibility of the plug-in, though. Locale should be accepting a condition intent from condition plug-ins. Then all you're left dealing with is the id and value of the condition. Some concern regarding perception of locale as a resource hog resulting from greedy condition plug-ins is understandable. However, with the Donut power manager features, this is readily addressed with a "my phone is slow, eating batteries, etc" button that automatically links to the Battery Use page.