This would be a solution if I didn´t have to syncronize the UI updates
with the audio playback.
Unfortunately in this case I have to refresh the UI according to the
audio processed and in some cases 7 times per second. Right now I
barely can handle 5.

On 29 mar, 00:47, Streets Of Boston <[email protected]> wrote:
> Maybe you can code your app differently. Instead of publishing your
> progress by your background thread (pushing progress info), your main
> gui-thread could instead query for the updates (pulling progress
> info).
>
> Save the progress of your AudioTrack's audio stream into a variable of
> the background task. And have your main GUI thread poll this variable
> with a fixed rate. Make sure this variable is properly synchronized
> for writing and reading.
>
> On Mar 28, 11:33 pm, Gabriel Simões <[email protected]> wrote:
>
>
>
> > Thanks Roman...
>
> > Trying to optimize my code without using the ndk right now. If I don´t
> > find a way out, then I get to this next step.
>
> > On 28 mar, 23:19, Romain Guy <[email protected]> wrote:
>
> > > There's no refresh limit (except the one set by the display, which is
> > > usually 50 or 60 fps) in the Views system nor in AsyncTask. You are
> > > probably running into performance issues.
>
> > > 2010/3/28 Gabriel Simões <[email protected]>:
>
> > > > Hello,
>
> > > > I´d like to get some information about Android´s maximum refresh rate
> > > > when updating a view. In this specific case I´m trying to update the
> > > > value displayed on a TextView on my main activity.
> > > > The algorithm tries to syncronize the audio streams played using
> > > > AudioTrack with updates on the view. Since I need a different thread
> > > > to feed AudioTrack I created a new AsyncTask which calls
> > > > publishProgress() everytime an specific event occurs in the audio.
> > > > The algorithm works flawless until the update rate gets close to 4
> > > > times per second. From this to any higher refresh rate the view just
> > > > don´t show the news values anymore.
> > > > Does publishProgress (updateProgress) have a refresh´s period limit?
> > > > If so or if not, what could I do so my asyncTask get to update the
> > > > TextView as quick as I need?
>
> > > > *Important: I´m doing all my tests using the android emulator (sdk
> > > > 1.6).
>
> > > > Thanks,
> > > > Gabriel Simões
>
> > > > --
> > > > 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
>
> > > > To unsubscribe from this group, send email to 
> > > > android-developers+unsubscribegooglegroups.com or reply to this email 
> > > > with the words "REMOVE ME" as the subject.
>
> > > --
> > > Romain Guy
> > > Android framework engineer
> > > [email protected]
>
> > > Note: please don't send private questions to me, as I don't have time
> > > to provide private support.  All such questions should be posted on
> > > public forums, where I and others can see and answer them- Ocultar texto 
> > > das mensagens anteriores -
>
> > > - Mostrar texto das mensagens anteriores -- Hide quoted text -
>
> > - Show quoted text -- Ocultar texto das mensagens anteriores -
>
> - Mostrar texto das mensagens anteriores -

-- 
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

To unsubscribe from this group, send email to 
android-developers+unsubscribegooglegroups.com or reply to this email with the 
words "REMOVE ME" as the subject.

Reply via email to