[maemo-developers] Optimal battery life considerations in apps

From: Andrew Flegg andrew at bleb.org
Date: Fri Jul 24 14:12:22 EEST 2009
On Fri, Jul 24, 2009 at 11:57, Anderson
Lizardo<anderson.lizardo at openbossa.org> wrote:
> On Fri, Jul 24, 2009 at 4:54 AM, Andrew Flegg<andrew at bleb.org> wrote:
>
>> Yup, indeed. (PyMaemo doesn't expose the method, but you can get the property).
>
> Hmm, here I can see this method just fine (Scratchbox X86 target):
>
> SBOX> run-standalone.sh python2.5 -c "import hildon; print
> hildon.Window.get_is_topmost" 2>/dev/null
> <method 'get_is_topmost' of 'hildon.Window' objects>

Hmm, I'm sure I tried that but it didn't work. I'll try again once I
reboot with vdso disabled (or sort out a new, easy-to-use virtual
machine Scratchbox image with developer-oriented host/guest
integration).

Where's the latest PyMaemo documentation and API reference? Using the
C one is fine in most cases, but I'd like to see the Python specific
stuff wherever possible. The following seems to link to bora-level
documentation for Python-Hildon (and doesn't include HildonWindow):

    http://pymaemo.garage.maemo.org/documentation_fremantle.html#documentation

>> However, what's the best way of detecting when you come *back* to the
>> foreground? I didn't get a property-change event (although this could
>> be due to a PyMaemo bug rather than a Hildon one).
>
> If you could get a property-change event for any other property, I
> doubt that's a PyMaemo specific bug, because there would be no special
> handling for this specific property. If no property change at all is
> triggering this event, than that would be a bug :)

The only property change event I was looking for was this one; and
trying it on Diablo (without app switching, testing visibility on
Fremantle is... tricky at best) with the code here [search for
"do_property_event"]:

    https://garage.maemo.org/plugins/scmsvn/viewcvs.php/trunk/packages/horizon.pkg/framework.py?revision=280&root=mud-builder&view=markup

It's my first real PyMaemo app, certainly my first green-field one
which really needs to make sure it doesn't waste battery life.

Thanks in advance,

Andrew

-- 
Andrew Flegg -- mailto:andrew at bleb.org  |  http://www.bleb.org/
Maemo Community Council chair
More information about the maemo-developers mailing list