PHP/Mysql site integration with Phonegap App

Asked

Viewed 4,212 times

6

I’m creating a website and app with Phonegap, I’m new to programming for mobile platforms.

This site has a database and I want this database to be available directly in the App, but I don’t want remote access in the database.

How can I send a request for the PHP of the site, and it return me a result to be presented in the App using JS? You can make a BD "cache" in the App, make a copy daily, or when there is an update in the BD?

  • This question is interesting, because it deals with the creation of Apis, traffic and data exchange between different domains (cross-Omain), use of jsonp and possibly localstorage or indexdb/websql (for the "cache" of the database answers), it is quite something, but the subject is pertinent.

2 answers

3

You first need to choose a local database in Phonegap, where Mysql is not available. Maybe Sqllite... Then via AJAX make a request for a server-side configured Webservice (where Mysql is) to bring the central bank contents and update the location. This Webservice can be created in PHP or any other language.

As mentioned, depending on the size of the database this may not be feasible, either by generating too much traffic or by the synchronization routine consuming too much device resources.

0

Friend a way I found for this is through webservices. On the issue of making a copy of the bd is possible, just need to see if it is really feasible since the application with phonegap suffers from problems of slowness making the use to the end user a little tedious.

Browser other questions tagged

You are not signed in. Login or sign up in order to post.