That sounds very sophisticated.

I will try to see how far I can with the current approach and the
latency it brings with it. You approach feels too much like doing the
operating systems job, which is probably fine and necessary for your
case.
In my case the latency thing is just an annoyance that can be kept at
bay with the easy approach with the background prio and I will rather
waste some more brain cycles on other stuff like hunting application
logic bugs ;-)

On Wed, Feb 18, 2009 at 9:22 PM, JP <[email protected]> wrote:
>
>
>
> 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
-~----------~----~----~----~------~----~------~--~---

Reply via email to