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

  • Home
  • SEARCH
  • 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 8448375
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 10, 20262026-06-10T10:24:37+00:00 2026-06-10T10:24:37+00:00

I am finished with an Android client code, its working; and for the time

  • 0

I am finished with an Android client code, its working; and for the time being the data that was supposed to be received from apache http server was emulated to get data from sd card.

Now, I am working on the server side code in Python, using the socket library; and testing the default socket example from python socket documentation.

The problem I am facing is that the Android client can’t connect to this server side code.

Android side code trying to connect:

urlString = "http://10.0.2.2/cgi-bin/serverconnect.py";
URL url = new URL(urlString);
URLConnection conn = url.openConnection();
HttpURLConnection httpConn = (HttpURLConnection) conn;
try{
httpConn.connect();
......
}

Where serverconnect.py is:

# Echo server program
import socket

HOST = '127.0.0.1'     # Symbolic name meaning all available interfaces
PORT = 80              # Arbitrary non-privileged port
s = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
s.bind((HOST, PORT))
s.listen(1)
conn, addr = s.accept()
print 'Connected by', addr
while 1:
    data = conn.recv(1024)
    if not data: break
    conn.sendall(data)
conn.close()

Clues, and hints are required from experts…
Thanks

  • 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-10T10:24:38+00:00Added an answer on June 10, 2026 at 10:24 am

    The initial problem with this code is solved, which was the target Android version was 3.x +
    So I needed to use a different thread for the network access. Have started a new thread with a different problem so thanks everyone for responding.

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

Sidebar

Related Questions

Just finished my code to use the default Media Player from Android, pretty pleased
I have just finished my android application and now it's time to test it
I want to deliver a finished and working Titanium App to Android customers. But
I'm working on a simple text adventure for Android and have finished the navigational
I'm trying to compile and run the task-android-sample code from Google's API website. I
I have a socket server running on an android device. Then from a client
I'm adding AdMob ads (say that five times fast) to my finished, published Android
I have android app that talks to server and syncs some data int SQLite
I am making a IM client for android and I am working with databases
I have basically finished developing an android app that makes use of SQLite databases

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.