Sending and receiving text using android emulator [closed]
开发者_运维知识库
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 8 years ago.
Improve this questionI'm currently developing android application which includes text messaging. Is it possible to send and receive text messages just by using android emulator? If yes, how can I do it?
It's quite easy:
- open a console
- connect via telnet to the running emulator:
telnet localhost 5554
(you can find the portnumber in the title of the emulator) - type this:
sms send senderPhoneNumber textmessage
You can also use two emulators. Open both emulators simultaneously. They will be named emulator-5554
and emulator-5556
.
Then from one device, text (555)521-555x, where the last 4 digits are the number from the emulator name. This will allow you to text between both devices.
If you use Eclipse, its pretty easy. 1 1) Goto DDMS.
2) There, the left pane will consist of list of emulators active, select your emulator and then in the right pane you will get Emulator Control->Telephony action-> Incoming Number, Message. Type these and hit send.
3) In your emulator you will receive message.
Cheers :)
If you are working on windows: 1. Install the telnet client via the command prompt by typing
pkgmgr /iu:"TelnetClient"
2. Type telnet localhost 5554 . Here 5554 is the number that appears in the title of the emulator.
- Type sms send 1234 "message"
You are done ! Cheers ! Check your emulator for the received message
If you read the emulator documentation, you will see that you can send and receive text messages between the environment within the emulator and the emulator console.
Actually sending them out into the real world would require that you have an sms gateway service somewhere and write something to move traffic between that and the emulator.
open another emulator and check their numbers from the window title ex 5554:emulator name
and just simply type the number(5554) in "To" and hit send thats it
精彩评论