-1

I am planning to create an android application that will communicate into a pc server. does java socket programming works with different internet to android mobile device? example is my android mobile device is using gprs while my pc server is connected to dsl/modem

10
  • Probably not, because your pc is probably on private network. You could do it if they both were on same network, ie. wifi. Commented Jan 18, 2014 at 8:11
  • If only you could downvote comments. Hint: there's only one internet. Commented Jan 18, 2014 at 8:13
  • why, is something wrong with my comment? Commented Jan 18, 2014 at 8:14
  • Dude i tried doing it and my pc was on one (private network) and phone on wifi network on same provider. It did not work until they were both on same network, because routers block connections to private IP addresses. Learn stuff before you post some nonsense. en.wikipedia.org/wiki/Private_network Commented Jan 18, 2014 at 8:18
  • 1
    Only for the last 15 years or so. Why do you think some games and things like bittorrent have you forward ports? There's an entire small industry of dynamic DNS providers to allow you to map a domain name to your home IP address. Commented Jan 18, 2014 at 8:42

1 Answer 1

1

Yes, they do work and there are many applications that are built on such a set-up. Try out simple client-server examples. Concentrate on creating the server first. You have to make sure that the firewall that your PC server is on, allows the server to accept connections and also that the IP address that you are connecting to is not a local IP. Check out the articles here, here etc

Sign up to request clarification or add additional context in comments.

4 Comments

sir how about if their distance is like 40 meters ? does it still works ? thankyou for your reply! :)
I am talking about the client and server being on the internet. So, distance does not matter at all. If you want it to be accessible over a local area network only, then, both have to be on the same network.
thankyou verymuch sir! now i have some ideas about socket :) cheers
Glad to help. Accept the answer if it did answer your question.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.