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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 1, 20262026-06-01T00:43:53+00:00 2026-06-01T00:43:53+00:00

I want to write an application for Android, a card game that can be

  • 0

I want to write an application for Android, a card game that can be played both locally and online. That means we have clients (Android phones), and servers. Ideally, an Android phone should be able to be used as a server and host a game (and play it at the same time). I don’t want to duplicate code between the server and the client.

Here is what I had in mind: having the application contain the server part, that would be runnable indepently by the application itself, or without the application (on a computer).
In a local game, a thread would be run for the server, and another one for the client (which communicates with the local server through localhost). In an online game, a distant server is running, and the local client communicates with it through the network.

My questions are:

  1. Will my application be able to communicate with a thread that comes from itself, through localhost?
  2. Can I have the entire application as the server? On the phone, it would run the server thread, then the client thread (do I need one?). On the distant server (desktop computer), I would run only the server thread, without all the Android stuff.
  3. Do you have an other idea?

I hope I have been clear enough for you to understand the problem.
Thanking you in advance.

  • 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-01T00:43:54+00:00Added an answer on June 1, 2026 at 12:43 am

    Yes, your app could communicate with itself through TCP sockets, that shouldn’t be a problem. I’d advise you to take a look at putting most of the server functionality into a jar file, then you would have an Android APK and potentially a separate Java frontend for your desktop. You will likely need to have a little hosting code that’s specific to each platform. It might make sense to put your server in an Android Service for example if you want to be able to host in the background.

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

Sidebar

Related Questions

I want to write an android application that can parse files. I have figured
I have an Android application that writes data to the SD card. I want
I want to write an Android application that can display some data received(polled) from
I want to write an application for Android devices that interacts with the surface
I want to write an Android remote control application that allows people to navigate
I want to write an application that will be running on several phones (android,
I have 2 editText objecst in my android application. I want write to such
I want to write an Android application that uses the Remember the Milk API
_Hey, I have a question. I want to write application which will have multiple
I want to write an application that monitors a music player. In my app

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.