-2

I am trying to create holy book app in android studio, but this requires a large amount of texts.

The problem occurs when I paste those texts in strings.xml it shows an error like TF8 representation for string is too long for the constant pool. My question is is there any way to do that as many apps already done it but I don't know how. I want to show that text in my main activity as my app would have single activity.

Jake Lee
  • 7,549
  • 8
  • 45
  • 86
jugraj
  • 1
  • 1
  • 3
    Hello, you can create a text file and put it into the assets folder and you can read that text file from assets and used in your application – Navin Jan 12 '19 at 18:40
  • Could you please show some coding how to read .txt file from main activity. It'll be appreciated. Because am new in Android so i need it. – jugraj Jan 13 '19 at 19:20

2 Answers2

0

Since it will contain a lot of texts, you can create multiple files for each "chapter" and read from the files as mentioned by Navin. Having multiple text or json files will help manage the texts easier.

Pabi Moloi
  • 208
  • 2
  • 9
0

Also you can use PDF file in Assets folder ,I think it will be more easier

engmms
  • 347
  • 1
  • 4
  • 16
  • MANSOUR thank you for answering.could you please tell me who to read pdf file from asset folder. Because am new in Android it could be appreciated if you can drop some coding. – jugraj Jan 13 '19 at 19:18
  • this issue can help you ..https://stackoverflow.com/questions/54163404/android-pdfviewer-fragment/54164434?noredirect=1#comment95158649_54164434 – engmms Jan 14 '19 at 19:27