幼敏悟过人,读书辄成诵。这篇文章主要讲述Android常用开源库的使用——————————————LitePal的使用方法相关的知识,希望能为你提供帮助。
LitePal是一款开源android数据库框架,采用了对象关系映射的模式,
详细的使用文档见LitePal项目的Github主页
快速设置步骤:
1. Include libraryEdit your build.gradle file and add below dependency.
If you program with java:
dependencies { implementation ‘org.litepal.android:java:3.0.0‘ }
2. Configure litepal.xmlCreate a file in the assets folder of your project and name it as litepal.xml. Then copy the following codes into it.
< ?xml version="1.0" encoding="utf-8"?> < litepal> < dbname value="https://www.songbingjia.com/android/demo" /> < version value="https://www.songbingjia.com/android/1" /> < list> < /list> < /litepal>
This is the only configuration file, and the properties are simple.
- dbname configure the database name of project.
- version configure the version of database. Each time you want to upgrade database, plus the value here.
- list configure the mapping classes.
- storage configure where the database file should be stored. internal and external are the only valid options.
< manifest> < application android:name="org.litepal.LitePalApplication" ... > ... < /application> < /manifest>
【Android常用开源库的使用——————————————LitePal的使用方法】
推荐阅读
- 8分钟学会使用AutoMapper
- 一对一直播系统app开发核心功能点简析
- 探探app下载|探探app下载
- 从golang-gin-realworld-example-app项目学写httpapi
- 安卓之Android.mk编写
- 慢阻肺疾病管理app——需求设计心得
- 微信文章置顶怎样设置?微信文章置顶设置图文详细教程_微信
- 手机QQ内存怎样清理?手机QQ内存清理图文详细教程
- 微信左先生右先生是啥意思?左先生右先生结局_微信