producing a typewriter-like effect

Posted by Tony Ennis on Stack Overflow See other posts from Stack Overflow or by Tony Ennis
Published on 2012-04-01T23:23:15Z Indexed on 2012/04/01 23:29 UTC
Read the original article Hit count: 234

Filed under:

Android newb here. Please use small words :-)

I'd like to simulate typewriter output on my Android. The output being displayed is generated by a game and is somewhat freeform. The effect I want to see individual characters appear at a rate of about 6 characters a second. When a 'carriage return' is seen, I'd like to insert a delay then resume typing on the left.

What are some suggestions on views? Would the view of choice for this be a TextView? Even that seems like overkill for this read-only coarsely scrolling output.

I saw something on this thread about an AsyncTask. That looks useful. Perhaps my game will write to some manner of buffer, and a subclass of AsyncTask will pull characters out every .15 seconds or so, add them to the TextView, then invalidate() the TextView? Sound like a plan?

© Stack Overflow or respective owner

Related posts about view