title: Using new Telephony content provider to read SMS
body: <p>According to the <a href="http://developer.android.com/about/versions/android-4.4.html#SMS" rel="nofollow noreferrer">4.4 SMS APIs</a>, the new version provides functionality to:</p>
  
  <blockquote>
    <p>allow apps to read and write SMS and MMS messages on the device</p>
  </blockquote>
  
  <p>I can't find any information on this functionality, nor any samples in the new SDK. This is what I have so far for reading new incoming messages.</p>
  
  <p>However, I would like to <strong>read existing messages</strong> stored on the deivce:</p>
  
  <pre><code>// Can I only listen for incoming SMS, or can I read existing stored SMS?
  SmsMessage[] smsList = Telephony.Sms.Intents.getMessagesFromIntent(intent);
  for(SmsMessage sms : smsList) {
      Log.d("Test", sms.getMessageBody())
  }
  </code></pre>
  
  <p><strong>Please note:</strong> I know about using the <a href="https://stackoverflow.com/questions/848728/how-can-i-read-sms-messages-from-the-inbox-programmatically-in-android">SMS Content Provider</a>, however this method is unsupported. According to the linked APIs, I should be able to do this in a supported way.</p>