Frage

I want to write an android application that contains lots of data. For example, I've about 30 categories, each category has about 50 items and each items consist of 10 text pages and 5-8 pictures.

I want my app to work offline and doesn't need internet connection.

What is the best and safest way to do it?

War es hilfreich?

Lösung

You should use sqlite database. Database is the best way to keep big amount of data structured. You can put all your text data in tables. You can also put images to tables as blob or put images to assets folder and database will store path to image.

Just create sqlite database with all needed data on your PC and then attach it to your android app. You can easily find lots of information how to work with sqlite in android.

Andere Tipps

If You have every thing Hardcode . then you can put them all in assests folder in your project and then can read from code any file you want by different methods avaiable easily .

I would suggest you to use sqlite databse which is easy . You can store large texts and images as well . Other option is to store all this data in xml and use it and images in drawable folder. But managing data will be difficult so try using database .

Lizenziert unter: CC-BY-SA mit Zuschreibung
Nicht verbunden mit StackOverflow
scroll top