Camera Intent and Internal Memory

Dave Fitzpatrick

Member
Licensed User
Longtime User
I have an app that calls the camera intent and everything works fine when saving the image to the sd card. To get the proper directory for storing the image, I use

If File.ExternalReadable AND File.ExternalWritable Then
defDir = File.DirDefaultExternal
Else
defDir = File.DirInternal
End If

Then I call the camera intent with:

camintent.Initialize("android.media.action.IMAGE_CAPTURE", "")
camintent.PutExtra("output",ParseUri("file://" & File.Combine(defDir,"myimage.jpg")))

Everything works fine with an sd card phone.

Then I use a phone with the sd card removed, and the camera intent opens but File.Exists(defDir, "myimage.jpg") returns false

File.Exists(defDir, "") returns true, however. So, for some reason, myimage.jpg does not appear to be written to the defDir folder.

I have used Astro and searched the whole internal storage and am not able to locate either the image file or the directory that Log(defDir) reports as being the default internal directory, even though File.Exists(defDir, "") returns true.

Can the camera intent write files other than gallery files only to an external card?
 

Dave Fitzpatrick

Member
Licensed User
Longtime User
Thanks. So that would say that if my app uses the camera intent, then it will only work with sd card phones, correct? I thought about (in fact, tried) using the Camera library, but I find that it makes it difficult to access all the features of the built in phone. That, plus users are already familiar with the "look and feel" of how to use all the features of their phone's camera.

Is there any other option open to me if I use the camera intent? I know that the image is being stored in the Gallery. On my particular phone, this is in a folder named:

/mnt/emmc/DCIM/100MEDIA

I guess I could read every image in the Gallery until I reached the end and copy that to the defDir. But that seems to be a bit brute force.

I have a similar problem with recordings as well, which are being placed in a folder named

/mnt/emmc/My Documents/My Recordings

Dave
 
Upvote 0
Top