I read this blog and this doc about default SMS app behavior on Android KitKat+. Both say that:
...if and only if an app is not selected as the default SMS app, the system automatically writes messages sent using this method to the SMS Provider (the default SMS app is always responsible for writing its sent messages to the SMS Provider).
So lets say from one place inside my code I need to send SMS. I use this code:
SmsManager smsManager = SmsManager.getDefault();
smsManager.sendMultipartTextMessage(
phoneNumber,
null,
smsManager.divideMessage(data),
null, null);
Now when not set as default app, I can confirm that SMS appears in the default app after sending it from my app. If I were the default app on device, how do I insert the SMS? Where do I call this insert, is there some method that needs to be overloaded?
And when SMS is received, in the receiver class, do I write the SMS into internal SMS database as well? Again, how?
Thanks very much for help