Code Monkey home page Code Monkey logo

mobilepermissions's Introduction

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.

mobilepermissions's People

Contributors

adrianosantostreina avatar asrsantos avatar developpeurpascal avatar igorbastosib avatar thomaskalten avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

mobilepermissions's Issues

Mobile Components does not work at all. MobilePermissions.Component

MobilePermissions.Component
Highlights as an error.

I installed it as an administrator and normally --- same behavior.

MobilePermissions.Component not found -- and of course, nothing works after that.

This is using your demo. (One Drive is disabled for compiles)

C:\Users\davew\OneDrive\Documents\Embarcadero\Studio\22.0\CatalogRepository\MobilePermissions-2.1\Demos\Tests\UntMain.pas(8,98): error F2613: F2613 Unit 'MobilePermissions.Component' not found.

unit UntMain;

interface

uses
System.SysUtils, System.Types, System.UITypes, System.Classes, System.Variants,
FMX.Types, FMX.Controls, FMX.Forms, FMX.Graphics, FMX.Dialogs, MobilePermissions.Model.Signature,
MobilePermissions.Model.Dangerous, MobilePermissions.Model.Standard, MobilePermissions.Component,
FMX.Controls.Presentation, FMX.StdCtrls, System.Math.Vectors, FMX.Controls3D,
FMX.Layers3D, FMX.ListBox, FMX.Layouts;

error permission on android 10

Hello i have a little problem when i try to apply the permission on android 10 i have the message '' is not a valid integer value with your demo on delphi 10.4

RAD Studio 11 Alexandria

Error on compilation

[dcc32 Error] MobilePermissions.Permissions.Android.pas(81): E2250 There is no overloaded version of 'RequestPermissions' that can be called with these arguments
[dcc32 Fatal Error] MobilePermissions.Permissions.Factory.pas(7): F2063 Could not compile used unit 'MobilePermissions.Permissions.Android.pas'

Component does not work in Delphi 11.2 Patch 1

This only shows Win32 as only supported platform on component toolbar. Compiling does not work for Android target builds. Strange that an Android specific component is only supported for the Win32 platform. It worked on the trial version of Delphi 11 but not on the registered version 11.2.

TMobilePermissionsAndroid.SetAndroidVersion error on androd 5.1

Hi,

Thank you for share this component, very useful.

I have error on android 5.1 after MobilePermissions1.Apply;
" '5.1' is not a valid integer value. "

it's probably on procedure TMobilePermissionsAndroid.SetAndroidVersion;
FAndroidVersion := StrToInt(VVersionOSStr);

there is a alternative and easy way to find android version
System.SysUtils.TOSVersion.Major; (return Integer like 4,5,6,7,8,9,10)

more info: https://forums.embarcadero.com/thread.jspa?threadID=183785

Switching to IOS/windows from Android.

Hi I have tried:

{$IFDEF ANDROID} MobilePermissions.Model.Signature, MobilePermissions.Model.Dangerous,
MobilePermissions.Model.Standard, MobilePermissions.Component,{$ENDIF}System.IOUtils;

Which works on Android.

When I switch platforms the uses are added again

{$IFDEF ANDROID} MobilePermissions.Model.Signature, MobilePermissions.Model.Dangerous,
MobilePermissions.Model.Standard, MobilePermissions.Component,{$ENDIF}System.IOUtils,
MobilePermissions.Model.Signature, MobilePermissions.Model.Dangerous,
MobilePermissions.Model.Standard, MobilePermissions.Component;

How do I correct this please.

erro ao compilar...

ao compilar a aplicação para android nas versões XE8 e XE10.2 apresenta erro em
mobilepermissions.JNI.Os - JJManifest_permissionClass;

[DCC Error] MobilePermissions.UsesPermissions.FMX.Base.pas(97): E2003 Undeclared identifier: 'TJManifest_permission'

o que pode ser falta instalar algo?

Component is not asking for the necessary rights

Hi
Wonderful idea - hope I can make it work: I placed the component on a form and selected the rights I need, but when the software runs on Android is does not ask for the permissions. Do I have to do somethimg like a check before ?

Additionally I need the microphon permission which I can't find in the list.

Advice appreciated
Michael

Error MobilePermissions.Component.hpp

D:\XE_Kj\MobilePermissions\Package\Android\Release\MobilePermissions.Component.hpp(39,55): error E2017: expected a class or namespace
D:\XE_Kj\MobilePermissions\Package\Android\Release\MobilePermissions.Component.hpp(39,55): error E1558: reference to 'Fmx' is ambiguous
c:\xe7\include\android\fmx\FMX.TreeView.hpp(36,10): error E3056: candidate found by name lookup is 'Fmx'
D:\XE_Kj\MobilePermissions\Package\Android\Release\MobilePermissions.UsesPermissions.FMX.Signature.hpp(26,10): error E3056: candidate found by name lookup is 'Mobilepermissions::Usespermissions::Fmx'
D:\XE_Kj\MobilePermissions\Package\Android\Release\MobilePermissions.Component.hpp(39,67): error E969: expected class name
D:\XE_Kj\MobilePermissions\Package\Android\Release\MobilePermissions.Component.hpp(41,9): error E2017: expected a class or namespace
D:\XE_Kj\MobilePermissions\Package\Android\Release\MobilePermissions.Component.hpp(41,9): error E1558: reference to 'Fmx' is ambiguous
c:\xe7\include\android\fmx\FMX.TreeView.hpp(36,10): error E3056: candidate found by name lookup is 'Fmx'
D:\XE_Kj\MobilePermissions\Package\Android\Release\MobilePermissions.UsesPermissions.FMX.Signature.hpp(26,10): error E3056: candidate found by name lookup is 'Mobilepermissions::Usespermissions::Fmx'

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.