且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

“内容提供者"之间的确切区别和“SQLite 数据库"

更新时间:2023-09-14 15:22:58

我发现了一个主要区别,如下:

I found one major difference, as follows:

将数据存储在数据库中是保存数据的一种好方法,但在 Android 中有一个警告——在 Android 中创建的数据库可见 仅适用于创建它们的应用程序.也就是说,一个应用在 Android 上创建的 SQLite 数据库只能被该应用使用,而不能被其他应用使用.

Storing your data in a database is one good way to persist your data, but there's a caveat in Android-databases created in Android are visible only to the application that created them. That is to say, a SQLite database created on Android by one application is usable only by that application, not by other applications.

因此,如果您需要在应用程序之间共享数据,则需要使用 Android 中推荐的内容提供者模型.本文介绍了内容提供者和如何实施.

So, if you need to share data between applications, you need to use the content provider model as recommended in Android. This article presents the basics of content providers and how you can implement one.

我在此链接

提供了非常好的信息.