我有一个动态的网站。它使用由托管团队提供的mysql数据库。我需要我的android应用程序才能使用相同的数据库。我该如何整合呢?

最佳答案

Cordova / Phonegap中的Ajax请求与使用标准jQuery相同:

为了检索我在我的应用中使用的数据[最小化代码]:

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


另请参见:Calling a REST service from a Cordova application using jQuery和SO中的其他问题,例如:How to call SOAP service from Phonegap (iPhone app)

关于mysql - 将phonegap与mysql数据库集成,我们在Stack Overflow上找到一个类似的问题:https://stackoverflow.com/questions/26647283/

10-12 17:24
查看更多