Back to project page sms_modi.
The source code is released under:
GNU General Public License
If you think the Android project sms_modi listed in this page is inappropriate, such as containing malicious code/tools or violating the copyright, please email info at java2s dot com, thanks.
package com.zhufeng.sms_mod; //from ww w . ja va 2s. co m import android.app.Activity; import android.content.ContentResolver; import android.content.ContentValues; import android.net.Uri; import android.os.Bundle; import android.view.Menu; import android.widget.TextView; import android.widget.Toast; public class Sms_insertActivity extends Activity { final String ADDRESS = "address"; // ????????????? final String DATE = "date"; final String READ = "read"; final String STATUS = "status"; final String BODY = "body"; // ?????? final String TYPE = "type"; // 1??????2?????? final String PERSON = "person"; // ???????????????? final String THREAD_ID = "thread_id"; @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_sms_insert); TextView tv = new TextView(this); tv.setText(insertSMS()); Toast.makeText(this, this.getString(R.string.toast_end), Toast.LENGTH_LONG).show(); } @Override public boolean onCreateOptionsMenu(Menu menu) { // Inflate the menu; this adds items to the action bar if it is present. getMenuInflater().inflate(R.menu.sms_insert, menu); return true; } public String insertSMS() { ContentResolver cr = getContentResolver(); ContentValues cv = new ContentValues(); Uri uriInbox = Uri.parse("content://sms/inbox"); cv.put(TYPE, 1); cv.put(ADDRESS, "10086"); cv.put(BODY, "Insert SMS Test... MSG... zfzg1923......!"); cr.insert(uriInbox, cv); // System.out.println("Insert SMS Successfully!"); Toast.makeText(this, this.getString(R.string.toast_insert), Toast.LENGTH_LONG).show(); return "Insert SMS Successfully!"; } }