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.

Share:
Share on Facebook0

Share on LinkedIn0Tweet about this on TwitterShare on Google+0Buffer this pageDigg thisShare on Reddit0

Leave a Reply

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

Most Popular Posts

How to Import Users in MODx from CSV file

Posted on 4 years ago

Bhumi

The Readers’ Poll – July 2013

Posted on 3 years ago

Bhumi

How to Use the HTML5 Full-Screen API

Updated 17 years ago

Bhumi

What are Lambdas and Closures in PHP?

Updated 17 years ago

Bhumi

MySQL REGEXP Operator

Updated 17 years ago

Bhumi

HTML5 Geolocation API with Example

Updated 17 years ago

Bhumi

Overview of Views in MySQL

Updated 17 years ago

Bhumi

The Reader’s Poll – June 2015

Posted on 2 years ago

Bhumi

The Reader’s Poll – August 2014

Posted on 2 years ago

Bhumi

The Reader’s Poll – June 2014

Posted on 3 years ago

Bhumi

The Readers’ Poll – May 2014

Posted on 3 years ago

Bhumi

The Readers’ Poll – August 2013

Posted on 3 years ago

Bhumi