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.
Mario Tomás Serrafero · Jul 30, 2015 at 02:04 pm · no comments

What Do You Think About Fingerprint Scanners?

More and more phones are featuring fingerprint scanners, and with many promising developments and it being natively supported on Android M, we can soon expect to see them on smartphones everywhere. If done right, it is a useful feature that allows for quick unlocking and authorization. There are concerns regarding security, but nonetheless the industry seems to be embracing it with open arms. What do you think?

DISCUSS
Aamir Siddiqui · Jul 30, 2015 at 01:20 pm · no comments

What’s Next for Samsung and Its Flagships?

If we were to say that the Galaxy S6 was a leap of faith made by Samsung, we wouldn't be too wrong. After all, the device marked a definite change in how Samsung perceived the market and its own place in it, as it stood amongst the signs of decline which started with the critical reception of the Galaxy S5. To recap, the Samsung Galaxy S5 was criticized heavily for feeling more like a toy, rather than a premium flagship...

XDA NEWS
Eric Hulse · Jul 30, 2015 at 12:24 pm · 1 comment

The Ultimate Showcase of dBrand Skins

In the search for ways to protect, accessorize, and personalize; a user has many options. One could choose a case, a “skin”, “armor”, or “wraps.” In fact, the global mobile accessory market is poised to reach a high of $62 Billion in 2017. dBrand is one of the more creative and friendly vinyl skin manufacturers around. In hopes of sharing what they can offer, our friends at dBrand sent us over some skins to have a look at. They offer...

XDA NEWS