Back to Top

How to use JSON Response of Web service in PhoneGap?

To use JSON Resonse of Webservice in Phonegap Android

Few months ago, while developing an Android Application, I was faced with a situation taken more than 2 hours of my time and finally I have solved that issue. The issue was simple, I was unable to use JSON response of web service in PhoneGap android.

Moreover When I was trying to get data into chrome advanced Rest client, I was getting nothing, only blank is response and if I print it into browser, it was simply working

After spending time on the google search, many possibilities and get the final solution which I am going to share with you.I hope it will save someone valuable time and useful

Here is the code,let’s check it out.

To call web service using PhoneGap and jQuery mobile for calling web service, you have to call JSONP to get data from other server and JSONP returns callback.

Here I have used condition for callback value. If you get callback value, return that or you can display directly with header content type if you are not getting callback value.

Some Articles,You may like to read:

SQLite statements used in Android/iOS using PhoneGap
To setup SQLite for Android-Phonegap application
Getting Started With PhoneGap

Hope this article helps someone.As always, thanks for reading. Don’t Forget to Follow us on Twitter or Subscribe us to Get the Latest Updates.

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.

Most Popular Posts

Learn ElasticSearch in 10 Minutes

Posted on 9 years ago

Bhumi

Facade implementation in Laravel

Posted on 7 years ago

Bhumi