开发 Android 词汇表应用程序所需的帮助
我正在开发物理学术语表。在此词汇表应用程序中,用户可以按字母顺序和类别搜索定义。我应该将数据存储在一张表中还是为不同类别创建不同的表?哪个会更好。我想开发类似这个应用程序 https://market.android.com/details ?id=com.beiks.bd_1119_NurserySongs_FULL 但有图像可以更好地解释它。我应该将图像也存储在数据库中吗?有没有办法使用pdf文件来显示?带有代码的示例应用程序确实很有帮助。副词中的感谢
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.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
我建议花一些时间创建规范化的数据库结构,而不是将其拆分为单独的表。例如,如果您认为可以将一个条目分配给多个类别,则需要一个非常不同的表架构(
categories
表、definitions
表和definition_categories
引用前两个的链接表)。如果您不需要,那么拥有一个带有category
列的definitions
表就足够了。如果您要交付包含图像的应用程序,则不要将它们存储在数据库中 - 原因是这样您将使用图像的两倍空间(一次在应用程序资源中,一次在数据库中)数据库)。
如果您要从互联网下载图像,这实际上取决于个人喜好。最简单的方法是下载图像并存储在您的数据目录中,或存储在 SD 卡(“外部存储”)上。
这取决于设备以及是否安装了 PDF 阅读器。您可以使用此问题中描述的技术来测试设备上是否存在支持 PDF 的应用程序。
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 adefinition_categories
linking table that references the first two). If you don't need that, then having a singledefinitions
table with acategory
column would be sufficient.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").
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.