email attachment, dirinternal

exjey

Member
Licensed User
Longtime User
after some errors sending email w/ attachment , found a post saying that dirinternal is not a valid place to store a file before attaching it to the external email client, cause dirinternal keeps only private files for our apps. Is this true? DirDefaultExternal recommended, is this the right place to save temporary a file? "External" means to SD card? And if the user doesnt have sd card a runtime error appears?

Also in case i am doing some other false coding, how to use the outputstream exactly to save bitmap object to JPG file. Thanks.
 

agraham

Expert
Licensed User
Longtime User
dirinternal keeps only private files for our apps. Is this true?
Yes.
DirDefaultExternal recommended, is this the right place to save temporary a file?
Yes.
"External" means to SD card? And if the user doesnt have sd card a runtime error appears?
Not necessarily. Look at the "External Storage" section here. Storage Options | Android Developers. The other sections are relevant as well.
Also in case i am doing some other false coding, how to use the outputstream exactly to save bitmap object to JPG file. Thanks.
Pass the stream to Bitmap.WriteToStream.
 
Upvote 0

exjey

Member
Licensed User
Longtime User
Hello again. Just tested the .DirDefaultExternal path to save an image before attaching to an Email object, the .WriteToStream produces runtime error on a ZTE BLADE Android 2.2 phone with the SD card unmounted.

I know there is not a reason to have a SD card unmounted, but this is not something that makes me feel OK with my code.

So my question is: In what folder should i save a file for use with an Intent (some external program). DirInternal is for private files only, DirDefaultExternal assumes that there is a SD card located, at least on some devices what ever.

Some more fixed path for saving a file for use with external program?
 
Upvote 0

exjey

Member
Licensed User
Longtime User
I've found this property in some post here in the forum and works ok as a warning message. Great, thanks.
 
Upvote 0
Top