Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

android - sms type constants

Tags:

android

sms

Where can I find the API to find out what the "type" constants are for SMS?

I'm getting the values: 1, 6 and 2.

But don't know which one is outgoing, incoming, etc...

like image 661
airnet Avatar asked Dec 09 '11 15:12

airnet


People also ask

What is SmsManager?

SMSManager class manages operations like sending a text message, data message, and multimedia messages (MMS).

What is SMS telephony in Android?

Telephony.Sms.Inbox. Contains all text-based SMS messages in the SMS app inbox. class. Telephony.Sms.Intents. Contains constants for SMS related Intents that are broadcast.

How do I use SMS Manager on Android?

Manages SMS operations such as sending data, text, and pdu SMS messages. Get this object by calling the static method getDefault() . To create an instance of SmsManager associated with a specific subscription ID, call getSmsManagerForSubscriptionId(int) .

How can I read SMS messages from the device programmatically in Android?

parse("content://sms/inbox"); // List required columns String[] reqCols = new String[]{"_id", "address", "body"}; // Get Content Resolver object, which will deal with Content Provider ContentResolver cr = getContentResolver(); // Fetch Inbox SMS Message from Built-in Content Provider Cursor c = cr.


1 Answers

According to TextBasedSmsColumns the mapping is following:

MESSAGE_TYPE_ALL    = 0;
MESSAGE_TYPE_INBOX  = 1;
MESSAGE_TYPE_SENT   = 2;
MESSAGE_TYPE_DRAFT  = 3;
MESSAGE_TYPE_OUTBOX = 4;
MESSAGE_TYPE_FAILED = 5; // for failed outgoing messages
MESSAGE_TYPE_QUEUED = 6; // for messages to send later
like image 71
TN. Avatar answered Nov 08 '22 14:11

TN.