android - How can I send fake sms to myself without mobile network usage? -
i want show information sms in application. smsmanager , broadcastreciever can not create sms , notify on phone itself.
how can send fake sms myself programmatically? ideas, workarounds or class research... ?
thanks.
proof of concept
call sms list
intent intent = new intent("android.intent.action.main"); intent.setcomponent( new componentname("com.android.mms","com.android.mms.ui.conversationlist")); startactivity(intent);
read sms
cursor c= getcontentresolver().query(uri, null, null ,null,null); startmanagingcursor(c); c.movetofirst(); string body = c.getstring(c.getcolumnindexorthrow("body")).tostring(); string number = c.getstring(c.getcolumnindexorthrow("address")).tostring(); c.close(); toast.maketext(getapplicationcontext(), number, toast.length_long).show();
write sms
contentvalues values = new contentvalues(); values.put("address", "sender"); values.put("body", "foo bar"); getcontentresolver().insert(uri.parse("content://sms/inbox"), values);
manifest
<uses-permission android:name="android.permission.write_sms"/> <uses-permission android:name="android.permission.read_sms"/>
issue there no event after therefore android doesnt known if there new message.
Comments
Post a Comment