如何分享sqlite的之间的两个应用程序? [英] How to Share Sqlite Between Two Application?

查看:226
本文介绍了如何分享sqlite的之间的两个应用程序?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个SQLite数据库文件。我想两个不同的Andr​​oid应用程序之间共享我的SQLite数据库。可以做这样的?若有必要什么步骤,我应该尝试?

I have one Sqlite Database file. I want to share my sqlite database between two different android application. Is possible to do such ? if so the what necessary steps I should try ?

推荐答案

简短的回答:是的,

长的答案:你将不得不注册您的应用程序与你的第二个应用程序共享的内容。话虽这么说,不好的一面是,你将与所有其他应用程序也可以分享你的内容。这并不是说我看到它是一个问题,因为其他开发者未必知道如何使用内容提供商来访问你的应用程序中的数据。

The long answer: You will have to "register" your application to share its contents with your second application. That being said, the down side is, you will be sharing your contents with every other application too. Not that I see it being a problem since other developers will not necessarily know how to gain access to your app's data using the Content Providers.

您可以按照此链接阅读了有关创建和访问内容提供商。

You can follow this link to read up about creating and access content providers.

哦。差点忘了。这是你如何应用程序之间共享数据。我个人从来没有听说过有任何人共享数据库。 DB的总是私人自己的应用程序,并从来没有接触到其他人,包括用户。请参见此链接在Android的更多信息数据库

Oh. Almost forgot. This is how you share data between applications. I have personally never heard of anyone having shared databases. DB's are always private to their own application and never exposed to others including the users. See this link for more about Databases in Android

这篇关于如何分享sqlite的之间的两个应用程序?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆