0

I'm working on an Android social app which connects to a Postgresql database for up-to-date user data and is going to use lookups for dropdown menus, and these lookups will either have multiple options (e.g. for eye color, the menu would show 'blue', 'brown', 'green', 'hazel', 'red', 'white') or boolean options (e.g. for smoking, the menu would show 'non-smoker' or 'smoker').

Should I store these within the app? They're not really high sensitivity/confidentiality. I was originally thinking I would store them in the Postgresql database but in hindsight that seems overkill and would possibly start to affect performance and cause unnecessary hit on the database server.

What would be the best way to store these within the app/on the device? For arguments sake, I'm using the current latest Android version (4.4.4, though obviously not only targeting that one).

1 Answer 1

2

Firstly your question is against the sites guidelines as it is something which will lead to discussion. Still to answer your question, you can create a sqlite db and inside it a table with all this static values to be displayed in drop downs, put the sqlite db in assets folder, on app first launch copy it to applications default db location and read it from there and display in drop downs. At the same time you can always integrate a mechanism of downloading values from server and updating local sqlite table, in case you add any new values to a drop down field on your postgresql database side.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.