Android实例-操作sqlite数据之自建导航(XE8+小米2)
相关资料:
源文:http://blog.sina.com.cn/s/blog_77691fb90101g9hh.html
help://embarcadero.rs_xe5/rad/Mobile_Tutorial'3A_Using_SQLite_(iOS_and_Android).html
结果:
1.导航在开发时没问题,手机上出现了乱码,不知道为什么。大位大神了解的,请M我哦。多谢了。
2.数据库文件,记得打包到程序中(assets\internal\)。
操作方法:
1.新建firemonkey mobile application
①菜单->File->New->FireMonkey Mobile Application Delphi
②Blank Application
③设置分辨率。
2.增加控件
①拖拽一个FDPhysSQLiteDriverLink1、FDGUIxWaitCursor1、FDConnection1、FDQuery1。
3.连接SQLite数据库
①首先用Navicat for SQLite做好一个测试库备用。
②双击FDConnection1->Definition->Driver ID->SQLite。
③下方的Database设置一下数据库的路径。
④FDQuery1->SQL->输入SQL语句如:“select * from MyTabel”。
⑤FDQuery1->Active->True。
⑥提示输入密码,不用管,直接点OK。
4.绑定数据
①菜单->View->LiveBindings Designer->点击绑定向导(就是最左下方的按钮)。
②LiveBindings Wizard->LInk a grid with a data source(五个中的第二个)->Next。
③LiveBindings Wizard->Grid1->Next。
④LiveBindings Wizard->FDQuery1->Next。
⑤LiveBindings Wizard->Add data source navigator->Finish。
5.重要发布
①菜单Project->Deployment->Add File->选择中SQLite数据库。
②Remote Path->assets\internal\。
6.手机程序中加增加的事件
①FDConnection1BeforeConnect事件增加增加代码“FDConnection1.Params.Values['Database']:=TPath.Combine(TPath.GetDocumentsPath,'test.db');”。
相关文章
- [android]MonkeyRunner-andrec实现思路
- [Android Pro] android 禁用和开启四大组件的方法(setComponentEnabledSetting )
- [Android Pro] Android权限设置android.permission完整列表
- [XMOVE自主设计的体感方案] 历代版本系统介绍(五)X-MOVE4.0 Android子系统
- android.database.sqlite.SQLiteException: near "FROM"
- Android API之android.os.Parcelable
- 保存恢复临时信-Android 中使用onSaveInstanceState和onRestoreInstanceState
- 《android开发艺术探索》读书笔记(十五)--Android性能优化
- android 编程规范 check list
- Android 多屏幕适配 dp和px的关系 最好用dp
- android开发分享Android中外接键盘的检测的实现
- Android 系统jni到hal层回调代码
- android 键盘驱动编写
- Android SQLite用sql语句进行增删改查
- Android获取日期
- Android kotlin 系列讲解(基础篇) 关键字:lateinit和by lazy
- Android app跨进程通讯对于休眠进程断开重连的解决
- 编译Android VNC Server(pc远程控制android)(四十九)
- Android 手机自动化测试工具有哪几种?
- 解决Android中No resource found that matches android:TextAppearance.Material.Widget.Button.Inverse问题
- Android 系统休眠唤醒 android-suspend
- android开发,Android Studio Build Output 输出的中文显示乱码
- Ubuntu下 sqlitebrowser 查看 Android Sqlite数据库