1

I am developing a glossary of terms in physics. In this glossary app, user can search the definition alphabetically as well as by category . Shall i store data in one table or create different table for different categories? which will be better. I want to develop something like this app https://market.android.com/details?id=com.beiks.bd_1119_NurserySongs_FULL but with images to explain it better. Shall i store the images also in database? Is there any way to use pdf files to display? Sample app with code will really be helpful. thanks in adv.

jkjk
  • 21
  • 1

1 Answers1

0

Shall i store data in one table or create different table for different categories?

I would suggest spending some time creating a normalized database structure, instead of splitting it into separate tables. For example, if you think you might assign one entry to multiple categories, that would call for a very different table schema (categories table, definitions table, and a definition_categories linking table that references the first two). If you don't need that, then having a single definitions table with a category column would be sufficient.

Shall i store the images also in database?

If you'll be shipping the application with the images included, then do not store them in the database -- the reason is because then you'll be using up twice the space for your images (once in the application resources, and once in the database).

If you'll be downloading the images from the Internet, it really comes down to personal preference.. The easy way would be to just download the images and store in your data directory, or on the SD card ("external storage").

Is there any way to use pdf files to display?

That depends on the device, and if it has a PDF reader installed. You can test for the existence of a PDF-capable application on the device using techniques described in this question.

Community
  • 1
  • 1
Joe
  • 42,036
  • 13
  • 45
  • 61
  • Thanks for the reply. But will it be a good idea to use pdf files for displaying? will it occupy more memory or affect performance? I am new to android programming and new to java too..have some basic knowledge...can u please help? http://www.androidzoom.com/android_applications/books_and_reference/bks-medical-diagnoses-codes_fwbx_screenshots.html ..In this screenshot is pdf file used? – jkjk Jun 18 '11 at 23:11
  • For something similar to that screenshot, I would suggest not using PDF. I honestly can't think of any reason that a PDF would be preferred, unless the display is not canonical and having it appear a particular way is absolutely vital. – Joe Jun 19 '11 at 10:44
  • Hi..I want to insert values to the database. As this will be a offline dictionary, which method is best to insert values? Is it ok to use the method String sql = "INSERT or replace INTO definitions (title, definition, category) VALUES('Light ','green','other')" ; db.execSQL(sql); I will be using around 500 words with definition. – jkjk Jun 23 '11 at 21:39