Jump to content
grantful

Looking for a tutorial for taking picture ios, android Permissions

Recommended Posts

I am following a tutorial here

https://docwiki.embarcadero.com/RADStudio/Alexandria/en/Taking_Pictures_Using_FireMonkey_Interfaces#Taking_a_Picture_with_a_Device_Camera

 

This works good on my Iphone but not on android.

Does anyone know a good tutorial with android permissions.

 

I was looking for ant the sample for this but it uses actions.

 

I need to to do this in code as i have 10 different images i need to put a picture in.(image1, image2, image3, etc);

 

If i could get an example with this code that would be great.

 

P.S I did try the mobile permissions component but it seems for android and i can not compile to ios.

 

Thanks for any help.

Share this post


Link to post

here you can study how do it in Android, BUT ... in Android some changes was implemented for new versions, mainly "disk access/folders".

 

you can use "compiler directives" to separate Android / iOS / WINDOWS  codes.

https://docwiki.embarcadero.com/RADStudio/Alexandria/en/Conditional_compilation_(Delphi)

 

 

https://en.delphipraxis.net/topic/4168-fmx-android-using-cam-on-mobile-to-capture-video-and-target-to-timage-permissions-use/?tab=comments#comment-35707

 

Edited by programmerdelphi2k

Share this post


Link to post

Hi

 

If you installed the samples from RAD Studio / Delphi, you have a "mobile snippets" folder where you'll find pieces of code to do what you want.

 

And if you want only code, look at this simple sample I've made for the Learn to code Summer Camp 2021 : https://github.com/DeveloppeurPascal/LearnToCodeSummerCamp2021/tree/main/Day-3

 

Just notice you have to add some permissions for Android devices in Project / Options.

In SelfieCam sample I used the TCameraComponent instead of calling the camera SDK/instant (iOS/Android). In this case we need to manage the "lost focus" of the app to free the handle to the device.

 

If you need to call the embed camera app, you can do it with an action list (even by code) or the platform service (if available). Some explanations are available on this page : https://developpeur-pascal.fr/utiliser-l-action-standard-takephotofromcamera-pour-les-applications-android-9-et-plus.html (in english with Google Translate).

Share this post


Link to post

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×