[VIDEO-Tut] - Simulating incoming Phone Calls / SMS via CMD

Basic Tutorials concerning: GUI, Views, Activites, XML, Layouts, Intents, ...

[VIDEO-Tut] - Simulating incoming Phone Calls / SMS via CMD

Postby plusminus » Wed Nov 28, 2007 5:49 pm

[VIDEO-Tut] - Simulating incoming Phone Calls


What you learn: You will learn how to simulate a GSM-Call to the Android Emulator over a TelNet connection.

Difficulty: 0.5 of 5 :roll:

What it will look like:
[flash width=681 height=451]http://anddev.org/images/tut/basic/telnet_emuconnect/screencast.swf[/flash]


Description in words:
  1. The emulator has to be running :!:
  2. Open the Ttelnet-Client of your choice (on WinXP is should already be installed, on probably have to install it later on (see below how to do that on WinVista).
    Image
  3. type to it: "o localhost 5554" // dunno exactly if it is always, could also be 5555... have a try.
    I. "o" stands for "Open", "localhost" is the 'IP' and "5554" is the port the telnet-server is listening to.
    Image
  4. Connection should establish in a few seconds.
    Image
  5. type: "gsm call 123456" to simulate an incoming call.
    Image
  6. See the emulator ringing :)
Image


:idea: Simulating SMS :idea:


Simulating an incoming SMS via the Commandline/Terminal is pretty the same, but you need at least Version m3-rc37a to do that.

The Command is like this:
Code: Select all
// General style:
sms send <NUMBER> <TEXT>
// Example:
sms send 0160123456 HelloWorld



Installing TelNet-Client on Windows Vista wrote:
  1. Click Start then select Control Panel.
  2. Select Programs and Features (upper menu bar).
  3. Select Turn Windows features on or off.
  4. Select the Telnet Client option.
  5. Click OK.
  6. A dialog box will appear to confirm installation. The telnet command should now be available.


Regards,
plusminus
Last edited by plusminus on Sun Dec 16, 2007 8:10 pm, edited 5 times in total.
Image
Image | Android Development Community / Tutorials
User avatar
plusminus
Site Admin
Site Admin
 
Posts: 2688
Joined: Wed Nov 14, 2007 8:37 pm
Location: Schriesheim, Germany

Top

Postby JimCummins » Wed Nov 28, 2007 6:48 pm

Thanks for this! This is exactly what I was looking for when I came to anddev and here it is on the first page.

Jim
"I have no reason to learn this, which is what makes it interesting."
JimCummins
Junior Developer
Junior Developer
 
Posts: 10
Joined: Wed Nov 28, 2007 6:06 pm
Location: Ames, IA

Postby JimCummins » Wed Nov 28, 2007 7:10 pm

I've noticed that the telnet connection works fine but sometimes when I am logged in to the phone and run a command I get:

Code: Select all
KO: unknown command, try 'help'


This sometimes happens even when the command I am running is 'help'. :?

Fortunately if I type 'help' a few times eventually I get the help command to run properly. At the end of the help command I see 'OK' which indicates that the phone is ready to receive other commands. At this point running 'gsm call' finally works. Just keep trying and eventually the emulator will respond. :)
"I have no reason to learn this, which is what makes it interesting."
JimCummins
Junior Developer
Junior Developer
 
Posts: 10
Joined: Wed Nov 28, 2007 6:06 pm
Location: Ames, IA

Postby plusminus » Wed Nov 28, 2007 7:21 pm

Hello Jim,

I also have after correcting typos with [backspace].

simply type "quit"+ [ENTER] until the connection gets closed and reconnect after that.

Regards,
plusminus
Image
Image | Android Development Community / Tutorials
User avatar
plusminus
Site Admin
Site Admin
 
Posts: 2688
Joined: Wed Nov 14, 2007 8:37 pm
Location: Schriesheim, Germany

Postby JimCummins » Wed Nov 28, 2007 7:31 pm

plusminus,

I see now that you are correct. Backspace is indeed the culprit.

Thanks for the tip!

-Jim
"I have no reason to learn this, which is what makes it interesting."
JimCummins
Junior Developer
Junior Developer
 
Posts: 10
Joined: Wed Nov 28, 2007 6:06 pm
Location: Ames, IA

Postby tagazok » Thu Nov 29, 2007 9:25 pm

you can start the emulator by "./emulator -useaudio" or emulator.exe -useaudio to have a beautiful ring when you simulate a call :)

I discovered this today :)
L'idiot ne savait pas que cela était impossible...
...alors il l'a fait.
tagazok
Junior Developer
Junior Developer
 
Posts: 12
Joined: Sun Nov 18, 2007 4:39 pm
Location: Nice / Paris

Top

Postby JimCummins » Fri Nov 30, 2007 2:16 am

I used -useaudio with my emulator today and the sound on the ring was skippy and sounded awkward. I thought I might be low on memory but restarted to be sure. Unfortunately the skipping continues. I am going to try +/-'s MediaPlayer tutorial to confirm that it is emulator wide and not just a problem with "ringing".
"I have no reason to learn this, which is what makes it interesting."
JimCummins
Junior Developer
Junior Developer
 
Posts: 10
Joined: Wed Nov 28, 2007 6:06 pm
Location: Ames, IA

Postby plusminus » Fri Nov 30, 2007 7:44 am

Hello JimCummins,

Yes, it is emulator wide. Something seems to be not optimal, as CPU usage doesn't really peak here. (Remember this is still a Developers Preview :!:).

Regards,
plusminus
Image
Image | Android Development Community / Tutorials
User avatar
plusminus
Site Admin
Site Admin
 
Posts: 2688
Joined: Wed Nov 14, 2007 8:37 pm
Location: Schriesheim, Germany

SMS doesnt Work

Postby waruna » Sat Dec 22, 2007 8:20 pm

Hi All,
I try to simulate a SMS using CMD but didnot work.
I have the latest SDK version as well.
Can any one suggest a solution.

Thanks in Advance
Waruna
Waruna de Silva
Ceylon Linux, SLIIT, LK-LUG
waruna
Once Poster
Once Poster
 
Posts: 1
Joined: Sat Dec 22, 2007 8:17 pm

Postby plusminus » Sun Dec 23, 2007 2:39 pm

Hello Waruna,

Can you simulate Phone-Calls :?:
what is the "error"-message shown in the console :?:

Or is there no "error"-message but nothing happens in the emulator (like "SMS received"-Popup) :?:
:idea: If "yes" to the last question :arrow: :src: go here.


Regards,
plusminus
Image
Image | Android Development Community / Tutorials
User avatar
plusminus
Site Admin
Site Admin
 
Posts: 2688
Joined: Wed Nov 14, 2007 8:37 pm
Location: Schriesheim, Germany

Postby derek_lan » Sat Jan 12, 2008 4:32 pm

very cool. if u could not test ,maybe u should update your SDK
derek_lan
Freshman
Freshman
 
Posts: 8
Joined: Tue Dec 25, 2007 10:31 am

Postby plusminus » Sat Jan 12, 2008 5:23 pm

Hello derek_lan,

what do you mean :?:
In a clean emulator, nothing will happen when you receive a simulated SMS, because there is no built in Application handling SMS at the moment (m3-rc37a).

Regards,
plusminus
Image
Image | Android Development Community / Tutorials
User avatar
plusminus
Site Admin
Site Admin
 
Posts: 2688
Joined: Wed Nov 14, 2007 8:37 pm
Location: Schriesheim, Germany

how can recieve sms in the emulator?

Postby myhrvod » Tue Aug 12, 2008 6:44 am

when i send one sms via the command line with sms send helloworld,how can recieve it in the emulator?
No best, Only better!
myhrvod
Freshman
Freshman
 
Posts: 7
Joined: Mon Aug 04, 2008 6:13 am

Re: [VIDEO-Tut] - Simulating incoming Phone Calls / SMS via

Postby nguyendat » Wed Nov 10, 2010 4:55 am

Hi all
another simple solution for create Incoming Call/SMS is using DDMS:
Step1: Start ddms.bat under tools folder
Step2: On the Left Panel: select devices which you want to send call/message (Usually is emulator-5554)
Step3: On the Right Panel: select tabs [Emulator Control]
Check setting in [Telephony Status] and [Telephony Action]

Done!
nguyendat
Freshman
Freshman
 
Posts: 3
Joined: Mon Jan 05, 2009 4:18 am

Re: [VIDEO-Tut] - Simulating incoming Phone Calls / SMS via

Postby adameve24 » Fri Dec 17, 2010 4:54 pm

hi plusminus, i liked ur post a lot. but i have one problem. i create two instances of emulator. number for one is 5554 nd other is 5556. i write following commands-

telnet
o localhost 5554
gsm call 5556

it says ok.

sometimes on 5554 a calling window is shown for a second and 5554 itself disconnects the call. but sometimes the call wizard does not appear at all.

wats the problem ? calling wizard is never shown.
adameve24
Developer
Developer
 
Posts: 29
Joined: Wed Dec 15, 2010 12:32 pm

Top

Return to Novice Tutorials

Who is online

Users browsing this forum: No registered users and 3 guests