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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 8, 20262026-06-08T15:34:12+00:00 2026-06-08T15:34:12+00:00

I recently did a project on Android 3.2 to send strings to a server

  • 0

I recently did a project on Android 3.2 to send strings to a server in my PC with a TCP connection. I had to do a thread to achieve this, something that I didn’t have to do in a Java program. I also used the AsyncTask method, but I couldn’t send information with other functions besides the doInBackground function, in which I created the socket connection.

To send the strings, I created a loop in the doInBackground function, so it was waiting to receive a new message to send to the computer all the time. The problem with this is that I can’t do bidirectional communication. After this project, I continued to try to send the string with other function besides the doInBackground function in which. Finally, I was able to succeed with Android 1.6.

It’s a shame that this method can’t be used in superior versions of Android, because of the need of threads and also that you need to send the message in the same function you create the socket connection.

I was wondering if there is a better way to perform duplex operations in newer versions of Android.

  • 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-08T15:34:14+00:00Added an answer on June 8, 2026 at 3:34 pm

    You can use Threads in any android version.

    The right way to do what you want, would be to create a Service ( http://developer.android.com/reference/android/app/Service.html ) and use separate Threads in the Service to send and to recieve data.

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

Sidebar

Related Questions

I recently upgraded my project to Mono For Android v4.2. With this update, when
I had a problem recently with a php project that I finally realised was
I had something like the following code in a project I recently worked on.
I recently did a Oracle to SQL Server 2008 R2 Migration. The PL/SQL stored
So i've been playing around a both with box-shadows, i recently did something just
I re-did my portfolio site recently, and I'm trying to make it so that
I recently published my first MVC 2 project to a commercial web server, running
Recently had to downgrade a project from .NET 3.5 to .NET 2.0 because it
I recently implemented Authlogic to my project for authentication. I followed http://railscasts.com/episodes/160-authlogic and had
I recently finished a project in which I was generating lists of strings, and

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.