title: How to get an contact count and media card count in android?
body: <p>has anyone know how to get the contact count on android mobile phone via program?? i really need that.. so it will toast like this :</p>
  
  <pre><code>contact count : 175 contacs
  media card data : music &gt;&gt; 6 data | image &gt;&gt; 7 data ect.
  </code></pre>
  
  <p>i want to create report for my android phone via program and for now i only can get the count of SMS in my phone.. that code is like this :</p>
  
  <pre><code>package com.application.smsandroid;
  
  import android.app.Activity;
  import android.os.Bundle;
  import android.database.Cursor;
  import android.net.Uri;
  import android.widget.TextView;
  import android.widget.Toast;
  
  public class smsandroid extends Activity {
      /** Called when the activity is first created. */
      @Override
      public void onCreate(Bundle savedInstanceState) {
          super.onCreate(savedInstanceState);
          TextView view = new TextView(this);
          Uri uriSMSURI = Uri.parse("content://sms/inbox");
          Cursor cur = getContentResolver().query(uriSMSURI, null, null, null,null);
          String sms = "";
          int jumlah=0;
          while (cur.moveToNext()) {
              sms += "From :" + cur.getString(2) + " : " + cur.getString(11)+"\n";
              jumlah=jumlah+1;
          }
          //view.setText(sms);
          setContentView(view);
  
  
          Toast.makeText(this,"SMS Count : " + Integer.toString(jumlah), 1).show();
  
      }
  
  }
  </code></pre>
  
  <p>please help me for solving my problem.. thanks in advance..</p>