Pro camera: The pro custom camera

None of that material has a problem with description.

it is always a good idea to be clear, that this is a bug, so it will not be forgotten...
I guess, it is already on the permissions bug list of @ewpatton... isn't it?

Taifun

1 Like

Correction. I checked it again. No idea why I missed that, but the Image component now no longer requests READ permission on Android 11+ if the image is created by the app itself and stored in one of the Shared folders.

My fault, so hopefully not in this case. :wink:

3 Likes

Hello Kumaraswamy

Could you reduce the size of the icon for the Palettes please? 16 x 16 pix

2 Likes

Hi!

I've been fooling arround with Pro Camera extension for some days now and it works great! But the resulting images are then not "found" by the system. As far as I was able to google-up, all media has to be scanned by MediaStore to be included in galleries and so on. Are you planning on adding this feature to the extension or does anyone know how to do it otherwise? Would it be possible somehow with Activity starter? I'm not fammiliar with neither Android nor ActivityStarter... :frowning:
Thanx!

1 Like

I can help you if you want to save the images to the Gallery after taking them.

Wait till I fetch the .aia

1 Like

Here you go :

ProCamera.aia (143.8 KB)

Steps : -

  1. Download the .aia.
  2. Import it to AppInventor.
  3. Compile it  without changing anything in it. 
  4. Download the compiled apk.
  5. Install it.
  6. Check if it works as per your wishes.
1 Like

Doesn't work on Android 11+.
(the well known issue: "Error 908: The permission ...")

Try this one:

1 Like

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!

2 Likes

Please do not request for, or mark, solutions in an Extension topic.

5 Likes

Lol I thought it was a different topic. :joy::joy::joy::joy::joy:

Are there any examples or samples of how to use the TakePreviewPicture method? I get an undefined error whenever I try it.

1 Like

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?

1 Like

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.

2 Likes

When I do that, I get an undefined error, and the app crashes.
image

Here's the actual code blocks I have implemented.

1 Like

For Companion:

2 Likes

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 named directory, 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 to global directory + filename.png. You should also have a global variable named lastPath, set its value to ProCamera1.Output. Now use the ProCamera.TakePreviewPicture.
Under the SavedPhoto event, set Image1.Path to lastPath.

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 :