grantful 3 Posted June 27, 2023 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
programmerdelphi2k 237 Posted June 27, 2023 (edited) 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 June 27, 2023 by programmerdelphi2k Share this post Link to post
Patrick PREMARTIN 74 Posted June 27, 2023 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
grantful 3 Posted June 27, 2023 Thanks for you help. I will read over this information. Share this post Link to post