1.添加依赖:
implementation 'org.litepal.guolindev:core:3.2.3'
2.创建litepal.xml:
<?xml version="1.0" encoding="utf-8"?>
<litepal>
<!-- Define the database name of your application. By default each database name should be end with .db. If you didn't name your database end with .db, LitePal would plus the suffix automatically for you. For example: <dbname value="demo" /> -->
<dbname value="demo" />
<!-- Define the version of your database. Each time you want to upgrade your database, the version tag would helps. Modify the models you defined in the mapping tag, and just make the version value plus one, the upgrade of database will be processed automatically without concern. For example: <version value="1" /> -->
<version value="1" />
<!-- Define y