开发者

Is it possible to save sms in drafts using Android sdk

开发者 https://www.devze.com 2023-02-02 02:40 出处:网络
I am very new to Android devel开发者_如何学Copment. I need some clarifications from you. My question is \'Is it possible to store no.of sms\'s in drafter programatically?\".

I am very new to Android devel开发者_如何学Copment. 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.

0

精彩评论

暂无评论...
验证码 换一张
取 消