3

Referred to this link and i have done sample Client/Server Apps using android.The apps work well on GSM sim's able to send and receive packets,but on CDMA device i am not able to receive any packets but able to send packets. Ip address details is drawn from this app

Whats going on here?

NitZRobotKoder
  • 1,046
  • 8
  • 44
  • 74
  • 2
    Is the IP address a real internet address or a [private](http://en.wikipedia.org/wiki/IP_address#IPv4_private_addresses) one? You can't reach those privates ones. – zapl Sep 19 '13 at 10:17
  • @zapl i am using InetAddress inetAddress = inetAddress.getHostAddress(); i am getting an IP address which works on GSM.The app also displays the same Network Info 2.Just saw in wiki my IP address fetched is B/W this 10.0.0.0 10.255.255.255. how can i reach them? – NitZRobotKoder Sep 19 '13 at 10:21
  • 3
    See linked wikipedia page on the word "private". Some IP addresses are reserved for private networks and some mobile providers use that. If you send data to their public IP address (browse to e.g. http://whatsmyip.net/ on the CDMA device to see it's public address) you actually send data to some NAT router of the provider and packets won't be forwarded to the device unless it's a reply - http://en.wikipedia.org/wiki/UDP_hole_punching – zapl Sep 19 '13 at 10:31
  • 1
    @zapl Cheers. In fact i tried this whatsmyip.net site and tried sending data to it and it did not work.Coming to this " unless it's a reply" you are right when i made CDM device as Server i was receiving msg back. – NitZRobotKoder Sep 19 '13 at 10:46
  • Hi i am not receiving the UDP packets if sim is present in the android device! What may be the problem – George Thomas Aug 23 '16 at 09:41
  • @GeorgeThomas CDMA or GSM? – NitZRobotKoder Aug 23 '16 at 12:20
  • i tried with GSM simcard – George Thomas Aug 24 '16 at 04:54
  • @GeorgeThomas should work if you had followed http://docs.oracle.com/javase/tutorial/networking/datagrams/clientServer.html it worked for me.. – NitZRobotKoder Aug 24 '16 at 07:57

0 Answers0