1. First create two emulators
One should be emulator-5554 and the other one should be emulator-5556
2. Here is the Activity code for send SMS using intent.
import android.app.Activity; import android.content.Intent; import android.net.Uri; import android.os.Bundle; public class TestSMSActivity extends Activity { /** Called when the activity is first created. */ @Override public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.main); String number = "5556"; startActivity(new Intent(Intent.ACTION_VIEW, Uri.fromParts("sms", number, null))); } }
The variable "number" in line 11 is the the recipient of the SMS activity. I'm going test this application using two emulators therefore I used one emulator number for that variable. If you are going to send SMS to mobile phone replace number with mobile phone number, but remember that sending SMS from emulator to a cell phone is difficult.
Don't forget to add send SMS permission to your Manifest file.
3. Run the project.
Android device chooser window will appear. Choose an AVD. If you assigned 5556 to number variable then choose emulator-5554 to run program, other vice select emulator-5554.
Then compose message window will open. Type a simple text (Eg:-"Hello world!") there and click on send.
emulator-5554
You can see received SMS on the other emulator
emulator-5556
When someone writes an article he/she keeps the image of a user in his/her
ReplyDeletemind that how a user can know it. So that's why this post is great. Thanks!
Also visit my blog post - get latest android games
Heya! I just wanted to ask if you ever have any trouble with hackers?
ReplyDeleteMy last blog (wordpress) was hacked and I ended up losing months of hard work due to no back up.
Do you have any methods to prevent hackers?
My webpage ; virtual number
Hi,
DeleteThis is a Google blog. They provide better security. So no virus attacks.
Try with blogger.com you will definitely success.
Thanks!
hey Chatura send me the code for stoeing database in android. Thanks in advance
ReplyDeleteI’m ecstatic I discovered your website and blogs.
ReplyDeleteroot android phone
My programmer is trying to persuade me to move to .net from PHP.
ReplyDeleteI have always disliked the idea because of the costs. But he's tryiong none the less. I've been using WordPress on a variety
of websites for about a year and am worried about
switching to another platform. I have heard excellent things about
blogengine.net. Is there a way I can transfer all my wordpress posts into it?
Any kind of help would be really appreciated!
Here is my web blog : mame rom mame rom
Somebody necessarily help to make critically posts I'd state. That is the very first time I frequented your web page and thus far? I amazed with the research you made to create this actual publish amazing. Fantastic task!
ReplyDeleteAlso visit my web page ... sonnerie ultrason gratuite
I would like to thank you for the efforts you have made in writing this article. I am hoping the same best work from you in the future as well. Your write up is a fine example of it.
ReplyDeleteAndroid application
I'm not sure why but this blog is loading extremely slow for me. Is anyone else having this problem or is it a issue on my end? I'll check back later and see if the problem
ReplyDeletestill exists.
My web site :: zippyshare.im
I don't even know how I ended up here, but I thought this post was good. I don't know
ReplyDeletewho you are but definitely you are going to a famous blogger if you aren't already ;) Cheers!
Feel free to visit my web site ... chat
Very rapidly this website will be famous amid
ReplyDeleteall blog users, due to it's good posts
Stop by my page :: real love spells free
I loved as much as you'll receive carried out right here. The sketch is attractive, your authored subject matter stylish. nonetheless, you command get bought an edginess over that you wish be delivering the following. unwell unquestionably come further formerly again as exactly the same nearly very often inside case you shield this hike.
ReplyDeleteFeel free to surf my webpage : on front page
Definitely believe that which you stated. Your favorite reason seemed to be on the internet the easiest thing
ReplyDeleteto be aware of. I say to you, I definitely get annoyed while people
consider worries that they plainly don't know about. You managed to hit the nail upon the top and also defined out the whole thing without having side effect , people can take a signal. Will likely be back to get more. Thanks
my web page > he said
Link exchange is nothing else but it is just placing the
ReplyDeleteother person's blog link on your page at proper place and other person will also do similar for you.
My webpage > the original source
Its not my first time to pay a visit this web page, i am browsing
ReplyDeletethis website dailly and take fastidious data from here all the time.
Feel free to surf my website - history of alcohol flush reaction
Wow, awesome blog layout! How long have you been blogging for?
ReplyDeleteyou make blogging look easy. The overall look of your site is excellent, let alone
the content!
My web site ... severance pay tax
Wow, this piece of writing is good, my younger sister is analyzing these things, therefore I
ReplyDeleteam going to inform her.
My blog post legal online gambling
Every weekend i used to pay a visit this web page, as i want enjoyment, since
ReplyDeletethis this site conations in fact nice funny material too.
Feel free to visit my page ; my response
I have read so many content on the topic of the blogger lovers however this paragraph is in fact
ReplyDeletea nice paragraph, keep it up.
My weblog homepage
Please let me know if you're looking for a article author for your blog. You have some really great posts and I feel I would be a good asset. If you ever want to take some of the load off, I'd really like to write
ReplyDeletesome articles for your blog in exchange for a link back to mine.
Please shoot me an email if interested. Thanks!
Here is my website :: the full details
Aw, this was an extremely nice post. Finding the time and actual effort to make
ReplyDeletea great article but what can I say I procrastinate a whole lot and never manage to get
anything done.
My homepage - a total noob
I'm excited to discover this web site. I need to to thank you for ones time just for this fantastic read!! I definitely savored every little bit of it and I have you saved to fav to see new information in your website.
ReplyDeleteAlso visit my website ... for more
Hey there, You have done an excellent job. I will certainly digg it and personally suggest to my
ReplyDeletefriends. I am confident they will be benefited from this site.
My blog ; here i found it
Hello,
ReplyDeleteGreat Example, but needed to know an additional thing.
How can we know if the sms has been sent or not, so that we can display a toast saying that the message has been sent..
thanks for the blog again..
Hello,
ReplyDeleteGreat Example, but needed to know an additional thing.
How can we know if the sms has been sent or not, so that we can display a toast saying that the message has been sent..
thanks for the blog again..
Hello,
ReplyDeleteGreat Example, but needed to know an additional thing.
How can we know if the sms has been sent or not, so that we can display a toast saying that the message has been sent..
thanks for the blog again..
Hi,
ReplyDeletefirstly thanks for a nice blog..
but needed to know another thing... how do we know that the message has been really sent so that we can display a toast saying that the message has been sent?
thanks!
Εverything is very oρen with a νеrу cleаr descriptiοn of the challenges.
ReplyDeleteIt waѕ definitеly infοrmative. Your websіte iѕ extremely helpful.
Thank yοu for shаring!
My weblog ; send chocolates in India
Hi i wanto send sms from my app. so for that im calling sms from my app using intent. how to go back to previous activity after sending sms.
ReplyDeletewww.nodemongo.asia
www.mobengineers.com
Thanks for the clean example Man.. Even this http://www.compiletimeerror.com/2013/06/send-sms-in-android-example.html might help you out... Have a look...
ReplyDelete