SORU
11 Mayıs 2009, PAZARTESİ


Nasıl gelen kutusuna gelen mesajları Program aracılığıyla SMS okuma Android edebilir miyim?

SMS gelen kutusu gelen mesajları almak ve onları görüntülemek istiyorum?

CEVAP
29 ŞUBAT 2012, ÇARŞAMBA


İçerik Çözümleyici (Kullanın< . "://içeriği/sms gelen kutusu") gelen SMS okumak için.

// public static final String INBOX = "content://sms/inbox";
// public static final String SENT = "content://sms/sent";
// public static final String DRAFT = "content://sms/draft";
Cursor cursor = getContentResolver().query(Uri.parse("content://sms/inbox"), null, null, null, null);

if (cursor.moveToFirst()) { // must check the result to prevent exception
    do {
       String msgData = "";
       for(int idx=0;idx<cursor.getColumnCount();idx  )
       {
           msgData  = " "   cursor.getColumnName(idx)   ":"   cursor.getString(idx);
       }
       // use msgData
    } while (cursor.moveToNext());
} else {
   // empty box, no SMS
}

Ekleyin lütfenREAD_SMSizni.

Yardımcı olur Umarım :)

Bunu Paylaş:
  • Google+
  • E-Posta
Etiketler:

YORUMLAR

SPONSOR VİDEO

Rastgele Yazarlar

  • Angry Paintballer

    Angry Paintb

    8 Ocak 2012
  • Jared Busch

    Jared Busch

    25 Mayıs 2011
  • merumputdotcom

    merumputdotc

    24 ŞUBAT 2012