Internals of Sending SMS in Android

110 views
Skip to first unread message

Ruhi Sharma

unread,
Jun 18, 2015, 11:09:22 AM6/18/15
to android-...@googlegroups.com

I know there are two ways of sending sms in Android:

  1. Using SMS manager
  2. Using intent with action SEND_TO

Can someone explain how sending sms using intent works? Following is what I think/know about it: When we send sms using intent then it sends intent to the default sms app and then default sms app send the sms using the SmsManager.

Please correct me if I am wrong or in case there is other information.

Which method of sending sms is popular among current sms apps in Android market? or among any other app which wants to send sms?


Which means even if an application is sending sms using implicit intent, ultimately the default app sends the sms using SmsManager only?


Thanks in Advance

Kristopher Micinski

unread,
Jun 18, 2015, 7:26:11 PM6/18/15
to android-...@googlegroups.com
One big thing is that you don't know a priori which app will handle
the SEND_TO intent. If the user installs a non-default SMS app, that
app may do something differently (e.g., backup the text message before
sending it).

Also, because that app is going to execute in a different address
space, the app sending the intent does not need the SMS permission.

Kris
> --
> You received this message because you are subscribed to the Google Groups
> "android-platform" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to android-platfo...@googlegroups.com.
> To post to this group, send email to android-...@googlegroups.com.
> Visit this group at http://groups.google.com/group/android-platform.
> For more options, visit https://groups.google.com/d/optout.

Ruhi Sharma

unread,
Jun 19, 2015, 12:28:52 PM6/19/15
to android-...@googlegroups.com
Thanks a lot :)

There is an app which I know can send the send. I only have the .apk file. Following are the logs which I got while running the app.


W/ActivityManager(  365): No content provider found for permission revoke: file:///data/local/tmp/4edab972cc232a2525d6994760f0f71088707164.apk
W/ActivityManager(  365): No content provider found for permission revoke: file:///data/local/tmp/4edab972cc232a2525d6994760f0f71088707164.apk
I/PackageManager(  365): Copying native libraries to /data/app-lib/vmdl1142317887
I/PackageManager(  365): Running dexopt on: com.ninepvi.shield
D/dalvikvm( 1735): DexOpt: load 42ms, verify+opt 241ms, 558652 bytes
I/ActivityManager(  365): Force stopping com.ninepvi.shield appid=10103 user=-1: update pkg
W/PackageManager(  365): Not granting permission android.permission.MOUNT_UNMOUNT_FILESYSTEMS to package com.ninepvi.shield (protectionLevel=18 flags=0x8444)
W/PackageManager(  365): Not granting permission android.permission.WRITE_APN_SETTINGS to package com.ninepvi.shield (protectionLevel=18 flags=0x8444)
I/PackageManager(  365):   Action: "android.intent.action.SENDTO"
I/PackageManager(  365):   Category: "android.intent.category.DEFAULT"
I/PackageManager(  365):   Scheme: "sms"
I/PackageManager(  365): Adding preferred activity ComponentInfo{com.android.mms/com.android.mms.ui.ComposeMessageActivity} for user 0 :
I/InputReader(  365): Reconfiguring input devices.  changes=0x00000010
D/BackupManagerService(  365): Received broadcast Intent { act=android.intent.action.PACKAGE_ADDED dat=package:com.ninepvi.shield flg=0x4000010 (has extras) }
V/BackupManagerService(  365): addPackageParticipantsLocked: #1
D/dalvikvm(  522): GC_FOR_ALLOC freed 456K, 18% free 3786K/4612K, paused 52ms, total 53ms
I/PackageManager(  365):   Action: "android.intent.action.SENDTO"
I/PackageManager(  365):   Category: "android.intent.category.DEFAULT"
I/PackageManager(  365): Adding preferred activity ComponentInfo{com.android.mms/com.android.mms.ui.ComposeMessageActivity} for user 0 :
I/PackageManager(  365):   Scheme: "smsto"
I/PackageManager(  365):   Action: "android.intent.action.SENDTO"
I/PackageManager(  365):   Category: "android.intent.category.DEFAULT"
I/PackageManager(  365):   Scheme: "mms"
I/PackageManager(  365): Adding preferred activity ComponentInfo{com.android.mms/com.android.mms.ui.ComposeMessageActivity} for user 0 :
I/PackageManager(  365):   Action: "android.intent.action.SENDTO"
I/PackageManager(  365):   Category: "android.intent.category.DEFAULT"
I/PackageManager(  365):   Scheme: "mmsto"
I/PackageManager(  365): Adding preferred activity ComponentInfo{com.android.mms/com.android.mms.ui.ComposeMessageActivity} for user 0 :
D/dalvikvm(  534): GC_FOR_ALLOC freed 223K, 19% free 10059K/12328K, paused 86ms, total 87ms
I/dalvikvm-heap(  534): Grow heap (frag case) to 12.315MB for 2359312-byte allocation
I/PackageManager(  365):   Action: "android.intent.action.SENDTO"
I/PackageManager(  365):   Category: "android.intent.category.DEFAULT"
I/PackageManager(  365):   Scheme: "sms"
I/PackageManager(  365): Adding preferred activity ComponentInfo{com.android.mms/com.android.mms.ui.ComposeMessageActivity} for user 0 :
D/dalvikvm(  534): GC_FOR_ALLOC freed <1K, 16% free 12363K/14636K, paused 69ms, total 69ms
D/dalvikvm(  365): GC_FOR_ALLOC freed 1493K, 29% free 9726K/13696K, paused 251ms, total 255ms
I/PackageManager(  365): Adding preferred activity ComponentInfo{com.android.mms/com.android.mms.ui.ComposeMessageActivity} for user 0 :
I/PackageManager(  365):   Action: "android.intent.action.SENDTO"
I/PackageManager(  365):   Category: "android.intent.category.DEFAULT"
I/PackageManager(  365):   Scheme: "smsto"
D/Documents( 1162): Used cached roots for com.android.providers.downloads.documents
D/Documents( 1162): Used cached roots for com.android.externalstorage.documents
I/PackageManager(  365):   Action: "android.intent.action.SENDTO"
I/PackageManager(  365):   Category: "android.intent.category.DEFAULT"
I/PackageManager(  365):   Scheme: "mms"
I/PackageManager(  365): Adding preferred activity ComponentInfo{com.android.mms/com.android.mms.ui.ComposeMessageActivity} for user 0 :

Could you please let me know what is happening?
Reply all
Reply to author
Forward
0 new messages