Is it possible to send a SMS Text message with a .jpg Image that is stored on the device from within B4A? Similar to if you take a picture from within messaging and send it.
I don´t think this will work. SMS has a limited Size. Not sure about exactly but i think 160 chars or so when using 7bit characters. 120 or so otherwise.
Point is:
- that a SMS is ONLY TEXT.
- The image must be encoded in base64 to send it as a SMS.
- Every picture is too big to get encoded in 160 chars.
- Such an encoded Picture will receive at the other side (destination) as TEXT (the base64 String).
- No SMS App does decode it to a Bitmap.
But I do want to clarify one thing to the OP, unless your app is designed to replace the default SMS/MMS app on the user's device, your B4A app (or any other app) can not send an SMS/MMS message directly from the app itself. This is a rule setup by Google.
The only workaround is to send the SMS/MMS message via an Intent (like my example code does) that will open the users default SMS/MMS app and then the user needs to click "Send" in their messaging app to actually send the message.
How are images retrieved and sent in a message accomplished? Is this currently possible to send any image in a text message in B4a? If so please provide a link or further explanation. Thanks.
So, that lead me to believe he wasn't just talking about strictly using only SMS, that he was also talking about MMS (which nowadays the SMS/MMS is the same app) because with a strictly SMS messaging app, you couldn't "take a picture from within messages and send it".
So, that's why I said he can do it with my code because it will work on the majority of phones out there because they all handle MMS too.
Thanks for all the input and sorry if I didn't understand SMS/MMS. I am now able to send the text message after choosing a program but get an error when trying to send the image. I think the relevant part of the error is this.
Caused by: android.os.FileUriExposedException: file://storage/emulated/0/Android/data/com.bizmobl/files/images/U1000.jpg exposed beyond app through ClipData.Item.getUri()
I have tested that the file exists. Is this a permissions issue or something else?