I have a Delphi XE7 app pushing a notification from Windows to my Android devices using Kinvey and GCM and it's working fine. Now I wanted to do the reverse way sending text/object from Android devices to my Windows machine. Is there a way to use the same method like I did, or there is another that I should know?
Asked
Active
Viewed 598 times
2

David Heffernan
- 601,492
- 42
- 1,072
- 1,490

koul
- 431
- 2
- 10
- 20
-
You can use Sockets for sending text messages from Mobile (TIdTcpSocket ) to PC (TServerSocket) – Work 2 Enjoy - Enjoy 2 Work Mar 24 '15 at 11:53
-
@Work2Enjoy-Enjoy2Work the Indy class names are TIdTCPClient and TIdTCPServer, TServerSocket is deprecated and not part of Indy (and is bound to Windows messages, which means not cross-platform, which means you could not compile it for example on OSX) – mjn Mar 25 '15 at 07:45
-
Your question title is the opposite of the actual question (quote: 'sending text/object from Android devices to my Windows machine') – mjn Mar 25 '15 at 07:48
-
Thanks for your response. I was thinking of using REST to add row on table and on Server side add a timer to check this latest added row . that's it. Does anybody perform this way before ? – koul Mar 29 '15 at 13:30
-
Indy class should be a good solution too . Thanks again – koul Mar 29 '15 at 13:32
1 Answers
0
You can run a HTTP or HTTPS server on your Windows system which can be reached from the clients. HTTP / HTTPS ports are usually not blocked, which makes this more firewall-friendly than other protocols. Android clients then can use Indy (TIdHTTP) to send HTTP/HTTPS requests to the server. For the HTTP server you can use Indy TIdHTTPServer class.
If you want bidirectional connections, where the server can use the HTTP connection to push data to the connected clients directly, there is the WebSockets HTTP extension which uses the same ports.
For transport layer security (HTTPS) you can use a Apache or nginx reverse proxy, or the Indy SSL IOHandler.

mjn
- 36,362
- 28
- 176
- 378