Android Question [solved] Camera Intent files

udg

Expert
Licensed User
Longtime User
Hi all,
I successfully used and then modified Erel's code for Camera Intent, but can't find the newly produced files.
What I did:
- added a CustomListView to hold more than an ImageView
- modified Erel's code to make the ImageFileName a variable depending on date and time (i.e yyyyMMddHHmmss.png or something like this)
- commented out the delete file row in the ion event.

Everything works ok, but accessing the ImageFolder as returned by the rp in the Starter module, it doesn't show any file. Unaltered code showed the constant named file.

So my question is: where are those files? I need to access them when the user saves the form containing the clv in order to reduce their size and trasmit them to a server; once the server aknowledges a successful upload I need to delete those files from the device.

Edit:
As an update of my original post, I now can see the files from yesterday shootings but none from today (yes, I did refresh the screen; no I didn't force anything on Android side)
Meanwhile in ion_Event I substituted LoadBitmapSample with some image resizing code based on CreateScaledBitmap.
I tend to believe that I could leave Erel's code as is (I mean, using a single costant name for all subsequent shootings) and save the returned file in my app's folder with a given name based on date and time, when still in ion_Event.

udg
 
Last edited:

udg

Expert
Licensed User
Longtime User
@Erel : can you please confirm my last sentence in post above or comment about the "missing" files case ? Thank you.
 
Upvote 0

udg

Expert
Licensed User
Longtime User
Thanks, Erel.
The "delete" row I'm talking about is the one appearing in your post #19 on the cited thread (TakePicture sub, not ion_Event. Sorry).
In my case I checked with a log statement so I know that my Camera is using the Uri in the intent rather than the "getExtras" method ("output" instead of "data") so I was surprised not to found my newly named files there (and even more when I found them the next day).

Anyway, it seems wiser and more general to stay with a constant name and save the returned image with whatever name I choose.
If I understand it right, this way on the device, Camera will record at most one file, while it will be up to my app to save it they way I need.

One question: the image eventually returned as "data" will be a thumbnail (or any other small size format) suitable for a zoom out to enlarge it on a PC monitor in order to clearly read its details?

Thanks again.
 
Upvote 0

Erel

B4X founder
Staff member
Licensed User
Longtime User
If I understand it right, this way on the device, Camera will record at most one file, while it will be up to my app to save it they way I need.
That's a good approach.

the image eventually returned as "data" will be a thumbnail (or any other small size format) suitable for a zoom out to enlarge it on a PC monitor in order to clearly read its details?
No. The image returned will be too small for this. This is a fallback when the standard method didn't work.
 
Reactions: udg
Upvote 0
Cookies are required to use this site. You must accept them to continue using the site. Learn more…