Melug
Melug

Reputation: 1031

can I send "SMS received intent"?

Title is obvious. Can I send "SMS received intent" on the android phone? In other words, virtually receive custom SMS to fake some SMS receivers.

Upvotes: 5

Views: 3706

Answers (1)

Trung Nguyen
Trung Nguyen

Reputation: 7532

You can create fake SMS (GMS type) so built-in catch like real message. Here is my answer

 Intent intent = new Intent();
intent.setClassName("com.android.mms",
        "com.android.mms.transaction.SmsReceiverService");
intent.setAction("android.provider.Telephony.SMS_RECEIVED");
intent.putExtra("pdus", new Object[] { pdu });
intent.putExtra("format", "3gpp");
context.startService(intent);

Upvotes: 3

Related Questions