How to Set My Sms App Default in Android Kitkat

How to set my sms app default in Android Kitkat?

The instructions you posted were correct - the issue is that you must implement all of the required capabilities:

  • In a broadcast receiver, include an intent filter for SMS_DELIVER_ACTION ("android.provider.Telephony.SMS_DELIVER"). The broadcast receiver must also require the BROADCAST_SMS permission.
    This allows your app to directly receive incoming SMS messages.

  • In a broadcast receiver, include an intent filter for WAP_PUSH_DELIVER_ACTION ("android.provider.Telephony.WAP_PUSH_DELIVER") with the MIME type "application/vnd.wap.mms-message". The broadcast receiver must also require the BROADCAST_WAP_PUSH permission.
    This allows your app to directly receive incoming MMS messages.

  • In your activity that delivers new messages, include an intent filter for ACTION_SENDTO ("android.intent.action.SENDTO") with schemas, sms:, smsto:, mms:, and mmsto:.
    This allows your app to receive intents from other apps that want to deliver a message.

  • In a service, include an intent filter for ACTION_RESPONSE_VIA_MESSAGE ("android.intent.action.RESPOND_VIA_MESSAGE") with schemas, sms:, smsto:, mms:, and mmsto:. This service must also require the SEND_RESPOND_VIA_MESSAGE permission.

Without all four, your app will not be listed in the default SMS selection dialog.

How to set Default SMS prompt for KitKat

I solved by entering the following in the manifest.

The most important part we should use everything, including MMS part if not it will not work.







<!-- Activity that allows the user to send new SMS/MMS messages -->
<activity android:name=".ComposeSmsActivity" >
<intent-filter>
<action android:name="android.intent.action.SEND" />
<action android:name="android.intent.action.SENDTO" />
<category android:name="android.intent.category.DEFAULT" />
<category android:name="android.intent.category.BROWSABLE" />
<data android:scheme="sms" />
<data android:scheme="smsto" />
<data android:scheme="mms" />
<data android:scheme="mmsto" />
</intent-filter>
</activity>

<!-- Service that delivers messages from the phone "quick response" -->
<service android:name=".HeadlessSmsSendService"
android:permission="android.permission.SEND_RESPOND_VIA_MESSAGE"
android:exported="true" >
<intent-filter>
<action android:name="android.intent.action.RESPOND_VIA_MESSAGE" />
<category android:name="android.intent.category.DEFAULT" />
<data android:scheme="sms" />
<data android:scheme="smsto" />
<data android:scheme="mms" />
<data android:scheme="mmsto" />
</intent-filter>
</service>

Android 4.4.2 - Setting Default SMS App

I finally figured out what was going on. I know I kicked myself after I figured it out and facepalmed for about ten minutes.

The Service, HeadlessSmsSenderService, the permission is supposed to be android.permission.SEND_RESPOND_VIA_MESSAGE not android.permission.SEND_RESPONSE_VIA_MESSAGE.

Respond/Response

Seriously? Send Respond?

What caught it was I copied and pasted the manifest from the Google Blog Post and just made a new app really quick that used it and low and behold, it showed up in the system dialog. So then I ran a diff against it and my manifest and everything matched up save for that misspelling (and the organizational changes that I had).

The nasty part about this is that there are some permissions and Intent Actions that IntelliJ won't automatically catch while you're typing them. I'm also not sure if Lint will catch these types of semantic errors or not. For all intents and purposes, the app will compile and run cleanly. No output was found on logcat so really this was a near totally silent issue.

Thanks for all of your help!

Change SMS App Default on Android 4.4.2

It seems that if you want your app to appear in default sms app settings, you must first make it eligible, or else you can not set your app as default sms app. I had the same problem so I did those simple steps and then I could chose my app as default, in settings and in my code, which I could not before.

So :

  • You must Have an Activity including an intent filter with an ACTION_SENDTO ("android.intent.action.SENDTO" ) and with schemas sms, smsto, mms, and mmsto. Do it in your manifest file. What I did was creating an empty activity that I will not use, with those parameters.

  • Do the same, by creating an empty Service including an intent filter with ACTION_RESPOND_VIA_MESSAGE ("android.intent.action.RESPOND_VIA_MESSAGE") and with schemas, sms, smsto, mms, and mmsto. This service must also require the SEND_RESPOND_VIA_MESSAGE permission. You must add all required permissions in your manifest.

  • Create an empty BroadcastReceiver including an intent filter with WAP_PUSH_DELIVER_ACTION ("android.provider.Telephony.WAP_PUSH_DELIVER") with the MIME type application/vnd.wap.mms-message. The broadcast receiver must also require the BROADCAST_WAP_PUSH permission. You must add all required permissions in your manifest.

  • Create an empty BroadcastReceiver including an intent filter with SMS_DELIVER_ACTION ("android.provider.Telephony.SMS_DELIVER"). The broadcast receiver must also require the BROADCAST_SMS permission. You must add all required permissions in your manifest.

It important to set all these parameters without missing one. Once you made all these steps, your app will be eligible and you can then set it as default sms app, leaving those created classes empty, and sticking with you old way of doing things. The goal is simply set your app as default, so it will be fully fonctionnal like it was before, without code modification.



Related Topics



Leave a reply



Submit