How to set emulator phone number in my eclipse code file? - android

My code
I am not able to send and receive SMS between 2 emulators. Where and how can I add the emulator phone numbers in my codes to send text messages?

Just try to send the SMS to the AVD number. For example : 5554, thats all I do and its working.
The AVD number is on top of your AVD's window.
More source : Sending and receiving text using android emulator
And I've used this source when I was learning:
http://mobiforge.com/developing/story/sms-messaging-android

Related

Android Emulator change phone number unknown to number default

I want to get the phone number of the emulator, but when I check the phone number in setting-about phone-status, the phone number shows 'unknown'. Sometimes the pone number shows a number. How can I get the phone number of the android emulator. Thanks
Your emulator does not have a phone number. If you want to "call" it or "SMS" it here is how:
1. In eclipse open the DDMS perspective. (Upper-right corner, click the little new window button ->DDMS
2. On the left hand side under emulator control you should see a section called "Telephony Actions"
3. There you can enter your own phone number (this will be the incoming number) as well as call or even write an SMS (Check SMS and than compose in the box).
4. Hit send and you should see it come in on your emulator.
Hope this helps!

Writing a GSM emulator for use with Android

For some work I'm doing, I want to have an emulated GSM modem which will communicate with an Android-x86 virtual machine over a Unix socket. The VM should see the emulator as a real modem and use it to send SMS (as the first pass of functionality).
So far, I've put something together which handles some AT commands and just replies "OK" to all the rest. For some commands, like "AT+CRSM", I just have a table of responses gathered from running the official Android emulator and looking at the radio log. For others, I maintain some state and construct answers; those commands include:
CFUN?
CPIN?
CGREG?
CGREG?
COPS?
CGREG=
CREG=
CPIN=
COPS=
CRSM=
CSMS=
CGSN
CIMI
CSQ
Android will boot, and send commands to my emulated modem, which answers, however it doesn't seem to be fully functional. Android doesn't detect any radio signal strength, for instance, just showing an "x" in the signal bar.
Does anyone know of a similar project, or just what AT commands are absolutely necessary to get some basic functionality?
Well, I'll answer another of my own questions, it's easier that way.
I ended up implementing an emulator which maintains a little bit of state, such as whether or not unsolicited CREG and CGREG messages are enabled, the network registration status & network name format (for the COPS command), and a message reference counter for SMS.
It supports the following commands:
CFUN?
CPIN?
CGREG?
CREG?
COPS?
CGREG=
CREG=
CPIN=
COPS=
CRSM=
CSMS=
CMGS=
CGSN
CIMI
CSQ
All other messages just get an "OK" response.
With the stock AOSP Android source running in an emulator with the "-radio unix:/tmp/phone" switch, I can send SMS messages and decode the binary PDUs into real messages. I will continue to add functionality so SMS messages can be injected back to Android, and hopefully open-source the code at some point.

DDMS not able to send location to emulator

DDMS is not able to send location to the emulator. I have tried sending just the location from DDMS but still the emulator is not able to receive location. The application works properly in the device but its not able to capture location data in the emulator.
I am testing on Android 2.2 emulator. Can anyone let me know what can be the issue?
Make sure your AVD has GPS support hardware set to true
Create New AVD > Hardware > New > GPS support
Value should be "yes"
Also, ensure your app is requesting location updates in some way, otherwise the emulator will just ignore any incoming locations from DDMS or the console.
I just use the android console via telnet, it always works.
Just open a command line and:
telnet localhost 5554
5554 is the port number of your emulator, it is usually that but might change, it can be on the window fram of the emulator as PORT:AVD_NAME.
You should be greeted with an Android console message.
To send positions to your device just type.
geo fix []
Two valid statements would be
geo fix -77.036519 38.896143
geo fix -77.036519 38.896143 100
Hope this helps, its not DDMS, but it works always. You can also feed it nmea sentences but I dont think you need that.
I don't know what your setup looks like, but I've had problems sending locations via DDMS using Windows XP and regional settings set to Swedish. Changing the regional settings to English(USA) solves the problem for me. I guess it has something to do with how numbers are formatted. With swedish settings numbers are formatted as 123 456 789,00 and with English(USA) as 123,456,789.00. Hope it helps
I had this problem and I resolve it by disabling the firewall,
hope it works for you.

gsm call / sms send doesn't work from emulator/ddms perspective

i have problems simulating call or sms since telnet or ddms perspective on eclipse.
I'm connected to the device and some commands works (window scale,...)
If i try to simulate a gsm call then everything seems ok but i haven't anything on my emulator (nor incoming call nor notification)
then if i launch an "gsm list" command my inbound call is listed and i can cancel it
the same thing occurs with sms send everything seems ok (return OK) but there is no notification on the emulator nor sms in inbox :-(
i'm using the sdk r06 on a windows xp machine. I try with fresh avd on different platform :-(
Important : it has worked so i know it can work, but i would like to know why it doesn't work now ! Using ddms i don't see any trace on the log view.
thanks for your help
don't know why it works but i found a thread which helped me to workaround this problem
==> use a bootchart 100 option when launching the emulator
source : http://www.mail-archive.com/android-developers#googlegroups.com/msg65710.html
hope it works for u too.

Send an SMS to the emulator

I am working on an android application and I want to send an SMS to the phone number of the phone i.e the emulator. I know there will be no real phone number for emulator, but how can I send an SMS from the phone?
Open Eclipse. Select "Emulator Control" from Window -->Show View -->Android.There will be an option called Telephony Actions. There under the Incoming number just specify a sample number.Select SMS and type the text that you want and finally click "Send"
You can try this sample app too
http://samplecodeviewer.googlecode.com/svn-history/r2/trunk/SampleCodeViewer/SMSTest.zip
and check for SMSSender.java class.

Categories

Resources