在应用程序和Web之间共享数据库 [英] Share database between app and web

查看:102
本文介绍了在应用程序和Web之间共享数据库的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我参与了一个必须从现有数据库检索查询的应用程序。此数据库必须在远程服务器上的php中实现,并且它将是管理员必须在共享数据库中插入内容的地方,但是我不知道如何正确实现该方法或最佳解决方案。



我正在考虑使用php创建一个sqlite数据库并将该应用程序直接连接到db,但是我还没有找到实现此目的的最佳方法。 / p>

您怎么看?谢谢大家。

解决方案

FYI,无需任何服务器通信(网络服务),则不能在android应用程序中使用网站数据库。



如果要管理网站和android应用之间的通信意味着您需要一个具有Web /移动应用程序数据的集中式服务器(可能是我的sql dab)。因此,在那之后,通过使用Web服务方法(REST / SOAP),您就可以实现它们之间的通信


一个使用php的sqlite数据库并将
将该应用程序直接连接到数据库,但是我还没有找到执行
的最佳方法。


这不是将移动应用程序与数据库连接的正确方法。相反,您应该创建一个在服务器上运行的中间件(REST / SOAP Web服务)。该中间件将依次与数据库和您的移动应用程序连接,无论是android,iOS还是Windows应用程序都可以与此中间件进行通信。


I'm involved into an app that have to retrieve queries from an existing database. This db have to be implemented in php in a remote server, and will be the place where the admin will have to insert content into the shared db, but I don't know how to implement that correctly or what is the best solution.

I'm thinking about make a sqlite database with php and connect directly the app to the db, but I haven't found yet the best way to do that.

What do you think? Thank guys.

解决方案

FYI, without any server communication (Web services) you can't use the website database in android application.

If you want to manage the communication between the website and the android app means you need a centralized server (probably my sql dab) which having the data of your web/mobile applications. So, after that by using the web service methods (REST/SOAP) you can achieve the communication between them

I'm thinking about make a sqlite database with php and connect directly the app to the db, but I haven't found yet the best way to do that.

This is not the right approach to connect mobile applications with the database. Instead you should create a middleware(REST/SOAP webservice) which runs on server. This middleware will in turn connect with the database and your mobile app whether it is android, iOS or windows app can communicate with this middleware.

这篇关于在应用程序和Web之间共享数据库的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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