Accelerometer not running when phone goes in standby

by Jonathan » Wed, 14 Apr 2010 03:03:43 GMT

Sponsored Links
 According to earlier posts, it has been suggested that the
Accelerometer will no longer run in the background when the screen
turns off and the phone goes into standby unless a partial wake lock
is held:


Other Threads

1. How can I minimize the stuttering of the graphics?


How can I minimize the stuttering of my graphics?
I am using MANY ImageView's in my program (and JUST ImageView's). I
change their positions directly, when I need to change them without
using "onDraw" to redraw everything. Is it ok, If I do not overwrite

I have in average 10 objects which I added to the mainscreen-layout.
These 10 objects are 5 trees and 5 flowers.
The trees and flowers have 5 different states and therefore 5
different ImageViews which I all added to the layout, whose just are
So I have about 50 ImageViews added to my main screen
When one of these objects changes its state, I just make its ImageView
invisible and the ImageView of the new state visible.

Is it ok to do it like that?
I realized that if I just use one ImageView for every object and
change the ressource of it when its state changes, all objects, which
are currently added to the mainscreen-layout, change their position to
(0;0). That was the reason, I have so many ImageView's added to the
Is there a better solution for that?



2. How can I get the highest framerate with this quellcode?

Depending on UI event handling to produce smooth
and accurately timed  animations is usually bad idea

In your code,  if you remove delay you are just trashing
event pipeline, so UI will (and certainly does) become irresponsive.
And if you keep it in, your delays are unpredictable
(let me Guess, you are sending messages because you can not
affect UI from non UI thread? )

I recommend to look into LunarLander sample. Basic idea for smooth
animation is:
1. Use Surface to draw ( any SurfaceHolder subclass ), you can access
it from any thread
2.  You animation loop looks OK
3. I would recommend to create  something like finite automate / state
to  provide smooth and controlled transition between game states

You drawing method would look like:
 redraw() {
        // field is prepared
        Canvas canvas = holder.lockCanvas();
        //  draw background
        canvas.drawBitmap(field, 0, 0, null);
...  draw whatever you like
// push it to the screen

have fun


3. Service thread priority

4. Cannot play audio on some phones

5. Booting Failure

6. Which IDE is better for kernel development?Is it possible in windows?

7. how do I load the new compiled kernel on my android dev phone 2 (htc)?