Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to manage large set of data on a mobile device

I am currently implementing a Japanese dictionary and would like some ideas on how to find entries in a fast and efficient manner. The dictionary entries themselves are loaded and stored in a class which houses the words in Japanese (potentially with multiple spellings), their phonetic pronunciation(s) and definitions in English as three Lists.

I originally had a tree structure with each node representing a character in a word. It was very fast but unfortunately used a lot of memory. The definition data itself is around 35meg, and the tree structure itself was around 130meg. Additionally, it also only allowed for looking up from Japanese -> English. Memory is a concern as apart from the need for additional indexes it is intended that a Windows Phone 7 version of the application will exist. The dictionary contains a 150,000 entries.

To sum up, this is what I need to do: Store a list of definitions Have three indexes into this list for Japanese, phonetic and English meanings. Have lookups be fast (ideally less than 1 second) Use as little memory as possible (the memory usage limit on Windows Phone 7 is 90meg)

Any ideas?

like image 692
Andrew Avatar asked May 09 '11 12:05

Andrew


People also ask

How do I find out what is draining my data?

On many newer Android devices, you can go to “Settings” > “Data Usage” > “Cellular data usage“, then scroll down to see which apps are using the most data.


1 Answers

You should consider using a mobile database, or web service, to deal with that much data on a mobile device. The kind of performance, features and management you're looking for are very difficult to get right on any platform but you don't have to. Use a db with proper indexes and tables, local or remote.

SQL CE is not available for WP7 but there are other options, commercial and open source. Also, if you're expecting to be connected frequently and are OK with a little bit of latency, do consider using a web service. You can use any database of choice on a central server presented to you via the web service. Your bottleneck would be communications but you would offload a significant amount of processing from a constrained device.

like image 58
Paul Sasik Avatar answered Sep 17 '22 01:09

Paul Sasik