How can I get the number of unread sms in android?
The simplest way I found out:
Cursor c = getContentResolver().query( Uri.parse("content://sms/inbox"), new String[] { "count(_id)", }, "read = 0", null, null ); c.moveToFirst(); int unreadMessagesCount = c.getInt(0);