An offline English dictionary app written for Low RAM devices. This can be slightly modified to run on some smart watches too.
The App uses Skipped Partition Mapping
to look for a word and get its meaning. Dont worry, the term is unnecessarily complicated, what it does is fairly simple as explained below.
First we got the entire dictonary from Project Gutenberg - Webster's Dictonary.
The total size of the unzipped file is ~28MB. Looks small, but this is humongous for a lot of memory constraint devices like low-end smart watches, arduino/other prototyping boards, my Nokia Asha etc. So we divide it into raw data stream chunks of 1MB or even 100KB each. The device can now process this much size file.
However, to look whether the words even exists in the dictonary we have to sift through all these chunks!! This defeats the purpose of chunkning it. So we create another file that only contains a list of all the available words and where their meaning is located (in which chunk's which location).
Cool, now we created a map to actual data. But, turns out the map itself is ~3MB in size :|. Going through this is still gonna take time. So, we divide this map in 26 parts - one for each alphabet. In this way when the user searches for a word starting with C, we only look into C's map which is ~270KB.
In theory, 270KB sounds doable. Alas, it turns out, in real time even this causes a very visible lag. So, buffer only 1KB of data at time and do a median search
to check if the word might be present in the buffer, else take the median of total search area of buffer at jump to that location in 270KB. Keep doing this and you will ultimately get your word.
- Clone or Download the repo.
- Download Nokia Asha SDK.
- Load the project and build.
- Either build as decribed above or download a release.
- Copy to emulator or device.
- Click the Dictionary icon from App Drawer.