Android db or xml / kml?

What is profitable, efficient and faster? saving information in xml format and extracting it or storing information in db on android?

and also in terms of portability, xml can be saved as an asset ... can this be done with db? do db is included in the default package on all phones.

The application includes the processing of more than 1000 data records.

+3
source share
3 answers

SQLite DB will be faster when it requires large amounts of data - it will find what you want much faster.

For small amounts of data, a KML file will have much lower overhead than DB, but not very useful for dynamic data.

, , xml .

1000+ SQLite DB - - , DB , , - DB (. ). , KML , kml .

KML CSV . , CSV SDCard , 7000 35 . , raw asset 1 .

, :

Database Population Solution

+2

/ , . .

, 2 :

  • DB (SQLite)
  • - XML , -/smth,

    /data/data/[ ]/shared_prefs

: 100 - DB, .

0

My choice

  • I use a database for structured data. When there is a definite need to search for data specified by certain fields or sort by different fields. Use DB when additional logic is required.
  • I use "shared prefferences" files when there is a need to save data. No additional logic, just a pair of key values.
0
source

Source: https://habr.com/ru/post/1770853/


All Articles