Hi,
Can you please tell me how can i query the number of unread SMS in android programmically?
How can I implement the SMS unread count like this link: http://android.kanokgems.com/sms-unread-count/
Hi,
Can you please tell me how can i query the number of unread SMS in android programmically?
How can I implement the SMS unread count like this link: http://android.kanokgems.com/sms-unread-count/
The API Docs show a constant that you should be able to look for to figure out which messages are received and unread.
This article shows somebody interacting with the SmsMessage class, which might give you some pointers.
Hello,
Here is a code snippet that lets you read messages as they arrive.
import android.content.BroadcastReceiver;
import android.content.Context;
import android.content.Intent;
import android.os.Bundle;
import android.telephony.gsm.SmsMessage;
import android.widget.Toast;
public class SMSReceiver extends BroadcastReceiver
{
public void onReceive(Context context, Intent intent)
{
Bundle myBundle = intent.getExtras();
SmsMessage [] messages = null;
String strMessage = "";
if (myBundle != null)
{
Object [] pdus = (Object[]) myBundle.get("pdus");
messages = new SmsMessage[pdus.length];
for (int i = 0; i < messages.length; i++)
{
messages[i] = SmsMessage.createFromPdu((byte[]) pdus[i]);
strMessage += "SMS From: " + messages[i].getOriginatingAddress();
strMessage += " : ";
strMessage += messages[i].getMessageBody();
strMessage += "\n";
}
Toast.makeText(context, strMessage, Toast.LENGTH_SHORT).show();
}
}
}
Hi How can I query the number of OUTGOING (SENT) SMS in android??
please any give the Code for getting the Count for the SMS sent .