Share database between app and web

烈酒焚心 提交于 2019-12-10 18:04:43

问题


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.


回答1:


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.



来源:https://stackoverflow.com/questions/31988156/share-database-between-app-and-web

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!