是否可以使用Android sdk在短信中保存短信

sek*_*sek 3 android android-sdk-2.1

我是Android开发的新手.我需要你的一些澄清.我的问题是"是否有可能以编程方式在短片中存储短信?".请帮助我.

谢谢Sekhar Bethalam.

Cam*_*gny 7

是的,您可以将邮件另存为草稿,执行此操作的代码如下:

//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);
Run Code Online (Sandbox Code Playgroud)

快乐的编码!