title: How to set my sms app default in Android Kitkat?
body: <p>I made an android sms app in which I am sending and receiving sms as android messaging app does so. Now I have set my target to 4.4 (Android KitKat version) but Android KitKat has new "Default Messaging" app settings that user can select one app at a time for messaging. I followed the steps from <a href="http://android-developers.blogspot.com/2013/10/getting-your-sms-apps-ready-for-kitkat.html">this site</a> to select option for my sms app as default app but in the settings my app never showed up in the popup of selecting default messaging app.</p>
  
  <p>Below is my java code I have used from the guid</p>
  
  <pre><code>if( androidOS.contains("4.4") ){
  
  
  if (! Telephony.Sms.getDefaultSmsPackage(this).equals(myPackageName) ) {
  
  // App is not default.
  // Show the "not currently set as the default SMS app" interface
  
  builder = new AlertDialog.Builder(MyConversation.this);
  builder.setMessage("Shoot The Messenger is not set as your default messaging app. Do you want to set it default?")
  .setCancelable(false)
  .setTitle("Alert!")
  .setNegativeButton("No", new DialogInterface.OnClickListener() {
  
  @Override
  public void onClick(DialogInterface dialog, int which) {
  
  
  }
  })
  .setPositiveButton("Yes", new DialogInterface.OnClickListener() {
  @TargetApi(19)
  public void onClick(DialogInterface dialog, int id) {
  
  Intent intent =
  new Intent(Telephony.Sms.Intents.ACTION_CHANGE_DEFAULT);
  
  intent.putExtra(Telephony.Sms.Intents.EXTRA_PACKAGE_NAME,
  getPackageName());
  
  startActivity(intent);
  
  }
  });
  builder.show();
  
  
  }
  
  
  }
  </code></pre>
  
  <p>Also I added below code in <code>Manifest</code> file.</p>
  
  <pre><code>&lt;?xml version="1.0" encoding="utf-8"?&gt;
  </code></pre>
  
  <p></p>
  
  <pre><code>&lt;uses-sdk
      android:minSdkVersion="8"
      android:targetSdkVersion="19" /&gt;
  
  
  &lt;uses-feature android:name="android.hardware.telephony.gsm"
      android:required="false"/&gt;
  
  &lt;uses-permission android:name="android.permission.READ_CONTACTS" /&gt;
  &lt;uses-permission android:name="android.permission.READ_PHONE_STATE" /&gt;
  &lt;uses-permission android:name="android.permission.SEND_SMS" /&gt;
  &lt;uses-permission android:name="android.permission.RECEIVE_SMS" /&gt;
  &lt;uses-permission android:name="android.permission.READ_SMS" /&gt;
  &lt;uses-permission android:name="android.permission.WRITE_SMS" /&gt;
  &lt;uses-permission android:name="android.permission.RECEIVE_MMS" /&gt;
  &lt;uses-permission android:name="android.permission.WRITE" /&gt;
  &lt;uses-permission android:name="android.permission.VIBRATE" /&gt;
  &lt;uses-permission android:name="android.permission.INTERNET" /&gt;
  &lt;uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" /&gt;
  &lt;uses-permission android:name="android.permission.WAKE_LOCK" /&gt;
  &lt;uses-permission android:name="com.android.alarm.permission.SET_ALARM"/&gt;
  &lt;uses-permission android:name="android.permission.WRITE_SETTINGS" /&gt;
  &lt;uses-permission android:name="android.permission.CALL_PHONE"/&gt;
  &lt;uses-permission android:name="android.permission.RECEIVE_BOOT_COMPLETED"/&gt;
  &lt;uses-permission android:name="android.permission.INSTALL_PACKAGES"/&gt;
  
  
  &lt;application              
      android:allowBackup="true"
      android:icon="@drawable/ic_launcher"
      android:label="@string/app_name"
      android:theme="@style/Theme.NoTitle" &gt;
  
      &lt;activity
          android:name="coms3.shootmessenger.Mysplash"
          android:label="@string/app_name"
          android:screenOrientation="portrait" &gt;
          &lt;intent-filter&gt;
              &lt;action android:name="android.intent.action.MAIN" /&gt;
  
              &lt;category android:name="android.intent.category.LAUNCHER" /&gt;
          &lt;/intent-filter&gt;
  
  
           &lt;intent-filter&gt;
              &lt;action android:name="android.intent.action.SENDTO" /&gt;
              &lt;category android:name="android.intent.category.DEFAULT" /&gt;
              &lt;data android:scheme="sms" /&gt;
              &lt;data android:scheme="smsto" /&gt;
  
          &lt;/intent-filter&gt;   
  
  
      &lt;/activity&gt;
  
      &lt;receiver android:name="coms3.shootmessenger.SmsReceiver" 
          android:permission="android.permission.BROADCAST_SMS" &gt;
  
  
          &lt;intent-filter&gt;
  
              &lt;action android:name="android.provider.Telephony.SMS_DELIVER" /&gt;
  
          &lt;/intent-filter&gt;
  
            &lt;!--  
           &lt;intent-filter android:priority="2147483647" &gt;
  
              &lt;action android:name="android.provider.Telephony.SMS_RECEIVED" /&gt;
  
          &lt;/intent-filter&gt;
         --&gt;
      &lt;/receiver&gt;   
  
      &lt;receiver android:name="com.example.bootreceiver.MyBootReceiver"&gt;
  
          &lt;intent-filter&gt;
  
              &lt;action android:name="android.intent.action.BOOT_COMPLETED"/&gt;
  
  
          &lt;/intent-filter&gt;
  
       &lt;/receiver&gt;
  
       &lt;receiver android:name="coms3.shootmessenger.MMSReceiver"
           android:permission="android.permission.BROADCAST_WAP_PUSH"&gt;
  
            &lt;intent-filter&gt;
  
              &lt;action android:name="android.provider.Telephony.WAP_PUSH_RECEIVED" /&gt;
  
              &lt;data android:mimeType="application/vnd.wap.mms-message" /&gt;
  
            &lt;/intent-filter&gt;
  
          &lt;/receiver&gt;
  
  
       &lt;receiver  android:process=":remote" android:name="AlarmManagerBroadcastReceiver"&gt;&lt;/receiver&gt;
        &lt;receiver  android:process=":remote" android:name="AlarmForPartyMessage"&gt;&lt;/receiver&gt;
        &lt;receiver  android:process=":remote" android:name="AlarmManagerMail"&gt;&lt;/receiver&gt;
  
      &lt;activity
          android:name="coms3.shootmessenger.ActivityFirstList"
  
          android:windowSoftInputMode="stateHidden" &gt;
      &lt;/activity&gt;
       &lt;activity 
           android:name="coms3.shootmessenger.ActivityBase" 
  
           android:windowSoftInputMode="stateHidden" &gt; 
       &lt;/activity&gt; 
      &lt;activity
          android:name="coms3.shootmessenger.SearchTab"
          android:configChanges="keyboardHidden|orientation"
           &gt;
      &lt;/activity&gt;
      &lt;activity
          android:name="coms3.shootmessenger.ActivityMail"
          android:windowSoftInputMode="adjustPan"
           &gt;
      &lt;/activity&gt;
      &lt;activity
          android:name="coms3.shootmessenger.ActivityScheduldMail"
          android:windowSoftInputMode="adjustPan"
          android:screenOrientation="portrait"
           &gt;
      &lt;/activity&gt;
      &lt;activity
          android:name="coms3.shootmessenger.MessageTab" &gt;
  
      &lt;/activity&gt;
  
      &lt;activity
          android:name="coms3.shootmessenger.SettingsTab"
  
          android:windowSoftInputMode="stateHidden" &gt;
      &lt;/activity&gt;
  
      &lt;activity
          android:name="coms3.shootmessenger.MyConversation"
  
          android:windowSoftInputMode="stateHidden" &gt;
      &lt;/activity&gt;
  
      &lt;activity
          android:name="coms3.shootmessenger.ActivityDelayedSending"
  
          android:windowSoftInputMode="stateHidden" &gt;
      &lt;/activity&gt;
  
      &lt;activity
          android:name="coms3.shootmessenger.ActivityScheduldMessage"
          android:screenOrientation="portrait"
          android:windowSoftInputMode="stateHidden" &gt;
      &lt;/activity&gt;
      &lt;activity
          android:name="coms3.shootmessenger.ActivityStealthMode"
  
          android:windowSoftInputMode="stateHidden" &gt;
      &lt;/activity&gt;
  
      &lt;activity
          android:name="coms3.shootmessenger.ActivitySms"
  
          android:windowSoftInputMode="stateHidden" &gt;
  
  
      &lt;/activity&gt;
  
      &lt;activity
          android:name="coms3.shootmessenger.ActivityBlackList"
  
          android:windowSoftInputMode="stateHidden" &gt;
      &lt;/activity&gt;
  
      &lt;activity
          android:name="coms3.shootmessenger.ActivityDeleteMessage"
  
          android:windowSoftInputMode="stateHidden" &gt;
      &lt;/activity&gt;
  
      &lt;activity
          android:name="coms3.shootmessenger.ActivityDeleteone"
  
          android:windowSoftInputMode="stateHidden" &gt;
      &lt;/activity&gt;
  
       &lt;activity android:name="coms3.shootmessenger.ActivitySmsnew" &gt;
  
  
        &lt;intent-filter&gt;
              &lt;action android:name="android.intent.action.SEND" /&gt;                
              &lt;action android:name="android.intent.action.SENDTO" /&gt;
              &lt;category android:name="android.intent.category.DEFAULT" /&gt;
              &lt;category android:name="android.intent.category.BROWSABLE" /&gt;
              &lt;data android:scheme="sms" /&gt;
              &lt;data android:scheme="smsto" /&gt;
  
          &lt;/intent-filter&gt;
  
  
      &lt;/activity&gt;
  
        &lt;activity
          android:name="coms3.shootmessenger.ActivityEventlist"
  
          android:windowSoftInputMode="stateHidden" &gt;
      &lt;/activity&gt;
  
       &lt;activity
          android:name="coms3.shootmessenger.ActivityScheduleList"
          android:screenOrientation="portrait"
          android:windowSoftInputMode="stateHidden" &gt;
      &lt;/activity&gt;
  
        &lt;activity
          android:name="coms3.shootmessenger.ActivityCancelSchedule"
          android:screenOrientation="portrait"
          android:windowSoftInputMode="stateHidden" &gt;
      &lt;/activity&gt;
  
         &lt;activity
          android:name="coms3.shootmessenger.ActivityCancelEvent"
          android:screenOrientation="portrait"
          android:windowSoftInputMode="stateHidden" &gt;
      &lt;/activity&gt;
  
        &lt;activity
          android:name="coms3.shootmessenger.ActivityCancelMail"
          android:screenOrientation="portrait"
          android:windowSoftInputMode="stateHidden" &gt;
      &lt;/activity&gt;
  
     &lt;activity
          android:name="coms3.shootmessenger.Activitytutorial"
          android:screenOrientation="portrait"
          android:windowSoftInputMode="stateHidden" &gt;
      &lt;/activity&gt;
  
       &lt;activity
          android:name="coms3.shootmessenger.ActivityConversationtutorial"
          android:screenOrientation="portrait"
          android:windowSoftInputMode="stateHidden" &gt;
      &lt;/activity&gt;
  
      &lt;activity
          android:name="coms3.shootmessenger.Aboutus"
          android:screenOrientation="portrait"
          android:windowSoftInputMode="stateHidden" &gt;
      &lt;/activity&gt;
  
  
  
       &lt;service android:name="coms3.shootmessenger.HeadlessSmsSendService"
               android:permission="android.permission.SEND_RESPOND_VIA_MESSAGE"
               android:exported="true" &gt;
          &lt;intent-filter&gt;
              &lt;action android:name="android.intent.action.RESPOND_VIA_MESSAGE" /&gt;
              &lt;category android:name="android.intent.category.DEFAULT" /&gt;
              &lt;data android:scheme="sms" /&gt;
              &lt;data android:scheme="smsto" /&gt;
              &lt;data android:scheme="mms" /&gt;
              &lt;data android:scheme="mmsto" /&gt;
          &lt;/intent-filter&gt;
      &lt;/service&gt;
  
  
  
  
  &lt;/application&gt;
  </code></pre>
  
  <p></p>
  
  <p><strong>UPDATE:</strong></p>
  
  <p><strong>Note:</strong> I am testing on Emulator...
  After following all steps I only see the default messaging app of Android not mine like in the image given below. Any type of help will be appreciated. Thanks in Advance.</p>
  
  <p><img src="https://i.stack.imgur.com/YJUWo.png" alt="enter image description here"></p>