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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 18, 20262026-06-18T05:20:47+00:00 2026-06-18T05:20:47+00:00

I want to build an application to send data from Android client to Java

  • 0

I want to build an application to send data from Android client to Java localhost server, then return the replay from server to client, how can i build server? and to send the data pelase?

  • 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-18T05:20:48+00:00Added an answer on June 18, 2026 at 5:20 am
    1. on Android: you have to set the server IP, so if you are working on Emulator you have to use 10.0.2.2, If you want to try it on real device using WIFI then you have to use your PC’s IP.
    2. On Android:
    URI website;
    try {
        HttpClient client = new DefaultHttpClient();
        website = new URI("http://"+ IP+ ":8080/ServerName/ServletName");
        HttpPost request = new HttpPost();
        request.setHeader("Data Name", Data Value);
        request.setURI(website);
        HttpResponse response = client.execute(request);
        // Response From Server
        Header[] headers = response.getAllHeaders();
        for (int i = 0; i < headers.length; i++) {
        Header h = headers[i];
        }
        } catch (URISyntaxException e) {
             e.printStackTrace();
        } catch (ClientProtocolException e) {
            e.printStackTrace();
        } catch (IOException e) {
            e.printStackTrace();
       }
    
    1. Building Server : Eclipse File -> New -> Dynamic Web Project.
    2. Creating Servlet: on the server, right click on src folder, add you package -> new servlet.
    3. On server: in the method doPost
    String value = request.getHeader("Data Name");
    response.setHeader("Response1", "Value");
    

    note

    I show you how to send data using the headers of the response and request, you can use inputstream and outstream for huge data.

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

Sidebar

Related Questions

I want to build flash application that can detect the user eyes color and
I want to build an application that exports user data of another app. The
I want to build an android application which will recognize my voice, convert it
I want to build an android application, this application allow the users to answer
I want to build a web application where users can register and have a
I want to unit test a Java application that fetches mails from an email
I want to build simple camel application, which will get xml from URL and
I want to build an application that enables users to schedule emails to send
I have a client/server application written in C#/.NET 3.5 that I want to do
I want to build desktop application for Windows OS and use Google Drive to

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.