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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 2, 20262026-06-02T20:15:20+00:00 2026-06-02T20:15:20+00:00

I have a wamp server. I have written my android client. If I run

  • 0

I have a wamp server. I have written my android client. If I run that app, the response is fine on an emulator…but the same code does not work on the real device, I mean I dont get a response…..

Here s the code…

public static final String SERVER_URL = "http://192.168.1.3/AndroidListServer/server.php?command=getAnimalList";
private static String executeHttpRequest(String data) {
  String result = "";
  try {
   URL url = new URL(SERVER_URL);
   URLConnection connection = url.openConnection();

   /*
    * We need to make sure we specify that we want to provide input and
    * get output from this connection. We also want to disable caching,
    * so that we get the most up-to-date result. And, we need to 
    * specify the correct content type for our data.
    */
   connection.setDoInput(true);
   connection.setDoOutput(true);
   connection.setUseCaches(false);
   connection.setRequestProperty("Content-Type", "application/x-www-form-urlencoded");

   // Send the POST data
   DataOutputStream dataOut = new DataOutputStream(connection.getOutputStream());
   dataOut.writeBytes(data);
   dataOut.flush();
   dataOut.close();

   // get the response from the server and store it in result
   DataInputStream dataIn = new DataInputStream(connection.getInputStream()); 
   String inputLine;
   while ((inputLine = dataIn.readLine()) != null) {
    result += inputLine;
   }
   dataIn.close();
  } catch (IOException e) {
   /*
    * In case of an error, we're going to return a null String. This
    * can be changed to a specific error message format if the client
    * wants to do some error handling. For our simple app, we're just
    * going to use the null to communicate a general error in
    * retrieving the data.
    */
   e.printStackTrace();
   result = null;
  }

  return result;
 }
  • 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-02T20:15:21+00:00Added an answer on June 2, 2026 at 8:15 pm

    Solved it guys….it was the problem with the firewall as Rajesh mentioned…I should do a thorough testing of all the possible parameters….but hey I’m learning 🙂

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

Sidebar

Related Questions

I have a php file that works perfectly with WAMP server, but when Im
Iam running WAMP server and just enabled php_memcache extension and have tried the code
I have just started connecting android app with php My file works very fine
I have never developed for WAMP, the hosting guy for my new client says
Thanks in advance. I have Installed WAMP Server on System 4(192.168.1.104). I can Connect
I have installed PHP using wamp server in Windows and I have give the
I have a small server problem when working with LAMPP and WAMP server in
We have an application which uses WAMP server. Now, there is a new requirement
I have a default installation of WAMP Server 2.0. I'm trying to send email
I have installed PDT for Eclipse and WAMP server. I want to know how

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.