To demonstrate the scrolling behavior, the string used in the preceding text view was a lengthy one. This was placed in the strings.xml file, and although this works perfectly well, it is not an elegant way to manage lengthy texts. This kind of text is better dealt with as a text file resource that can be read at runtime.
The following steps demonstrate how this is done:
- Prepare a plain text file.
- Create a directory named raw inside the res directory of your project by right-clicking on the res folder in the project explorer and selecting New | Directory.
- Add the text file to this directory.
- Open the java activity with the text view you wish to ...