enzom83
enzom83

Reputation: 8310

How to send data via telnet?

I would use telnet to send a simple string to an active service that is installed on Android emulator. Obviously this service has been developed by me, then, if required, I can also modify it.

How to send a string to my Service via telnet?

Upvotes: 0

Views: 3161

Answers (2)

excanoe
excanoe

Reputation: 696


The better question is how do you receive this string of data?
As Depado already has answered, if you have socket server which listens on android emulator side, for example, tcp server on localhost (192.168.1.10) and specific port (say 8000) then you can try to telnet:

telnet 192.168.1.10 8000

And 192.168.1.10 for example should be network IP address which is binded to android emulator, but I'm not sure how this part is done.

Update
As stated here: http://developer.android.com/guide/developing/devices/emulator.html :

If you want to access services running on your development machine's loopback interface (a.k.a. 127.0.0.1 on your machine), you should use the special address 10.0.2.2 instead.

Also read section: Emulator Networking.

Hope this helps!

Upvotes: 2

Depado
Depado

Reputation: 4929

Connect to your service via telnet and then type what you want, then type enter and it will send a string to the listener of your application. (That's how telnet works in my head, but maybe I'm wrong)

Upvotes: 1

Related Questions