Back to Top

How to connect android emulator to the internet?

Solution:Internet connection issue on AndroidEmulator

Yesterday i have started Phonegap series post and In this second part of our PhoneGap tutorial series, I am going to explain about how to call web service in PhoneGap android application.

Recently I was working on web service for an Android application and I have written ajax code and the web service is running on localhost using the Android emulator but getting below issue.

Read about: Getting Started With PhoneGap

Problem:

If I execute my web service into chrome advanced rest client, It’s working perfect and gives a proper response with data. But when I am going to execute using jQuery ajax method into my android application using PhoneGap, it’s not going into success or error means it’s not giving error or success result.

Solution:

The problem was simple and I have spent more than an hour to find solution so I have checked with java developer and got that my application was not connected to access the internet from the Android Emulator and web service is using remote URL and to access internet,need to write code into AndroidManifest.xml file.

Must Read: Display Text Format Proper in IPHONE+ANDROID

After all installation of your project or setup of your project,if your webservice not called.Open your AndroidManifest.xml and place below code:

That’s it. Run your web service in Android!. I hope that you’ve found this tutorial useful.

Suggested Reading

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

Comments (2)

  1. […] series post of Phonegap,I have explained basic about phonegap and Internet connection issue in Android so Today I am going […]

  2. Hi. I found your proposed solution interesting but it is not working for me. I can insert data through jquery with a html form and a php file on my server. It works from my browser and also from the browser in my android emulator. However it odes not work in the emulated app. Everything i tried so far is not working. It feels like there is some setting avoiding my connection from the app somewhere.

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

How to use Short Hand Array in PHP

Posted on 9 years ago

Bhumi

How to install zend framework on wamp

Posted on 11 years ago

Bhumi

Inheritance in object-oriented PHP

Posted on 7 years ago

Bhumi

How To Repair MySQL Table

Posted on 13 years ago

Bhumi