For a mobile app, what's the best way to deal with large blocks of text? Part of our app will have a "reference library" with large amounts of text and some images. This text will not be updated very often. Also, our app will be used in areas where there will be weak or no signals so using a webview isn't the best option.
Pros & Cons of using the database to store the data? Just including in the code? Flat files (with HTML formatting)? The best way to handle multiple pages? Organization of the different sections (but it won't be encyclopedic).
Any other suggestions (including recommendations of libraries) for making the reading experience better?
4 Answers
Paul, one technique I've tried for displaying text that needs a minimal amount of formatting -- use a TableView, with each TableViewRow being a separate paragraph (=label). You can also add in other elements (photos, etc) if required as standalone TableViewRows as well. You can style the rows and background so the edges are transparent with no lines between the 'paragraphs'.
Of course, you won't be able to easily do inline styling, but if the text is just reference information that is relatively static, styling may not be required.
Because it is a tableview, page scrolling will be baked-in, and you can keep tight control over the appearance.
HTH.
Personally, I'd go with flat HTML files & images. I'd also build an engine that goes back to the server to see if there is any new content, and download a zip of the new HTML files & images if needed/possible.
Thanks to both of you. Now, I'm wondering if there isn't a way to combine the answers.
Be sure to comment on answers instead of submitting another answer to your own question.
If you just need some basic formatting, StyledLabel might be a good alternative. Ignore the poor comments in the marketplace... those people didn't bother reading the documentation to find out exactly what StyledLabel can & can't do.
Your Answer
Think you can help? Login to answer this question!