如何包括黑莓应用程序SQLite数据库? [英] How to include a SQLite database with a Blackberry application?

查看:118
本文介绍了如何包括黑莓应用程序SQLite数据库?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在我的申请,我有,我想在一个屏幕上显示一些静态数据。所以我导入的数据到数据库,并补充说,到SD卡上。现在,应用程序是在模拟器上正常工作。但是,当我创建的COD / ALX文件,并安装应用程序到设备中,DB缺失。任何人都可以建议的方式包括应用这里面分贝?

In my application, I have some static data that I want to display in one screen. So I imported the data to a database and added that to the SD card. Now the app is working fine on the simulator. But when I created the cod/alx file and installed the app to the device, the db is missing. Can anyone suggest the way to include this db inside the application?

推荐答案

在项目中包含的资源数据库文件。然后在运行时从资源中提取并保存到SD卡。

Include the db file in the project resources. Then in run time extract it from resources and save to SDCard.

要提取资源使用<一个href=\"http://www.blackberry.com/developers/docs/4.6.0api/java/lang/Class.html#getResourceAsStream%28java.lang.String%29\"相对=nofollow> Class.getResourceAsStream(字符串名称)方法。

在节省BB文件可能是本指南的一个起点:<一href=\"http://docs.blackberry.com/en/developers/deliverables/17952/Writing_text_to_a_file_1219767_11.jsp\"相对=nofollow> code样品:编写文本文件

A starting point in saving files on BB could be this guide: Code sample: Writing text to a file.

这篇关于如何包括黑莓应用程序SQLite数据库?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆