Will Verduzco · Dec 1, 2013 at 06:00 pm

Write to SMS Content Provider in KitKat without Being Default SMS App

Alongside the various user-facing and security-related changes introduced Android 4.4 KitKat, Google also significantly modified how the SMS Content Provider works. In Android 4.4, users can now select a default SMS app from within Settings -> Wireless & Networks. Then, two intent broadcasts are sent: one for all SMS apps (SMS_RECEIVED_ACTION) and one for only the default SMS app (SMS_DELIVER_ACTION). Thus, non-default SMS apps are able to receive incoming SMS messages, but they are not able to do certain things such as abort the broadcast.

Despite the positive effect on software modularity afforded by being able to select a default SMS app, the change also brings a few limitations. Namely, in order to delete (or restore) an SMS message, your app must temporarily become the default app if it isn’t already. This is problematic from a UX standpoint because there will be two mandatory prompts, where the user must select the default SMS app: one to select your app and one to revert.

Thankfully, XDA Senior Member stepic came up with a workaround that allows app developers to write to the SMS Content Provider in KitKat without being the default SMS app. Stepic made his discovery by looking in the Android source code and finding a special permission: OP_WRITE_SMS. Unfortunately, this workaround either requires user interaction or root access. However, this is only a one-time affair, rather than two prompts for user input every time a non-default SMS app needs to perform certain tasks.

If you’re an app developer looking to make an SMS app for KitKat, head over to the guide thread to learn more about this workaround.


_________
Want something on the XDA Portal? Send us a tip!

Will Verduzco

willverduzco is an editor on XDA-Developers, the largest community for Android users. Will Verduzco is the Portal Administrator for the XDA-Developers Portal. He has been addicted to mobile technology since the HTC Wizard. But starting with the Nexus One, his gadget love affair shifted to Google's little green robot. He is also a Johns Hopkins University graduate in neuroscience and is now currently studying to become a physician. View willverduzco's posts and articles here.
Jimmy McGee · Jul 3, 2015 at 06:00 am · no comments

Droid Turbo Lollipop OTA, 2015 Moto G Leaked – XDA TV

Android Lollipop for the Droid Turbo has been released. That and much more news is covered by Jordan when he reviews all the important stories from this week. Included in this week's news is the announcement of the 2015 edition of the Moto G and be sure to check out the article talking about Android Lollipop for the Huawei Ascend Mate 2. That's not all that's covered in today's video! Jordan talks about the other videos released this week on...

XDA NEWS
Jack Jennings · Jul 3, 2015 at 04:12 am · no comments

EVLeaks Shows Off Possible BlackBerry Android Phone

It wasn't too long ago that we received reports of BlackBerry planning to use Android in their upcoming devices, although it wasn't confirmed how this would be implemented. The Canadian company has publicly announced that they 'remain committed to the BlackBerry 10 operating system', touting its strengths in security and productivity. Now, thanks to Evan Blass at EVLeaks, we have our first look at what one of these upcoming phones could look like.   The picture itself shows the bottom half of a design...

XDA NEWS
Faiz Malkani · Jul 2, 2015 at 08:41 pm · 1 comment

Mysterious GG1 Google Device Stops by FCC. Glass v2?

As the year progresses, we draw further away from Google's annual I/O conference, and closer to the time when the latest hardware from Mountain View is made available to the public. While I/O itself remains one of the most popular tech conferences, the hardware unveiling is a contrastively low-key post across social media, but nonetheless, remains an exciting and much awaited event. In the months leading up to the unveiling, a host of leaks take place, revealing various info about...

XDA NEWS
Share This