Doesn't work on Android 11+.
(the well known issue: "Error 908: The permission ...")
Try this one:
Doesn't work on Android 11+.
(the well known issue: "Error 908: The permission ...")
Try this one:
So the answer is TaifunTools Extension: GalleryRefresh !
I love you! :D:D:D I was starting to dive into intents, actions, broadcasts not to mention APK differences...
Big thanx!
Please do not request for, or mark, solutions in an Extension topic.
Lol I thought it was a different topic.
Are there any examples or samples of how to use the TakePreviewPicture method? I get an undefined error whenever I try it.
Post your blocks and .aia
file.
First, what's the difference between TakePreviewPicture vs. just TakePicture?
Take Picture will use the android api to capture photo while the take preview picture will capture the image in the view or arrangement
So how do I actually access the image after calling TakePreviewPicture? What goes inside the SavedPhoto event to actually display the captured photo in the view?
Use the set Image1.Picture to ProCamera1.Output.
If you want the image to be shown in your Gallery, set the output path to a shared directory and in the ProCamera1.SavedPicture use TaifunTools.GalleryRefresh for ProCamera1.Output.
When I do that, I get an undefined error, and the app crashes.
Here's the actual code blocks I have implemented.
What have you set as the output path Adi ?
Shared Directory - This directory is available to all your app. The Shared directory for pictures is
/storage/emulated/0/Pictures
to use it as an output path, make a global variable nameddirectory
, that stores the value/storage/emulated/0/Pictures/
(remember the last/
in this case). On the Button click event, (for the Camera button), set the output path toglobal directory
+filename.png
. You should also have a global variable namedlastPath
, set its value to ProCamera1.Output. Now use the ProCamera.TakePreviewPicture.
Under the SavedPhoto event, set Image1.Path tolastPath
.
Wait till I post an aia.
App Specific Directory (ASD) - This directory is available to only your app. It is located in the external storage. (I'm not taking about the removable micro SD Card.) If you use this, you may not be able to show the image in your gallery directory from that folder.
App Private Directory (Data directory) - It is where the data for an app is stored. If you want further descriptions on android data storage, read this topic :
Show also (always) the blocks.
Here they are:
PermissionGranted
event?WRITE
permission READ
is granted implicitily (automatically).If I use the PermissionGranted event to initialize the camera, the camera will be initialized only once. From the next time the event won't be triggered. So I used a clock which gives 5 seconds to the user to give the permission.
That would require extra off-topic work. The person was after saving and viewing the image, not after the permissions.
No, you just have to use the right blocks.
Storage permissions are not required on Android 11+ for one of the Shared
folders (like /Pictures
).
I know that you mean saving permission data in TinyDB, right ?
But that shouldn't matter, I was just after solving the image saving problem.
Would the app crash if I request the permission ? (I don't actually know.)
Why should it? But it's just unnecessary. You should always request as few permissions as possible! I've pointed this out often enough.
Is it possible to save the output as png and not jpg?