I want to send a command to a device using an android application which supports gprs tcp/ip communication. I don't know how to establish connection between device and android application.
Asked
Active
Viewed 819 times
1 Answers
0
You need to know IP address or DNS name of the device and TCP port. Then you can just open socket and read/write there. However you need to ensure your device has Internet access and accessible from the Internet.

Robert Navado
- 1,319
- 11
- 14
-
I have the ip address of the device. I have seen the tcp/ip socket code in C++. Can i use the same code for this communication? Is there any effect of gprs? – Muhammad Ubaid Feb 07 '15 at 19:48
-
`you need to ensure your device has Internet access and accessible from the Internet.`. Why? Not needed. Just a W(LAN) connection will do. – greenapps Feb 08 '15 at 11:16
-
You right network access and route to device. In case of GPRS and more modern cellular connections you usually get \31 or even \32 network with some route to internet. So ensure target device accessible As for code you can use Java socket [link]http://developer.android.com/reference/java/net/Socket.html I think you have to reformat your question - it's ambiguous – Robert Navado Feb 10 '15 at 11:22