0

I have a dynamic website. It uses mysql database which is provided by the hosting team. I need my android app to use the same database. How could I integrate the same.?

Riyas TK
  • 1,231
  • 6
  • 18
  • 32
  • quite broad question. While there are tons of answers, you can look to implement REST on server side – dawez Oct 30 '14 at 08:17
  • i uses rest api for the same. For website purpose, I use angulajs $http method for accessing the rest api. Can I use the same $http method in phonegap? – Riyas TK Oct 30 '14 at 08:57
  • so you are on the right way, have a look here [How to call SOAP service from Phonegap (iPhone app)](http://stackoverflow.com/questions/11542195/how-to-call-soap-service-from-phonegap-iphone-app) there is an interesting answer with some links. Basically your app will call a webservice and retrieve JSON / XML or something else... – dawez Oct 30 '14 at 09:02

1 Answers1

0

An Ajax request in Cordova/Phonegap is the same as using the standard jQuery:

For retrieving data I used in my app [minimalist code]:

  $.getJSON(url).done(function (jsonData) {
                console.debug('retrieved JSON');
                // process your data here
            }).fail(function () {
                console.debug('cannot retrieve remote URL');
                // error occurred
            });

See also here: Calling a REST service from a Cordova application using jQuery and othere questions here in SO such as: How to call SOAP service from Phonegap (iPhone app).

Community
  • 1
  • 1
dawez
  • 2,714
  • 2
  • 29
  • 50