Reading and displaying long formatted text documents in Android

  • Replies:4
Amitai Rosenberg
  • Forum posts: 27

May 17, 2016, 1:27:11 PM via Website

Hi all.

I'm developing an Android app which is supposed to present large text files (books for example), for the user to browse, read, and search.

My question is as follows: How should I read and present the text file, which is currently in either a PDF or Word format, and is formatted?

What file should the text be in (.doc, .txt, .xml, .html)?

What controls/elements and code should I use to read it on the app so that it should be presented efficiently and formatted correctly (TextView, WebView, PDF reader, or some other way)?
Should I convert it to some type of markup and then parse it?

I'm quite at loss as to what to do...
How is this usually done in Android?

Hope someone can help me.
Thanks.

— modified on May 17, 2016, 1:29:29 PM

Reply
Vladimir S.
  • Forum posts: 266

May 17, 2016, 1:47:28 PM via Website

Hi Amitai,
As one of the possible ways you can use WebView and display HTML-formatted text within it.

Amitai Rosenberg

Reply
Amitai Rosenberg
  • Forum posts: 27

May 17, 2016, 2:02:05 PM via Website

Thanks Vladimir.
I feel like it's some type of workaround and not "native" or "natural" to do this.
What do you think? Am I wrong?
Also, do you think converting the document to XML and parsing it is better?

— modified on May 17, 2016, 2:04:55 PM

Reply
Vladimir S.
  • Forum posts: 266

May 17, 2016, 2:12:58 PM via Website

It is a "normai" way to use WebView :) I thought about another methods (PDF or DOC formats) but WebView is simpler and faster in your case, IMHO.

— modified on May 17, 2016, 2:15:06 PM

Amitai Rosenberg

Reply
Amitai Rosenberg
  • Forum posts: 27

May 17, 2016, 2:15:19 PM via Website

Ok. Thanks! :)

Reply