Sqlite数据库导入导出

时间:2018-04-12 07:34:59

标签: android

我可以导入和导出 SQLite 数据库吗?意味着我只想携带数据库。 .DB文件将放在我的SD卡上。该应用程序将从SD卡的数据库中获取数据并在该数据库上写入数据。使用该应用程序后。关闭应用程序并将.db文件带到其他设备,并能够查看以前的数据并可以操作该数据库。

1 个答案:

答案 0 :(得分:0)

您可以使用ORM在SD卡中获取数据库文件。但不使用默认的SQLiteOPenHelper。

检查Litepal框架:有关详细信息,请查看此https://github.com/LitePalFramework/LitePal

        Define where the .db file should be. "internal" means the .db file
        will be stored in the database folder of internal storage which no
        one can access. "external" means the .db file will be stored in the
        path to the directory on the primary external storage device where
        the application can place persistent files it owns which everyone
        can access. "internal" will act as default.
        For example:
        <storage value="external" />
相关问题