gpt4 book ai didi

android - 我们可以将一个数据库用于两个或多个应用程序吗?

转载 作者:行者123 更新时间:2023-11-29 18:35:14 25 4
gpt4 key购买 nike

我将要创建两个具有相同 SQLite 数据库的应用程序。我经历了this关联。但这没有意义。我必须从两个应用程序更新数据库。请提出一种或多种更好的方法。

最佳答案

您应该阅读有关Content Provider的内容

Content providers are one of the primary building blocks of Android applications, providing content to applications. They encapsulate data and provide it to applications through the single ContentResolver interface. A content provider is only required if you need to share data between multiple applications. For example, the contacts data is used by multiple applications and must be stored in a content provider. If you don't need to share data amongst multiple applications you can use a database directly via SQLiteDatabase.

https://developer.android.com/guide/topics/providers/content-providers

https://developer.android.com/reference/android/content/ContentProvider

关于android - 我们可以将一个数据库用于两个或多个应用程序吗?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/54670017/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com