7

My Android app uses SMS to silently send out notifications. Prior to Kitkat these notifications were not recorded into the SMS Provider and hence did not appear in the user's conversation lists. This is the app's desired behavior.

With the Kitkat SMS changes (refer SmsManger documentation quoted below) these messages are still being sent but are now automatically being written to the SMS provider and thus appearing in the user's conversation lists. This is undesirable for my app.

Beginning with Android 4.4 (API level 19), if and only if an app is not selected as the default SMS app, the system automatically writes messages sent using this method to the SMS Provider (the default SMS app is always responsible for writing its sent messages to the SMS Provider). For information about how to behave as the default SMS app, see Telephony.

It sounds like I could prevent the automatic writing to the provider by making my app the default and then not writing to the provider. However, this would be a terrible user experience in the context of my app, so I would only consider it as an absolute last resort.

My question is then - is there a way to silently send SMS in Kitkat without my app having to be the default app?

I've read the responses to this question Send SMS message using non default SMS app on Android 4.4 but that is more concerned with ensuring that the messages are being written to the provider. I don't want that.

Community
  • 1
  • 1

1 Answers1

0

Short answer is no.

Long answer :

There are actually options but it involves a lot of work. One is to download the source code for aosp and modify the mms.apk to allow it to receive intents from your app to send sms without writing to provider.

Another way is to baksmali your phones default sms application and add smali code that would allow you to do the same as above. This would require technical knowledge of smali and decompiling/recompiling apks.

With that said, there are problems that will arise such as what if the phone user decides to use a third party sms/mms application for their short messaging needs.

Sybregunne
  • 179
  • 8