3

I'm developing an application that works like an SMS BlackList / WhiteList. It is not a SMS application right now.

The goal is:

  • If the number is in Blacklist, it prevents the user for receiving / sending sms and it does not appear on his sms applications.
  • If the number is in Whitelist, the user can do everything he wants.
  • With some special cases, messages that have been blocked are stored in our database to be send after few hours;

To sum up my app needs to be able to:

  • Block SMS (before any other app can deal with it, like a popup sms app)
  • Send SMS

So far, the component works fine with android pre KitKat. The idea is to deal with broadcast (for received sms) and observers (for sms to send).

By the way, the KitKat SMS handling is mainly different. As I know, we kind of need to be the default sms app to send message.

My questions are:

Joxad
  • 69
  • 3

1 Answers1

4

Do I really need to be the default SMS app to send / observe messages ?

Do I have to implement a kind of basic SMS app or is there another way to send SMS with SMSManager for example ?

No. Any app with the SEND_SMS permission can still send messages using the SmsManager's standard methods, and the writes to the Provider will be taken care of for you, if and only if your app is not the default SMS app. If yours is the default, it is responsible for the writes.

Any app with the RECEIVE_SMS permission can still get the SMS_RECEIVED broadcast and read the message from the Intent. Also, the SMS_RECEIVED broadcast cannot be aborted, starting with KitKat, so there's no real way to block any app listening for that broadcast from receiving incoming texts, even if your app is the default. However, apps that are compliant with the recommended behavior of SMS apps in KitKat or above will disable any processing of incoming messages if they're not the default. That is, if your app is default, other apps shouldn't care about incoming messages.

Mike M.
  • 38,532
  • 8
  • 99
  • 95
  • Ok, thanks! I was thinking about a service that will run always to check for new messages and hide them but there are a lot of other problems with that. If I create my own SMS application, it maybe possible to do the job but the users will have to use mine and that 's the problem. – Joxad Jul 31 '14 at 13:16
  • Yeah, it's pretty hard to hide SMS messages these days. – Mike M. Jul 31 '14 at 13:17
  • 1
    Ok thanks for the advice then, i will finish on this fail for today :D – Joxad Jul 31 '14 at 13:19