SMS 정보

|
  1.         int i = 0;
  2.         
  3. String row = "";
  4.         Uri allMessage = Uri.parse("content://sms/");
  5.         ContentResolver cr = getContentResolver();
  6.         
  7.         Cursor c = cr.query(allMessage, null, null, null, null);
  8.         
  9.         while(i < 30){
  10.          c.moveToNext();
  11.          i++;
  12.         
  13.          row += "_id = " + c.getString(0) + "\n";
  14.          row += "thread_id = " + c.getString(1) + "\n";
  15.          row += "toa = " + c.getString(2) + "\n";
  16.          row += "address = " + c.getString(3) + "\n";
  17.          row += "person = " + c.getString(4) + "\n";
  18.          row += "date = " + c.getString(5) + "\n";
  19.          row += "protocol = " + c.getString(6) + "\n";
  20.          row += "read = " + c.getString(7) + "\n";
  21.          row += "status = " + c.getString(8) + "\n";
  22.          row += "type = " + c.getString(9) + "\n";
  23.          row += "reply_path_present = " + c.getString(10) + "\n";
  24.          row += "subject = " + c.getString(11) + "\n";
  25.          row += "body = " + c.getString(12) + "\n";
  26.          row += "sc_toa = " + c.getString(13) + "\n";
  27.          row += "report_date = " + c.getString(14) + "\n";
  28.          row += "service_center = " + c.getString(15) + "\n";
  29.          row += "locked = " + c.getString(16) + "\n";
  30.          row += "index_on_sim = " + c.getString(17) + "\n";
  31.          row += "callback_number = " + c.getString(18) + "\n";
  32.          row += "priority = " + c.getString(19) + "\n";
  33.          row += "htc_category = " + c.getString(20) + "\n";
  34.          row += "cs_timestamp = " + c.getString(21) + "\n";
  35.          row += "cs_id = " + c.getString(22) + "\n";
  36.          row += "cs_synced = " + c.getString(23) + "\n";
  37.          row += "error_code = " + c.getString(24) + "\n";
  38.          row += "seen = " + c.getString(25) + "\n";
  39.          row += "\n\n\n\n\n\n\n\n";
  40.         }
  41.         
  42.         TextView textArea = (TextView)findViewById(R.id.textArea);
  43.         textArea.setText(row);

xml
  1. <?xml version="1.0" encoding="utf-8"?>
  2. <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
  3.     android:layout_width="fill_parent"
  4.     android:layout_height="fill_parent">
  5.     <ScrollView
  6.      android:layout_width="fill_parent"
  7.      android:layout_height="wrap_content">
  8. <TextView android:id="@+id/textArea"
  9.    android:layout_width="fill_parent" 
  10.    android:layout_height="wrap_content"/>    
  11.     </ScrollView>
  12. </LinearLayout>

'Android' 카테고리의 다른 글

Custom Dialog 주소록 정보 출력  (0) 2011.02.08
주소록 정보  (0) 2011.02.01
content://sms/ 필드명  (0) 2011.02.01
Custom Dialog  (0) 2011.02.01
db 호출용 class  (0) 2011.02.01
And