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 8141115
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 6, 20262026-06-06T12:23:35+00:00 2026-06-06T12:23:35+00:00

I am trying to invoke webservice using jquery ajax call. I am using jasonp

  • 0

I am trying to invoke webservice using jquery ajax call.
I am using jasonp as a datatype to fix cross domain issues.

It works fine in all browsers. i tested it on other domains. i am getting a valid responce.
When i try to run it from android device emulator webservice call fails.

Please suggest.

Code :

function getJsonData()
{
    alert("Within get json function.. ");
    (function($) {
    var url = 'http://localhost:8080/mobile-services/rest/languages.json?callback=callback';
    $.ajax({
       type: 'GET',
        url: url,
        async: false,
        contentType: "application/json",
        dataType: 'jsonp'
    });
})(jQuery);
}
function callback(data)
        {
            alert(data);
        }

webservice response.

callback([{"language":"English","id":1},{"language":"Hindi","id":2},{"language":"Marathi","id":3}])

which is a valid jsonp response.

Android manifest file permissions.

<uses-permission android:name="android.permission.CAMERA" />
    <uses-permission android:name="android.permission.VIBRATE" />
    <uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION" />
    <uses-permission android:name="android.permission.ACCESS_FINE_LOCATION" />
    <uses-permission android:name="android.permission.ACCESS_LOCATION_EXTRA_COMMANDS" />
    <uses-permission android:name="android.permission.READ_PHONE_STATE" />
    <uses-permission android:name="android.permission.INTERNET" />
    <uses-permission android:name="android.permission.RECEIVE_SMS" />
    <uses-permission android:name="android.permission.RECORD_AUDIO" />
    <uses-permission android:name="android.permission.MODIFY_AUDIO_SETTINGS" />
    <uses-permission android:name="android.permission.READ_CONTACTS" />
    <uses-permission android:name="android.permission.WRITE_CONTACTS" />
    <uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
    <uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
    <uses-permission android:name="android.permission.GET_ACCOUNTS" />
    <uses-permission android:name="android.permission.BROADCAST_STICKY" />
  • 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-06-06T12:23:36+00:00Added an answer on June 6, 2026 at 12:23 pm

    In web service URL try using 10.0.2.2 instead of localhost.
    localhost or 127.0.0.1 points to emulator / android device while 10.0.2.2 is a special alias to your host loopback interface (i.e. 127.0.0.1 on your development machine). Check this Link for more details.

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

Sidebar

Related Questions

I was trying to invoke a webservice from phonegap android app using jQuery .ajax
I am using ASP .Net 3.5 and trying to invoke a WebService using javascript
I am trying to invoke a WebService through SOAP using Erlang and YAWS (yaws_soap_lib
I am using C# 2.0, I am trying to call webmethod of my webservice,
I'm trying to consume a WCF webservice using the RPC capabilities of the Protobuf-net.
I am trying to invoke a webservice method which takes 2 input parameters and
I am trying to invoke method via webservice (SOAP) I have generated Web service
I'm trying to call the Marketo SOAP Webservice via ASP.NET / C#. I successfully
I am trying to expose one method as webservice from backend using JAX-WS with
I'm trying to decide whether to use a custom ASP.Net Ajax Extender or jQuery

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.