I need to send sms message to the inbox but in same time I want to send a broadcast that other apps can receive it
Now I'm sending sms to inbox successfully using answer in this question but with no broadcast or alerts or any kind of notifications.
This is the code I'm using:
fab.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View view) {
ContentValues values = new ContentValues();
values.put("address", "+123456789");//sender name
values.put("body", "Welcome Home!");
getContentResolver().insert(Uri.parse("content://sms/inbox"), values);
}
});
What I need to know is how to send this SMS in a broadcast that other apps can receive and makes android give alerts and notifications exactly like when it receives real SMS messages.
Unfortunately all questions here about sending such type of broadcasts are not answered or have no correct answer.
The application which will handle my SMS is using broadcast receiver for SMS not intent filter, it doesn't have any intent filter for SMS.
Edit
I need to send sms message to the inbox of the device where my app is not to other device's inbox.