Some questions about making Dictionary app

susu

Well-Known Member
Licensed User
Longtime User
Hi guys, I want to make a Dictionary app but I still got some questions:

1. I got all words in 1 database file (about 30MB). Does Android support that big file size? How to deal with it? My previous project got problem with 4MB database file.

2. My database got more than 30.000 words that mean there're 30.000 records. I want to load them all into a list view. Is it ok? How about the performance (scrolling up and down...) ? I see some dictionary apps just show about 30 words in list view, when user scroll down, it shows another 30 words... How can I do that?

3. I want my app have AutoCompleteInput view that searchs and shows words after user input a few characters. Does it work with 30.000 words database?

Please share your experience. Thank you so much :D
 

stevel05

Expert
Licensed User
Longtime User
The only real way to find out is to write a small test app, I've done something similar with 2000 records without a problem. If your database is indexed, searching and filtering the display shouldn't be an issue. But it would be best to try it with a simple program that does only that.
 
Upvote 0

NJDude

Expert
Licensed User
Longtime User
If I may give you my opinion.

I would host that DB remotely, I mean, 30MB might be too long to download for some users and also is kind of big, besides, if you add/change, etc words in the DB the user will have to download it again to get the updates, in my opinion, I'd be uninstalling your app, but setting the DB remotely using MySQL and using HTTP calls would be better, you can do whatever you want with the DB, the user will have only the client to access it which will be a small app.

Just my 2 cents.
 
Upvote 0

susu

Well-Known Member
Licensed User
Longtime User
If I may give you my opinion.

I would host that DB remotely, I mean, 30MB might be too long to download for some users and also is kind of big, besides, if you add/change, etc words in the DB the user will have to download it again to get the updates, in my opinion, I'd be uninstalling your app, but setting the DB remotely using MySQL and using HTTP calls would be better, you can do whatever you want with the DB, the user will have only the client to access it which will be a small app.

Just my 2 cents.

Thank you for your sharing. But I want my dictionary work off-line :)

@Stevel05: Thank you. I'll try with small app.

@All: How about question 2 and 3?
 
Upvote 0

lagore

Active Member
Licensed User
Longtime User
AutoComplete with over 6000 entries

Hi I currently am writing an app that has several autocomplete editText fields all of which are loaded from an sqlite database one has nearly 7000 entries this works well, loads up quickly at startup but the large one operates a little bit sluggish but good enough to use not sure how one with 30,000 would work.
 
Upvote 0

susu

Well-Known Member
Licensed User
Longtime User
2) You can try cycling with x/y variables:

SELECT field FROM table LIMIT x OFFSET y WHERE...

LIMIT: limits x rows returned
OFFSET: skips the first y rows

Thank you for your idea. But how can we know when user scroll to the end of the listview? There're no event for that.

@All: I just write some code to copy 32MB database with 25.000 records from DirAsset to DirInternal then load it into a ListView and AutoCompleteEditText. It took 7 seconds to be done (on my Sensation XE phone with 2 x 1.5Ghz cores). I guess it'll take more time on slower device but it's possible. Great news! :icon_clap:
 
Upvote 0

stevel05

Expert
Licensed User
Longtime User
If you don't need to display the whole dictionary at once you could always have a second scroll view that just has an alphabetic index, A-Z down one side of the screen, and display the entries by their first letter. That would reduce the number of items to display/filter considerably and may actually make it more manageable for the user.
 
Upvote 0

timo

Active Member
Licensed User
Longtime User
Thank you for your idea. But how can we know when user scroll to the end of the listview? There're no event for that.
...

By a "more" button. Let it be visible or not depending on the remaining number of total rows.

(Make a first SELECT WHERE of all records and count them. Make then other selections with LIMIT/OFFSET of the virtual table and manage x/y in percent and translate)

P.S.
After the For/Next cycle you could even add an Item named "#more" to the list , not related to the DB, and manage it
 
Last edited:
Upvote 0
Top