如何访问一个应用程序的数据库中使用SQLite另一个应用程序? [英] How to access one App's Database to another Application using Sqlite?

查看:1404
本文介绍了如何访问一个应用程序的数据库中使用SQLite另一个应用程序?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有导致使用的数据库的两个应用程序。

I have two applications which resulting to use database.

它创建的数据库名称DB1应用程序A。这个数据库,我想在访问
B.应用程序中的应用在不同的包。

Application A which creates database name DB1. This database I wanted to access in application B. The applications are in different packages.

我怎样才能做到这一点?

How can I do this ?

推荐答案

应用程序不允许读取其他应用程序的私有数据(你只能在扎根器件做到这一点)。最简单的方法是将数据库存储在一些公共场所,但那是的不建议因为设备的任何应用程序将能够访问数据库文件...

Application are not allowed to read private data of another application (you can do this only on rooted devices). The easiest way is to store database in some public location, but that is not recommend because any app on device will have access to database file...

下面是你可以做什么。您可以从两侧创建广播接收器 -s和使用信息传递实现您的通信协议。应用程序B将播出的要求,应用程序A将处理该请求并发送结果返回给应用程序B.唯一的问题是,应用程序A code必须更新。有关如何使用消息传递更多信息,请查看

Here is what you can do. You can create BroadcastReceiver-s from both sides and implement your communication protocol using message passing. Application B will broadcast requests, application A will handle that request and send result back to the application B. The only problem is that application A code must be updated to. For more info on how to use message passing, check this article

这篇关于如何访问一个应用程序的数据库中使用SQLite另一个应用程序?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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