0

Let's say I want to send SMS or Email. Do I have to use intent for this (which calls OS native service) or I can send SMs/Email/MMS/etc. from within the app? Is it possible to do this without opening OS native services/tools screen?

All material I found explain these tasks by using intents. I was wondering if I really have to rely on intents.

PS. I know that they are recommended way of dealing with things, but not mandatory. When I develop bar-code-scanning app, a client will not allow using external app (called via intent), but he'd like to do it all within the app. So why shouldn't I do the same with sms/email/mms/etc.?!

sandalone
  • 41,141
  • 63
  • 222
  • 338

1 Answers1

1

For SMS or Email you can of course invoke native methods that allow you send messages. These intents are just another option - if you don't want to create the sms/email sender activity yourself. Sending sms:

SmsManager smsManager = SmsManager.getDefault();
smsManager.sendTextMessage(number, null, message, null, null);

Also check this out for sending email in the background.

Community
  • 1
  • 1
josephus
  • 8,284
  • 1
  • 37
  • 57
  • So this will send sms message in the background without invoking the native sms screen that I usually get via intent? – sandalone Feb 15 '12 at 16:55