Android(安卓)技巧:命令行运行 sqlite3
16lz
2021-12-04
Android 使用 sqlite3 存储数据,所以我希望用如同 mysql 一样操作数据库 使用 SQLiteOpenHelper 略显繁琐 用 adb shell 登陆到 devices 打开db 文件 /system/xbin/sqlite3 /data/data/com.android.providers.settings/databases/settings.db 查看表 在 sqlite的 shell 中数据 .tables 进行 update update Secure set value=1 where name = 'touch_exploration_enabled' 查新看数据是否改变 sqlite> select * from Secure 当然你也可以操作自己的数据库 ====== create table IF NOT EXISTS my (_id INTEGER not null, name text not null, value INTEGER) INSERT INTO my values(1,"touch_exploration_enabled",1) drop table my 注意: 1) 必须用 adb shell 登陆到数据库上,才能执行 2)用 ubuntu 上的 sqlite3 不能打开 .db 3) SQLiteOpenHelper 的构造函数会吧 db 存到 /data/data/<my.app.namespace>/databases/<dbname>.db Examples Ref: http://zetcode.com/db/sqlite/ http://www.thegeekstuff.com/2012/09/sqlite-command-examples/ |
更多相关文章
- mybatisplus的坑 insert标签insert into select无参数问题的解决
- python起点网月票榜字体反爬案例
- Android(安卓)SDK下载太慢
- Android应用程序组件Content Provider的共享数据更新通知机制分
- android左右滑动加载分页以及动态加载数据
- android Sqlite多线程访问异常解决方案
- 【Android(安卓)Training - 04】保存数据 [ Lesson 0 - 章节概览
- 完美解决android Studio打开报错 https://code.google.com/p/and
- Android(安卓)Adapter详解