I want to show some information as an sms in my application. But SmsManager and BroadcastReciever can not create sms and notify on phone itself.
How can I send a fake sms to myself programmatically? Any ideas, workarounds or any class for research... ?
Thanks.
They've changed (spoofed) the caller ID to look like they're messaging you from your number, but the shock of getting a text from yourself is bound to get your attention — which is what they're after. If you get a text from your own number, it's a scam.
Both Google Play and the iOS App Store also have plenty of apps from which you can do some anonymous texting. They include Text Me, Text Free, TextNow, and textPlus. Typically, you can send and receive texts from a number the app assigns you.
Sending a text message to yourself is as easy sending one to a friend. All you have to do is open a new blank message and enter your own phone number in the To: field.
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 is no event after that therefore android doesnt known if there is some new message.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With