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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T05:00:49+00:00 2026-05-23T05:00:49+00:00

maybe contrary to others, I´m thinking of running a webservice Server on Android. Is

  • 0

maybe contrary to others, I´m thinking of running a webservice Server on Android. Is there any Library that supports this? I think ksoap2 e.g. is only for consuming webservices, not for serving them, right?

And, if thats not possible without lengthy coding, I just need to run a HTTP Server on Android and receive binaries with it (via POST).

Can anybody give some hints?

Cheers,
Marc

  • 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-23T05:00:50+00:00Added an answer on May 23, 2026 at 5:00 am

    Finally, I´ve dismissed the thought of implementing it with a Webservice on Android-side and just managed to do it via Socket-Communication and a self-designed protocol, quite like this:

    public class AsyncTaskSocketServer extends AsyncTask<Integer, String, Integer> {
    
    private int id;
    private String TAG = "AsyncTaskSocketServer";
    
    private AsyncTaskSocketServer() {
        super();
        Random generator = new Random();
        id = generator.nextInt();
        Log.d(TAG, "created with id: " + id);
    }
    
    @Override
    protected Integer doInBackground(Integer... ports) {
    
        int port = ports[0];
        Log.v(TAG, "Trying to start on port: " + port + " with id: " + id);
    
        try {
            ServerSocket serverSocket = new ServerSocket(port);
    
            while (!isCancelled()) {
                Socket client = serverSocket.accept();
                try {
                    Log.v(TAG, "Listening on port: "
                            + port);
                    BufferedReader in = new BufferedReader(
                            new InputStreamReader(client.getInputStream()));
                    String str = in.readLine();
                    publishProgress(str);
    
                } catch (Exception e) {
                    e.printStackTrace();
                    Log.v(TAG, "Exception while socket.accept"+ id);
                } finally {
                    client.close();
                }
                client.close();
            }
        } catch (Exception e) {
            e.printStackTrace();
            Log.v(TAG, "Exception in SocketServer creation" + id);
        }
        return port;
    }
    
    @Override
    protected void onProgressUpdate(String... values) {
        super.onProgressUpdate(values);
        String message = values[0];
        try {
            NetworkQueue.MESSAGE_IN_QUEUE.put(message);
            Log.v(TAG, "received: " + message);
        } catch (Exception e) {
            Logger.log("AsyncTaskSocketServer: Exception while writing to IN_QUEUE");
        }
    }
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

maybe a few others already asked that but I couldn't find any answer to
Maybe this is a dumb question, but is there any way to convert a
Maybe that's only possible with SQLITE but is there also a trick to let
Maybe there is a similar question to this, but I couldn't find a one.
Maybe this is gonna sound naive and all, but is there something even remotely
Maybe the need to do this is a 'design smell' but thinking about another
Maybe I'm just thinking about this too hard, but I'm having a problem figuring
Maybe it's because of the dark outside, but I can't get this Position geom_text
Maybe it's wrong but I always use this query for my app: cme_only =
Maybe this is a poor question, but, I can't find a tutorial or even

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.