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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 21, 20262026-05-21T11:23:26+00:00 2026-05-21T11:23:26+00:00

I have built a java server app and am trying to get my android

  • 0

I have built a java server app and am trying to get my android app to communicate with it. After reading Android Client Server communication I tried the socket example. However I have run into a wall because on the server side I can return an array of my object but on the client side I’m not able to retrieve it since buffereader takes a string only
Server code

public List<Person> processInput(String theInput) {
    String peopleOutput = null;
        List<Person> people = new ArrayList<Person>();



    if (state == WAITING) {
               SqliteDBhelper db = new SqliteDBhelper();
                people = db.getPeople();
return people;

Client code

BufferedReader stdIn = new BufferedReader(new InputStreamReader(System.in));
List<Person> fromServer;
String fromUser;

while ((fromServer = in.readLine()) != null) {
  List<Person> people = new ArrayList<Person>();
  Person person = new Person();
  people = fromServer;

So from the looks of it I cannot pass an object via this socket method. Will the json do what I need? I just dont want to spend another day coding somthing that won’t work for me. All I’m trying to do is have a db that my server has access to, the server reads the db and returns the table data in the form of my objects.

  • 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-21T11:23:27+00:00Added an answer on May 21, 2026 at 11:23 am

    On the client your reading not from the socket but from the standard input. But you should read from the socket instead:

    http://download.oracle.com/javase/tutorial/networking/sockets/readingWriting.html

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

Sidebar

Related Questions

Does Java have a built-in way to escape arbitrary text so that it can
We have a Java Applet built using AWT. This applet lets you select pictures
In our infrastructure, we have lots of little Java projects built by Maven2. Each
I have built a simple C#.Net app on a M/C with only .Net FX
I was asked to build a java system that will have the ability to
(All of the following is to be written in Java) I have to build
First of all, I know how to build a Java application. But I have
I have built an MSI that I would like to deploy, and update frequently.
I have built a web page which contains a Crystal Report built using the
I have built an application in C# that I would like to be optimized

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.