简体   繁体   English

在app和web之间共享数据库

[英]Share database between app and web

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. 这个数据库必须在远程服务器的php中实现,并且将是管理员必须将内容插入共享数据库的地方,但我不知道如何正确实现或者什么是最佳解决方案。

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. 我正在考虑使用php创建一个sqlite数据库,并将应用程序直接连接到数据库,但我还没有找到最好的方法。

What do you think? 你怎么看? Thank guys. 谢谢你们。

FYI, without any server communication ( Web services ) you can't use the website database in android application. 仅供参考,没有任何服务器通信( Web服务 ),您无法在Android应用程序中使用网站数据库。

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. 如果你想管理网站和Android应用程序之间的通信意味着你需要一个集中的服务器(可能是我的sql dab),它拥有你的web /移动应用程序的数据。 So, after that by using the web service methods (REST/SOAP) you can achieve the communication between them 因此,在此之后通过使用Web服务方法(REST / SOAP),您可以实现它们之间的通信

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. 我正在考虑使用php创建一个sqlite数据库,并将应用程序直接连接到数据库,但我还没有找到最好的方法。

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. 相反,您应该创建一个在服务器上运行的中间件(REST / SOAP Web服务)。 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. 这个中间件将依次与数据库和您的移动应用程序连接,无论是Android,iOS还是Windows应用程序都可以与此中间件进行通信。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM