android 代码将数据库文件导出到sd卡
2024-09-04 13:12:54
public static void save() {
String dbpath = "/data/data/tl.cac.view/databases/"
+"afinal.db";
boolean success=copyFile(dbpath, Environment.getExternalStorageDirectory() + "/"
+ "afinal.db");
} public static boolean copyFile(String source, String dest) {
try {
File f1 = new File(source);
File f2 = new File(dest);
InputStream in = new FileInputStream(f1);
OutputStream out = new FileOutputStream(f2); byte[] buf = new byte[];
int len;
while ((len = in.read(buf)) > )
out.write(buf, , len); in.close();
out.close();
} catch (FileNotFoundException ex) {
return false;
} catch (IOException e) {
return false;
}
return true;
}
最新文章
- WPF 控件总结
- C# 隐藏标题栏 调整大小 并且移动窗口
- 针对APP的测试过程和重点关注内容,做以下梳理和总结
- javascript 零星知识点
- 排序小结(C++版)
- 【软件分析与挖掘】Vision of Software Clone Management: Past, Present, and Future (Keynote Paper)
- Google Developers中国网站
- Erlang第一课----基本变量
- Android WindowManager悬浮窗:不需要申请权限实现悬浮
- TQMsgPack序列还原clientdataset.data
- [AngularJS + Webpack] Production Setup
- Android应用开发学习笔记之多线程与Handler消息处理机制
- PHP安全编程:register_globals的安全性 全局变量注册(转)
- Fragment和activity之间的通信
- css3 动画(animation)-简单入门
- IE浏览器清除缓存没用
- bzoj 2308 小Z的袜子(莫队算法)
- Git管理多个SSH密钥,Git多帐号配置
- #JS 前端javascript规范文档
- 17monipdb.dat
热门文章
- python2 + selenium + eclipse 中,通过django生产数据库表的时候报错
- selenium2获取input输入框中的值的三种方法。
- [hdu2087]剪花布条(KMP)
- gcc -frandom-seed
- switch()出现警告warning:enumeration value ‘xxx’ not handled in switch
- CodeForces - 505B Mr. Kitayuta's Colorful Graph 二维并查集
- Fedora/CentOS使用技巧
- Git 时光穿梭鸡 撤销修改
- Python:通过一个小案例深入理解IO多路复用
- 用 _tcscmp 替代 strcmp 或 wcscmp