On Feb 18, 11:35 am, Romain Guy <[email protected]> wrote:
> The proper way to set your thread priority is to execute the following
> line *in run() method of the thread*:
>
> Process.setThreadPriority(Process.THREAD_PRIORITY_BACKGROUND)
I am dealing with a similar scenario as Mariano describes. I built a
managed solution, i.e. mutexes to prioritize certain actions in
response to
- user input (map view and overlay manipulations as well as sensor
inputs)
- processing of data received from a web serve server on a frequent
basis,
- managing wakelocks, and a few more things I cannot remember off the
top of my head...
I maintain a heartbeat at 200ms that drives the server requests every
x seconds. CPU load w/o anything going on is at about 3%. This
increases as the server is contacted and results are being processed.
Same for (event-driven) UI inputs, of course.
Processing data is the toughest part - it takes seconds to connect and
read from the server. In order to keep the app responsive, I fill the
equivalent of a Z-buffer in the background. This is swapped in when
the operation has completed and nothing else is going on otherwise
(which normally is the case).
This means I (developer) have control over the UI experience and the
results can be optimized. Highly recommended - at the price of the
extra effort though.
JP
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
-~----------~----~----~----~------~----~------~--~---