This works but I wonder what it would do if the phone has no sdcard
You are not using an "sdcard".
I can't try that option because i got a GS3 which apparently considers its own memory as an ext card (correct me if I'm wrong)
External storage normally is on-board flash, typically on the same partition that internal storage resides upon. While the documentation for external storage is not great, you may wish to review it.
I have also tried to send back an URI which points to a drawable resource (PNG file) from within my app... but it makes the calling app (MMS) crash and I don't catch the error in debugger.
You will not catch a crash from some third-party app in the debugger, as you are debugging your app, not the third-party app. LogCat may contain a stack trace, though.
What is the correct way to do that?
Use FileProvider
, or perhaps my StreamProvider
, to offer a ContentProvider
for serving up your images. Your Uri
would then be a content://
Uri
. This should be supported by most apps, as images routinely come from content providers (e.g., email attachments).