android - How to store and large text data from SQLite database? -


i working on android project. tutorials app in providing 100 chapters. not getting how store these chapters in app's local database , how fetch on button click. want provide facility on button click next activity must opened , contents of chapters must loaded on activity. example. if click on button "chapter 1" 1st chapter must loaded sqlite database. have followed lots of tutorials not satisfied. please me. thank you!!! :)

you have 2 choices:

  • text type - sqlite support very long text

source: http://www.sqlite.org/faq.html#q9

sqlite happy store 500-million character string there

  • blob type: if don't want use text, can use blob instead ( need convert large text byte array when inserting/updating , convert byte array large text when loading db)

for database design. can this:

- book table ( _id, name, ...)  - chapter table (_id, content (text,blob), book_id, chapter_number, ...); 

Comments

Popular posts from this blog

c++ - No viable overloaded operator for references a map -

java - Custom OutputStreamAppender not run: LOGBACK: No context given for <MYAPPENDER> -

java - Cannot secure connection using TLS -