Search code examples
androidsmsandroid-contentprovider

API support for the Default SMS app


I have some doubts about the Android Default SMS app.

I have to create an app that will need to read/write SMS and MMS in the Android SMS/MMS database. To do that I will need to use the "content://sms/***" Content Provider.

This Content Provider is not part of the SDK so I strongly recommend to not use it in public applications (Previous question, Android Developerd Blog).

Google introduced the concept of "Default SMS app" in Android 4.4 and it allow third apps to manage the SMS and MMS. Does that mean that the Content Provider "content://sms/***" is now part of the official SDK?

Is correct to say this?

  • The SMS Content Provider existed with the same behavior/structure before Android 4.4, but is was not official in the Android SDK, therefore there might be devices with Android < 4.4 that might not support that.

  • The SMS Content Provider is part of the Android >= 4.4 SDK, and it is officially fully supported in all devices (with Android >= 4.4).

  • Basically nothing change in the SMS Content Provider hidden API in Android 4.4, but is mostly a formalization. From hidden APi to officially API.


Solution

  • The SMS Content Provider existed with the same behavior/structure before Android 4.4, but is was not official in the Android SDK, therefore there might be devices with Android < 4.4 that might not support that.

    This is mostly true, in that the Provider and underlying database haven't changed much. However, as you stated, there is now the concept of the default SMS app, and only the default has standard write access to the Provider. Additionally, the SMS_RECEIVED broadcast can no longer be aborted, so it's not possible to hide that broadcast from any app listening for it.

    The SMS Content Provider is part of the Android >= 4.4 SDK, and it is officially fully supported in all devices (with Android >= 4.4).

    Not quite. The API is now officially part of the SDK, but that doesn't mean that every vendor must use it to implement their SMS clients, though most do.

    Basically nothing change in the SMS Content Provider hidden API in Android 4.4, but is mostly a formalization. From hidden APi to officially API.

    Basically, yes, except for the aforementioned differences. Please also note that the default SMS app is responsible for a great many things, and it is no simple task to implement an app that can fully act as one.