Question

I am trying to build a application which will be a Ebook kind of (Lot of theory & diagrams) will be there.

Now what i want to know is that since there are many ways of storing the data which one will be the best

  1. Storing in Database
  2. XML
  3. Or simple text files

I am very concerned about the security of the data as well. Since this will be a paid app, i want the data to be secured and also be fast and convenient.

Also, I thought of converting the doc files (Data) in to epub format & then use epub api's to access the data and show it on the android app screen, will this be a gud idea to go for? as compared to the above ways?

Which one will be more secure, fast, flexible & easy!

Was it helpful?

Solution 2

Depends on what is more important to you - speed or security.

Speed

Definitely SQLite, it isn't exactly the cleanest, but definitely the fastest way.

Security

Custom files which are encrypted - it will take a while to read the whole file and then decrypt it in order to display it, but you can be sure that the attacker will access the files encrypted and without the knowledge of the encryption - those data would be useless to him.

EPUB

If you're concerned about security then don't, unless you know how to apply DRM...and that is not a way to go honestly.

OTHER TIPS

It depends on how you will access to this data. If you will store in xml you will must to read the whole file from the start to access to chapter (or load to memory, for example). It's not good idea if you will store big data. Storing in SQL faster. You can gain access to any chapter. You don't need to read all data, like in xml.

Simple text file has the same problem like XML (xml is textfile).

The only one way to secure you data - encrypt it. If user will get root on their device, he will gain access to your files and databases. There is no meaning where you will store your data.

I think that the best way to store big amount of data is database. In Android it is sqlite database. I recommend you to put all your text data into sqlite database. You can structure it in easy and beautiful way. Then put your images into assets folder and store the pathes to the the images in database.

Advantages of database solution:

  1. Always well structured data
  2. Easy way to update data with version control system.
  3. You can store and get fast accesses to really big amount of data.
  4. You can use encryption to protect your data.

Disadvantages

  1. It is more complicate to write good code for database solution then for XML or JSON one.

P.S If you will decide to use XML I recommend you to change it to JSON. It is faster and easier to use.

Which one will be more secure, fast, flexible & easy!

Secure: It mainly depends on encryption system.

Fast: SQLite, you can read some advantages of SQLite here Android Performance : Flat file vs SQLite

Flexible and easy: Storing the encrypted files in internal storage is a flexible and easy way. I think it is secure enough. Here you can get some android security tips about storing data http://developer.android.com/training/articles/security-tips.html#StoringData

for saving little data you can use xml for strings but you lose fast loading factor sqlite is good for almost every purpose, but Security

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top