zoukankan      html  css  js  c++  java
  • 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.数据库文件,记得打包到程序中(assetsinternal)。

    操作方法:

    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->assetsinternal。
    6.手机程序中加增加的事件
    ①FDConnection1BeforeConnect事件增加增加代码“FDConnection1.Params.Values['Database']:=TPath.Combine(TPath.GetDocumentsPath,'test.db');”。

  • 相关阅读:
    Java乔晓松oracle的多表查询
    定义一个地址固定的变量
    J2ME的表单元素及其事件
    J2me的异常处理和多线程
    [置顶] eclipse远程部署,静态文件实时同步插件
    newlisp debugger
    启用isqlplus
    ORA27101: shared memory realm does not exist
    windows下安装node.js及less
    em启动/关闭报错解决
  • 原文地址:https://www.cnblogs.com/FKdelphi/p/4796041.html
Copyright © 2011-2022 走看看