或许有仿真器发送一个短信到自己 [英] could one emulator send a SMS to itself
问题描述
我一直在试图通过广播发送的消息在Android 4.0模拟器,并获取通过广播接收器的消息。我可以用两个仿真器,说这样做,从5554到5556,但我不能从5554发送邮件到自身。以下是我发送消息的方式:
I've been trying to send message on Android 4.0 emulator via Broadcasting and fetch that message via Broadcast receiver. I'm able to do so with two emulators, say, from 5554 to 5556. However, I can't get the sent message from 5554 to itself. Here's the way I send a message:
SmsManager sms = SmsManager.getDefault();
sms.sendTextMessage(number, null, message, sentPI, deliveredPI);
在号这里是模拟器的端口号
the number here is emulator's port number
推荐答案
您可以很容易地证明,使用tellnet命令: 在Windows操作系统中,如果tellnet是关闭的,那么你可以打开使用下列步骤
You can easily demonstrate that using tellnet command : in windows os if tellnet is off then you can turn on using following steps
开始
控制面板
程序和功能
Windows功能打开或关闭
检查Telnet客户端
点击OK
Start
Control Panel
Programs And Features
Turn Windows features on or off
Check Telnet Client
Hit OK
然后写这样的命令 远程登录本地主机5554 这里5554是我的仿真器的端口号
then write the command like telnet localhost 5554 here 5554 is my emulator port number
一旦连接建立
写下面的命令填充拨付值
write the following command filling appropriated value
手机短信发送5554喜
您会看到消息已到达你的模拟器。
you will see the message has arrived in your emulator .
这篇关于或许有仿真器发送一个短信到自己的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!