-1

I want to save SMS to inbox and I have implemented answers from here which were supposed to store message into inbox. But I'm unable to find the stored sms and no error or exception is thrown. Thanks

Olu Udeh
  • 1,031
  • 1
  • 10
  • 20
  • check this link for SmsManager class [link](https://developer.android.com/reference/android/telephony/SmsManager) – Sahil Aug 29 '18 at 02:30
  • @sahil thanks, but I am not seeking to send SMS, I just want to save it. – Olu Udeh Aug 29 '18 at 04:20
  • you can only send or read the sms. what you intend to do can be done by the inbuilt app only. – Sahil Aug 29 '18 at 05:48

2 Answers2

0

Only the default SMS app can write to the SMS database on modern versions of Android. You can send an SMS, or read them. But only 1 app set by the user can write them.

Gabe Sechan
  • 90,003
  • 9
  • 87
  • 127
-1

So I did a little more digging and found a way around it.

I had to make my app the default SMS app using information from here then I was able to get the code working.

Olu Udeh
  • 1,031
  • 1
  • 10
  • 20