title: how to read and display only transaction messages from inbox to an android app
body: <p>I have already know that how to read the messages from inbox but I want to implement a android app to <strong>read only transaction message</strong> and display it in a <strong>list view with transaction amount</strong> ,credit debit etc.For my complete code.  <a href="http://pastebin.com/YYxktV7D" rel="nofollow">current complete code for fetching sms data</a>.how to filter the sms data according to requirement.</p>
  
  <pre><code>public List&lt;SmsInfo&gt; getSmsInfo() {
          String[] projection = new String[] { "_id", "address", "person",
                  "body", "date", "type" };
  
  //      @SuppressWarnings("deprecation")
  //      Cursor cursor = activity.managedQuery(uri, projection, null, null,
  //              "date desc");
  
          ContentResolver cr = activity.getContentResolver();
          Cursor cursor = cr.query(uri, projection, null, null, "date desc");
  
          int nameColumn = cursor.getColumnIndex("person");
          int phoneNumberColumn = cursor.getColumnIndex("address");
          int smsbodyColumn = cursor.getColumnIndex("body");
          int dateColumn = cursor.getColumnIndex("date");
          int typeColumn = cursor.getColumnIndex("type");
          if (cursor != null) {
              int i = 0;
              while (cursor.moveToNext() &amp;&amp; i++ &lt; 20) {
                  SmsInfo smsInfo = new SmsInfo();
                  smsInfo.setName(cursor.getString(nameColumn));
                  smsInfo.setDate(dateFromLongToString(cursor.getString(dateColumn)));
                  smsInfo.setPhoneNumber(cursor.getString(phoneNumberColumn));
                  smsInfo.setSmsbody(cursor.getString(smsbodyColumn));
                  smsInfo.setType(cursor.getString(typeColumn));
                  String personName = getPeople2(smsInfo.getPhoneNumber());
                  smsInfo.setName(null == personName ? smsInfo.getPhoneNumber()
                          : personName);
                  infos.add(smsInfo);
              }
              cursor.close();
          }
          return infos;
      }
  </code></pre>