ArcGIS AppStudio

What’s New in AppStudio Framework Version 4.0

The AppStudio Framework (AppFramework) provides QML components used when creating apps in AppStudio for ArcGIS. The AppFramework library of components is unique in that it has features and capabilities that are neither natively provided by the underlying Qt framework nor the ArcGIS Runtime, but are necessary and commonly used for developing apps. We are excited to share new features and enhancements added specifically to AppFramework in the recent AppStudio 4.0 release. 

  

Enhancements 

Share text, URL, or file sample
Share text, URL, or file Sample

Permission & Permission Dialog [BETA]

A.  Requesting Permission 

If your app needs permission to access system-wide capabilities such as Location, Storage, Bluetooth, etc., then the app needs to request & grant the appropriate permission in order to function. The PermissionDialog component provides an interface to request permission at runtime.  

The snippet below demonstrates how to request permission for the device’s location. By setting the property openSettingsWhenDenied to true, the app opens application settings when permission is denied.

Permission Request sample
Permission Request Sample

 

 

B. Check for Permission 

If your app needs permission to access a capability, you must check whether the app has that permission every single time before you perform the operation. The Permission singleton provides a method, checkPermission()which lets you quickly determine the status of the permission.  

For example, this snippet lets you determine the status of the Location permission.  

Permission.checkPermission(Permission.PermissionTypeLocationWhenInUse)

The method returns an enumerator value determining the state as follows: 

C.  Service Availability 

If your app needs to check the real-time status of a service provided by a device such as Bluetooth or location, the Permission singleton provides a method, serviceStatus(), which lets you determine the status.  

For example, this snippet lets you determine the status of the Location service. 

Permission.serviceStatus(Permission.LocationService) 

The method returns an enumerator value determining the state as follows: 

Camera Dialog [BETA] 

The CameraDialog is a lightweight component that provides direct access to the system camera controls with the best available resolution supported by the device. It comes with two modes i.e., CameraCaptureModeStillImage and CameraCaptureModeVideo, which lets you capture an image or video respectively. After the capture is completeyou can playback & review before saving.  

The CameraDialog is a separate component and it works in addition to the QML Camera component. The new Camera Dialog provided in ArcGIS.AppFramework.Multimedia gives you a solution to easily add photo and video capture to your custom app.

Use CameraDialog in iOS and Android
Use CameraDialog in iOS and Android

Ability to change languages in runtime 

An app will always load the appropriate translation file to match the default system locale. An alternative for testing is a command-line parameter –locale, which will override the system locale, i.e. appending locale fr to the command line will launch the app in French. 

With AppStudio 4.0, we have made some changes in the AppFramework for better changing of the app locale.  

AppStudio Player language setting
AppStudio Player language setting

We encourage you to try these new features and enhancements added to the AppFramework. 

About the author

Tina Jin is a Product Engineer on ArcGIS AppStudio team.

Next Article

Engaging Volunteers for a Cause

Read this article