1

I'm messing around with creating fake text messages and while this snippet works great for making it look like a message has been sent from the phone, I can't figure out how to mark the created message as delivered.

ContentValues values = new ContentValues();
values.put("address", "some-address");
values.put("body", "some-text");
getContentResolver().insert(Uri.parse("content://sms/sent"), values);

Is this somehow even possible without the message being "truly sent"?

1 Answers1

1

Column names are indicated in this How to use SMS content provider? Where are the docs? question. 'Status' may be what you are looking for.

from http://grepcode.com/file/repository.grepcode.com/java/ext/com.google.android/android/2.3.7_r1/android/provider/Telephony.java I'd say

113         public static final String STATUS = "status";
114 
115         public static final int STATUS_NONE = -1;
116         public static final int STATUS_COMPLETE = 0;
117         public static final int STATUS_PENDING = 32;
118         public static final int STATUS_FAILED = 64;

Set as 0 (complete) should mark it as sent.

Community
  • 1
  • 1
njzk2
  • 38,969
  • 7
  • 69
  • 107