Skip to content

This is a component to turn more easy the request permission in Android 8.x or later.

License

Notifications You must be signed in to change notification settings

adrianosantostreina/MobilePermissions

Repository files navigation

MobilePermissions

MobilePermissions

This is a component to turn more easy the request permission in Android 8.x or later.

The MobilePermissions component was developed to facilitate the request and granting of permission to the operating system resources that the application needs to use. We seek to make the life of the Delphi Mobile developer simpler.

We translate all the permissions provided for in Project > Options > Application > User Permissions to the component, so the developer will not need to enter the project settings window to mark the permissions he wants to request, just drag a MobilePermissions component to the Form and mark the properties What do you want.

💎 Categories

The component was divided into 03 (three) distinct categories of permissions represented by properties and sub-properties. Are they:

  • DANGEROUS: The following uses permissions require runtime user approval.
  • SIGNATURE: The following uses permissions require a matching certificate.
  • STANDARD: Normal Uses Permissions

😎 Facilities

When using the component, the developer is no longer required to access Project > Options > Application > User Permissiosn because when checking/unchecking the property, the component automatically adjusts the project settings.

Before Installed

Make sure you have uninstalled any previous versions of the component before installing a new one.

Installation by Package

  1. Open Delphi in Administrator mode. Delphi needs build and create a .BPL in System Directories.
  2. Open MobilePermissions package file MobilePermissions.dpk.
  3. Right click in MobilePermissions.bpl in Project Manager and select Clean.
  4. Right click in MobilePermissions.bpl in Project Manager and select Build.
  5. Right click in MobilePermissions.bpl in Project Manager and select Install.

If the Install menu does not showing in context menu then select Windows 32-bit in Project Manager and click right button again.

alt text

Ready! 😎

Installation by Get It Package Manager?

  1. Open Delphi in Administrator mode. Delphi needs build and create a .BPL in System Directories.
  2. Open Tools > Get It Packager Manager.
  3. Type MobilePermissions in the search box.
  4. When you find the component click over it his and click in Install Button.

alt text

  1. Accept terms and contract clicking in Agree all and Next
  2. Wait the installion process

Ready! 😎

⚡️ Quickstart

Mode 1
  1. Drop a component to form (Tool Palette TDevRocks).
  2. Select the permission that you want to request to Android in your project mobile.
  3. Run your app in Android.
Mode 2
  1. Create a new project.
  2. Drag controls like below.
  • Drag a TButtom onto form
  • Drag a TMobilePermissions onto form
  • In the OnCreate event of the Form type
  1. Type code.
procedure TForm1.OnCreate(Sender: TObject);
begin
  MobilePermissions1.[CATEGORY].[Permission] := True;
  MobilePermissions1.Apply;
end;

E.g.:

procedure TForm1.Button1Click(Sender: TObject);
begin
  MobilePermissions1.Dangerous.CAMERA := True;
  MobilePermissions1.Standard.AccessNetworkState := True;
  MobilePermissions1.Apply;
end;
  1. Run your app in Android.

⚠ Requirements

Add this folders path into Search Path field like bellow:

\MobilePermissions\source<br>
\MobilePermissions\component<br><br>

Recompile and redistrbuilt your project and e voilà

🧪 Compatible with

Delphi 10.2+

🧪 Tests performed on

Android 7.0 (This version dosen't need this component, but can you use without problem)
Android 8.x
Android 9.x
Android 10
Android 11
Android 12
Android 13
Android 14

Documentation Languages

English (en)
Português (ptBR)

⚠️ License

MobilePermissions is free and open-source library licensed under the MIT License.

About

This is a component to turn more easy the request permission in Android 8.x or later.

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages