Reputation: 2059
I am trying to create an Android dictionary-like application and get slow performance on retrieving the data. Currently, each dictionary entry is stored in a text file (inside Android assets), each file is named as number, so that I can use index to locate, open and read the file's content (simply read out a single line of String). When using ListView
to render the output data and reading the file's content inside getView()
method, it takes about 3 second to retrieve 10 entries. I just wonder if there are another approaches (using SQLLite
, ???) for retrieving and rendering these entries faster. Any recommendations are appreciated.
Upvotes: 1
Views: 561
Reputation: 4252
I would suggest you to use SQLite
Encrypt
using AES
or similar algorithm it, then it will become more
secure!)ListView
You can see a complete article here
Upvotes: 1
Reputation: 12672
SQLite
will definitely make your job easier and make the app work faster. It's also a lot easier to read data; when you're writing data to the DB make sure to use transactions to speed up multiple sequential writes. I probably wouldn't even consider using a text file except for initial data. There are many resources available online such as this tutorial.
Upvotes: 1