Android数据库的问题 数据已经导入数据库,接下来怎么写程序实现把数据库放入data/data/包/database下呢?求大神指点~~ 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 String dbPath=android.os.Environment.getExternalStorageDirectory().getPath(); String dbFile=dbPath+"/ourbook.db3"; File file=new File(dbFile);try{ inputStream = this.context.getResources().openRawResource(R.raw.book); byte[] buffer = new byte[8 * 1024]; int readCount = -1; while ((readCount = inputStream.read(buffer)) > 0) { fos.write(buffer);}就是要把 book 中的东西 考到ourbook.db3中 如果仅仅是想暂时使用,可以通过eclipse里的file explorer把文件push进去就可以了如果想以后程序中一直使用,建议把sql script导出来,在OnCreate方法中执行。 typedef_god 此处省略三千字。 android 怎么连接服务器,求各位大神搭救 Android实现Ad_hoc Rexsee的图片集应用工具源码说明 Handler.sendMessage()被阻塞 ListView使用时不能为空么? 在eclipse中,如何让主工程替换library工程的src文件 android 学习之路 求个cocos2d-x 写的单机斗地主游戏源码 eclipse 内存不足 请教一个软键盘和焦点的问题 android平台下如何获得类似su权限,要求非云中漫步的作法 Android如何获取ListView中被点击条目的值呢?
String dbFile=dbPath+"/ourbook.db3";
File file=new File(dbFile);
try{
inputStream = this.context.getResources().openRawResource(R.raw.book);
byte[] buffer = new byte[8 * 1024];
int readCount = -1;
while ((readCount = inputStream.read(buffer)) > 0) {
fos.write(buffer);}
就是要把 book 中的东西 考到ourbook.db3中