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

  • Home
  • SEARCH
  • 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 7787037
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 1, 20262026-06-01T20:32:27+00:00 2026-06-01T20:32:27+00:00

I am trying to call a REST webservice from an Android app that I

  • 0

I am trying to call a REST webservice from an Android app that I am running on an emulator. I can call the service from my browser with

http://localhost:39064/AndroidServiceImpl.svc/submitexcerpt?excerpt=...and+the+pirate+fell+off+the+boat

I can call the service from my emulator with

http://10.0.2.2:39064/AndroidServiceImpl.svc/submitexcerpt?excerpt=...and+the+pirate+fell+off+the+boat

But when I run this code:

HttpClient httpclient = new DefaultHttpClient();
HttpResponse response1;
response1 = httpclient.execute(new HttpGet("http://10.0.2.2:39064/AndroidServiceImpl.svc/submitexcerpt?excerpt=testingthisout"));

I get a connection refused exception. I have added the <user-permission android:name="android.permission.INTERNET"></user-permission> to my Manifest file, and set the ThreadPolicy to LAX but still no luck. Any Suggestions?

  • 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-01T20:32:28+00:00Added an answer on June 1, 2026 at 8:32 pm

    I got the answer rather than putting
    <user-permission android:name="android.permission.INTERNET"></user-permission>
    I needed
    <uses-permission android:name="android.permission.INTERNET"></uses-permission>

    So just some bullet points on calling a webservice:
    *add to Manifest.xml file
    <uses-permission android:name="android.permission.INTERNET"></uses-permission>
    <uses-permission android:name="android.permission.ACCESS_NETWORK_STATE"></uses-permission>
    *use 10.0.2.2 rather than localhost for a locally consumed service
    *Set the Thread Policy to lax(not recommended for production) or use AsyncTask
    ThreadPolicy tp = ThreadPolicy.LAX;
    StrictMode.setThreadPolicy(tp);

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

Sidebar

Related Questions

Trying to call a SAP SOAP Web Service from a generated sudzc app shows
I have a REST service that I'm trying to call. It requires something similar
I'm trying to call a web service from Excel 2003 module. The way i've
A consumer is trying to call my REST API from client-side code (Javascript /
I'm trying to load a jqGrid from json data made via a REST call.
So I'm trying to create a C# WCF REST service that is called by
I'm trying to call a rest webservice provided by a lims system (basically a
I have an AJAX Enabled REST Web Service self hosted at http://localhost/machinename/ and a
I am trying to display JSON data that I retrieve from an ajax call
I'm trying to get a string using a http call. I am noticing that

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.