这不是 android 数据库中的数据冗余吗?

Isn't this data redundancy in android databases?

我正在学习 android 中的数据库,我意识到在 android 中并不是创建数据库并将其放在内存中的某个位置并访问它,而是创建和访问它将数据放入应用程序中。我学会了一种在代码之外创建我的 SQlite 数据库并将其复制到资产文件夹并使用 InputStream 将其复制到新创建的数据库的方法,您可以从 HERE

So my question is that is't this kind of data redundancy because my already created DB packs inside .apk file and meanwhile when app runs for first time I create another DB and copy my Data to newly created DB?

我知道还有其他方法可以做到这一点,例如创建一个 XML 文件,甚至使用 INSERT 操作将数据放入数据库,但不是所有这些方法都是额外的工作?

So my question is that is't this kind of data redundancy because my already created DB packs inside .apk file and meanwhile when app runs for first time I create another DB and copy my Data to newly created DB?

您将拥有两份数据副本,一份在资产中,一份在内部存储中。资产副本应压缩在 ZIP 存档中,这会有所帮助。

顺便说一句,我希望你是using SQLiteAssetHelper

I know there are another ways to do this, for example create a XML file or even use INSERT operation to put data to database but aren't all these ways kind of extra works?

是的。

避免冗余副本的唯一方法是在您的应用首次运行时从 Internet 下载数据库。然而,这需要 Internet 访问,这对当时的用户来说可能方便也可能不方便。