I am very new to Android development. I need some clarifications from you. My question is 'Is it possible to store no.of sms's in drafter programatically?". Please help me.
Thank you, Sekhar Bethalam.
Yes, you can save a message as a draft, the code to do this is below:
//Store the message in the draft folder so that it shows in Messaging apps.
ContentValues values = new ContentValues();
// Message address.
values.put("address", address);
// Message body.
values.put("body", messagebody);
// Date of the draft message.
values.put("date", String.valueOf(System.currentTimeMillis()));
values.put("type", "3");
// Put the actual thread id here. 0 if there is no thread yet.
values.put("thread_id", "0");
getContentResolver().insert(Uri.parse("content://sms/draft"), values);
Happy coding!
Do you mean you're making an SMS app and you want to save message drafts? That is 100% your problem. You are totally free to save drafts however you want. There is practically no Android assistance to texting beyond delivering the intent that contains the text and sending the text out for you.
来源:https://stackoverflow.com/questions/4592966/is-it-possible-to-save-sms-in-drafts-using-android-sdk