[maemo-developers] Optimal battery life considerations in apps
From: Andrew Flegg andrew at bleb.orgDate: Thu Jul 9 00:29:21 EEST 2009
- Previous message: Duplicity 0.6.02 Has Been Released
- Next message: Optimal battery life considerations in apps
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Hi,
There are two main things (AIUI) an app should do when running on
Maemo to conserve battery life:
1) Listen for the device_state_change system_inactivity = 1
DBUS signal and stop updating until = 0 is received.
This covers the screen blanking.
2) Stop updating the screen when your app isn't in the
foreground.
(1) is trivial to implement. (2) is trickier (there's
hildon_program_is_topmost() and hildon_window_is_topmost(), but
polling to discover when you're topmost again is hideous). There
doesn't seem to be a good, simple, authoritative reference on these
techniques; demonstrating implementations in various languages (an
ideal candidate for a wiki page).
I'm willing to put together this wiki page but have two questions:
1) What is the best way of implementing (2) in C/Python/whatever?
2) In Fremantle, there's a compositing window manager. On a
desktop this means you never receive an "expose" event
since your window is always exposed on an off-screen
buffer. What is the best way of implementing (2) in
Maemo 5?
Thanks in advance,
Andrew
--
Andrew Flegg -- mailto:andrew at bleb.org | http://www.bleb.org/
Maemo Community Council chair
- Previous message: Duplicity 0.6.02 Has Been Released
- Next message: Optimal battery life considerations in apps
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
