C++C++11C++14C++17Code SnippetLanguage FeatureLearn C++Syntax

Learn About Handling Android32 Permissions In C++

Mobile android applications developed in C++ Builder requires permissions to use some part of mobile devices (sensors, camera etc..). These should be allowed by the user. an these permissions can be checked over the project options from Project > Options > Application > Uses Permissions section. Some of these permissions were listed in this document http://docwiki.embarcadero.com/RADStudio/Rio/en/Uses_Permissions. All Android permission can be found listed officially on Manifest Permission List
Some Basic Android Permissions are Set for All FireMonkey Android Apps

Which Software Is Used To Run C program and C++ apps on Multi Platform OS The Android permissions page

These checks are not enough, You also need to request permission on runtime. Because these permissions should be allowed manually by user and these might be not allowed. For example if you are starting to use camera in your application you must do this request check. To do this u need to Request all permissions you need by using TAndroidHelper::Activity->requestPermissions( ) like this;

and you must check permissions if it is granted or not by using checkSelfPermission() like this:

We should show permissions so user can grants manually;

Android official page has a good article about Request app permissions permissions in Kotlin & Java. C++ Builder uses Helpers to request these permissions as below;

Here is a sample for an Android Application to check permissions

Oh hi there 👋
It’s nice to meet you.

Sign up to receive awesome C++ content in your inbox, every day.

We don’t spam! Read our privacy policy for more info.


Reduce development time and get to market faster with RAD Studio, Delphi, or C++Builder.
Design. Code. Compile. Deploy.
Start Free Trial

Free C++Builder Community Edition

About author

Dr. Yilmaz Yoru has 35+ years of coding with more than 30+ programming languages, mostly C++ on Windows, Android, Mac-OS, iOS, Linux, and some other operating systems. He graduated and received his MSc and PhD degrees from the Department of Mechanical Engineering of Eskisehir Osmangazi University. He is the founder and CEO of ESENJA LLC Company. His interests are Programming, Thermodynamics, Fluid Mechanics, Artificial Intelligence, 2D & 3D Designs, and high-end innovations.
Related posts
C++C++11C++14C++17C++20Introduction to C++Learn C++

Learn Copy Constructors in C++ Classes

C++C++11C++14C++17Introduction to C++Learn C++Syntax

Learn How To Use Types Of Destructors In C++?

C++C++11C++14Learn C++Syntax

How To Convert u32string To A wstring In C++

C++C++11C++14C++17C++20Introduction to C++Learn C++

How To Learn The Move Constructors In Modern C++?

Worth reading...
Top C++ Compilers for Windows in 2020