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.Dejan– Dejan2014-01-18 08:11:18 +00:00Commented Jan 18, 2014 at 8:11
-
If only you could downvote comments. Hint: there's only one internet.Brian Roach– Brian Roach2014-01-18 08:13:09 +00:00Commented Jan 18, 2014 at 8:13
-
why, is something wrong with my comment?Dejan– Dejan2014-01-18 08:14:19 +00:00Commented 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_networkDejan– Dejan2014-01-18 08:18:48 +00:00Commented Jan 18, 2014 at 8:18
-
1Only 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.Brian Roach– Brian Roach2014-01-18 08:42:05 +00:00Commented Jan 18, 2014 at 8:42
|
Show 5 more comments
1 Answer
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
4 Comments
user3077550
sir how about if their distance is like 40 meters ? does it still works ? thankyou for your reply! :)
Srikanth
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.
user3077550
thankyou verymuch sir! now i have some ideas about socket :) cheers
Srikanth
Glad to help. Accept the answer if it did answer your question.