开发者

Not able to communicate with other devices using Android Emulator

开发者 https://www.devze.com 2023-04-04 10:41 出处:网络
I am running Android Emulator, When I try to send a text message to a device it fails although I can connect to the int开发者_如何学Pythonernet and browse web.The top line say\'s I am on 3G not Wi-Fi.

I am running Android Emulator, When I try to send a text message to a device it fails although I can connect to the int开发者_如何学Pythonernet and browse web.The top line say's I am on 3G not Wi-Fi.


JPM's answer describes how to emulate receiving an SMS, but it seems that you've misunderstood the way that SMS messages work. They are not sent over the Internet, or at least not immediately after leaving your phone. Rather, they are sent to the service provider in frames in between calls; thus, they are different than when your phone downloads a web page or sends an IM using a standard data connection. This is also why SMS messages are charged for separately (and exorbitantly) from your data plan.

The Android emulator says you're on 3G, but it's actually connected to a simulated 3G connection which piggybacks off of your computer's Internet connection. That connection has no means of sending an SMS message.


When trying to test SMS based program on Android, you have to simulate receiving SMS. Fortunately, with the SDK, you can simulate the SMS coming to the Emulator. We have just to connect to emulator using telnet and there we can emulate the SMS. Below step by step to emulate the SMS:

Start the emulator, you free to give the option, For example just type emulator on shell prompt. Open a new shell and type :

adb devices

to know the port emulator used. The console of the first emulator instance running on a given machine uses 5554 port, The command above just to make sure which port the instance used. Connect to the console using telnet command like:

telnet localhost 5554

After you have come to the shell you can emulate sms with command:

sms send <phonesender> <text message>

(Wish you could do this for Bluetooth too but alas it is not so)

0

精彩评论

暂无评论...
验证码 换一张
取 消