Initially I use hashtable in my android application. The key point I love hashtable is it is able to store complex item such as: coordinate–>float[2], velocity–>float[2].
But from many samples, using SQLlite table in android seems more efficient but it may only store all the values in one row defined by rowID.
So can anyone enlighten me on this problem? using hash table or SQL lite is more feasible?
Can hashtable keep the data if I exit the application?
No, of course no. A
HashTableinstance will live while your app is running, but as soon as you close the app, it will be deleted. Now, put your hand in your heart and answer these questions:That said, let’s talk about more ways to persist data:
key<->valueschema which is very similar to theHashTable.So, at first glance, I suggest you take a look at the examples of Shared Preferences, which seems to be ideal for your scenario.