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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 18, 20262026-06-18T14:24:49+00:00 2026-06-18T14:24:49+00:00

I have two android tablets. they are using sockets to connect over wifi. I

  • 0

I have two android tablets. they are using sockets to connect over wifi. I was able to get one client to connect and send messages to the server. How can I get a second client to connect to the server?

the ultimate goal is to get 2 or 3 android tablets running the client app to connect and send messages to the server Android Device at the same time.

some sample code from the app for the server android tablet

         serverSocket = new ServerSocket(SERVERPORT);
                while (true) {
                    // listen for incoming clients
                    Socket client = serverSocket.accept();
                    handler.post(new Runnable() {
                        @Override
                        public void run() {
                            Intent intent = new Intent();
                            intent.setAction("com.example.test.state");
                            intent.putExtra("serverStatus","Connected");
                            sendBroadcast(intent);
                        }
                    });

                    try {
                        BufferedReader in = new BufferedReader(new InputStreamReader(client.getInputStream()));

                        while ((line = in.readLine()) != null) {
                        //    Log.d("ServerActivity", line);
                            handler.post(new Runnable() {
                                @Override
                                public void run() {
                            receivedCommand = line;

                            Intent intent = new Intent();
                            intent.setAction("com.example.test.diceRolled");
                            intent.putExtra("receivedLine", line.trim());
                            sendBroadcast(intent);
  • 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-18T14:24:50+00:00Added an answer on June 18, 2026 at 2:24 pm

    Put all the I/O for each accepted socket into a separate thread.

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

Sidebar

Related Questions

I used sockets to connect two Android tablets as a network over wifi using
I have two android tablets that I want to send messages from the client
android noob... I have two tables, with a one to many relationship between country_tbl
I have two Android devices. One is acting as a server and the other
I'm using eclipse, and I have two android projects which have different topics. And
I will have two android tablets working in the same retail location, both connected
In my android application Iam using viewpager.I have two fragments.Fragment1 and Fragment2.Iam calling two
This question is related to this one . I have two Android projects inside
I have two Android applications with a similar functionality but different drawables and layouts.
I have two android applications. The apks are Hello.apk and Fonts.apk I would like

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.