Send an SMS to the emulator - android

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.

Related

Special character to send message in android

Is there any way to send a message in Android (such as Whatsapp platform) from a text in clipboard without clicking the send button on the screen? I copied the "Enter" character into my clipboard and paste it into Whatsapp, but it only adds the new line in the screen and not sending the message.
What I need to know is how to copy a "special character" to my clipboard? and if I paste it into WA, it will send the message automatically.
Thanks in advance,
BS
Don't think that's possible, my guess is that whatsapp is listening on keypress and does not parse the actual text you send in.
However it should be possible to do with a device connected with ABD
input text 'Paste text on Android Device' (AFTER SDK 23)
adb shell "input keyboard text 'Paste%stext%son%sAndroid%sDevice'" (PRIOR SDK 23)

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

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

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!

send phone number through emulator

I am making an application and I want to retrieve the device phone number and send that on the server. But I am testing this application on android emulator. Can anybody please tell me how to set or get the phone number in emulator and actual device.
Thanks.
We can get the phone number in emulator if we use the Telephony manager
TelephonyManager tm = (TelephonyManager) getSystemService(Context.TELEPHONY_SERVICE);
String phone = tm.getLine1Number();
Toast toast = Toast.makeText(getApplicationContext(), phone, Toast.LENGTH_SHORT);
toast.show();
On making the toast of the phone number we get the phone number like..
15555215554
It also need the android.permission.READ_PHONE_STATE permission.
So Emulator is also having its own phone number.
In DDMS perspective You will see Emulator Control tab you can emulate the call from there.
If you don't see Emulator Control there . Use Window> Show /View > Emulator Control to make the tab appear.
To accesss device phone number in your code use telephonymanager.getLine1Number();
You need to set READ_PHONE_STATE permission in manifest file for that.
you cannot call the emulator from your device. But you can make calls to two emulators. For details on how to ? you can go to DDMS perspective then Emulator Control tab you can make the call from there to other emulator.
http://developer.android.com/tools/devices/emulator.html

Populate text message (outgoing ph# & message) when QR code Scanned in iphone, android & blackberry

When a user scans a QR code, can you open up their outgoing SMS screen and pre-populate both the phone# and the text message body so all they have to do is touch "SEND" to send the SMS?
I'm asking about this solution for iPhones, Androids and Blackberries.
Yes, this can be done on android by launching an intent with the action set to Intent.ACTIONS_SEND.

Categories

Resources