Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6197289
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 24, 20262026-05-24T03:47:42+00:00 2026-05-24T03:47:42+00:00

I have a mobile web application built using the following versions :- JQuery Mobile

  • 0

I have a mobile web application built using the following versions :-

  1. JQuery Mobile : Alpha 4 v1.0a4.1
  2. JQuery: v1.6.1
  3. PhoneGap : v0.9.5

Using phonegap, this application is built into a native android application and deployed.

In my application, i make various AJAX calls using $.ajax to external websites.
For this i employ dataType: ‘jsonp’ inorder to do the cross domain calling.

When i was testing my app in Chrome v12.0.742.100, everything was working fine and I had no issues with retrieving the data from the external sites. However, as soon as i packaged this into a .apk file and try to run this in the emulator, i find that none of the ajax calls are working.

I have put alerts before and after the ajax call and verified that both alerts are called but the ajax call is as good as ignored. I have logging in both the success callback and the error callback and neither is being reached. I have also verified by puting a breakpoint on the external server website (for my testing, i am just having a separate website on my local machine itself) and the server page is definitely not being called.

In logcat, the error that i can see is this :
D/SntpClient( 59): request time failed: java.net.SocketException: Address family not supported by protocol

I am pretty new to phonegap as well as Jquery Mobile but as far as my understanding goes, my phonegap app file is referenced by file:/// protocol whereas my AJAX URL is http://127.0.0.1:someport/someapp/somepage and the error seems to be indicating that these two dont mix!! If this is indeed the case, how do i go about make ajax calls from a phonegap deployed application?

Please feel free to point out anything else that may be helpful! I am pretty stumped at this point.

Edit : I have checked the AndroidManifest.xml file and all the permissions as per this phonegap wiki link are set in this file.

Edit 2 : Adding in my client side code that intitiates the ajax call

var serverUrl = "http://localhost:2424/MyServer/RetrieveMasterData.aspx";
            $.ajax({
                url: serverUrl,
                type: 'POST',
                dataType: 'jsonp',
                data: { MasterDataID: 1 },
                success: function(response) {
                        ...... business logic here
                },
                error: function(xhr, ajaxOptions, thrownError) {
                        ...... error handling something here
                }
            });
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-24T03:47:43+00:00Added an answer on May 24, 2026 at 3:47 am

    Android emulator does not recognize “localhost”…it should be 10.0.2.2 instead.
    try changing the url to
    http://10.0.2.2:2424/MyServer/RetrieveMasterData.aspx

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

We have a web based application in production built using django. It is deployed
I'm in early (pre-coding) stages of developing a mobile web application using jQuery Mobile
I have this configuration in my application. ~/sitemap.aspx ~/Web.sitemap ~/mobile/sitemap.aspx ~/mobile/Web.sitemap mobile folder is
I have built a web-app for iphone using iUi framework. As you may already
I have web application for mobile (developed in .net), I want to use iPhone
I have developed a web application for mobile phones that uses JavaScript Google API.
I have a WCF service. And in my mobile application I generated a Web
I have a fairly standard ASP.Net web application which is used via mobile safari
I'm developing a mobile web application and I have a home screen with a
i have web and mobile application. On my web application i have url address

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.