The AppStudio Framework (AppFramework) provides QML components used when creating apps in AppStudio for ArcGIS. 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. With every release of the AppStudio, we enhance AppFramework to exploit new underlying software and hardware device features, utility functions to improve developer productivity. In this blog, we are highlighting the beta features added to the AppFramework at the AppStudio 3.1 release (September 2018).
Note: These capabilities are currently in Beta. This means we are looking forward to your feedback and functionality may undergo minor changes. Please be cautious in using these beta features in your store apps.
Support for Bluetooth Low Energy (BLE) devices
We have added the following new components into AppFramework Devices plugin to support communication with Bluetooth LE devices. You can now create AppStudio apps that can discover and connect to Bluetooth LE devices, discover services, and read or write characteristics for devices that support it. You can find more information on how to use these new components in this blog post.
New Email Composer component
With AppStudio 3.1, we have introduced a new Inter-App Communication plugin, which includes an EmailComposer component to launch your system’s mail client with a pre-filled draft email that is ready to send, modify, delete or save as a draft. The following code snippet demonstrates how to show a pre-filled email by clicking on a button using the EmailComposer component.
import ArcGIS.AppFramework.InterAppCommunication 1.0
cc: ["email@example.com", "firstname.lastname@example.org"]
subject: "Feedback for " + app.info.title
"Device OS:" + Qt.platform.os + AppFramework.osVersion + "<p>" +
"Device Locale:" + Qt.locale().name + "<p>" +
"App Version:" + app.info.version + "<p>" +
"AppStudio Version:" + AppFramework.version
text: qsTr("Generate Email")
An Email Composer sample is also available in AppStudio Desktop or Player.
Email Composer Sample App
Support for cryptographic hashes
Have you ever try to make a web service call from your native app that request to provide encrypted information in the headers or you just looking to store your information securely using the hash. We have made it easier to add these features and more to your app using the new CryptographicHash and MessageAuthenticationCode components available in the AppFramework at the 3.1 release. These components provide a way to generate cryptographic hashes or hash-based message authentication codes. We have published a Cryptographic Hash sample to show you how to use Cryptographic Hash functions and Message Authentication Codes in your AppStudio apps. You can search for it in the AppStudio Desktop or just play it in AppStudio Player Samples page.
Cryptographic Hash Sample App
New Browser View component
One of the most requested features for iOS has landed in AppStudio 3.1. We are happy to introduce a new native in-app browser component called BrowserView to bring you a full Safari web browser experience for iOS devices. Under the hood, the BrowserView is powered by SafariViewController for iOS and AppFramework WebView on other platforms. The following code sample demonstrates how to use the BrowserView component.
import ArcGIS.AppFramework.WebView 1.0
text: "Open BrowserView"
Note: It is recommended to set that the "enableHighDpi" property under "display" to true in the appinfo.json file so that the BrowserView displays without any UI scaling issues.
Note: The BrowserView documentation is currently not available in online documentation or bundled in Qt Creator while in beta. Here is a quick API reference.
The URL of the web page that you wish to load
Shows Web View
A Browser View sample app is also available to you on AppStudio Desktop and Player.
Browser View Sample App
AppFramework component enhancements
1. Permissions ... Permissions ... Permissions ...
We have added a new checkCapability() method into the AppFramework in 3.1 to help you check if your device has granted critical permissions such as access to the device’s location, camera, microphone, or external storage. This is extremely useful if the user has denied the permission for the first time, you can prompt a warning pop-up after detecting a disabled permission using checkCapability() method. The following code snippet shows you how to check camera permission. The rectangle will turn green if the device has access to use the camera.
color : AppFramework.checkCapability(AppFramework.Camera) ? "green" : "red"
2. New isAppInstalled() method
Have you ever try to open an app from your app and wondered if the other app is available?
Starting from AppStudio 3.1, you can use the isAppInstalled() method to check if an app is installed on your device. The input parameter is a URI Scheme (e.g. app-urlscheme://) on iOS or a Package Name (e.g com.app.package.name) on Android.
Note: This method is currently only implemented on iOS and Android. On all other platforms, this method returns true regardless.
3. AppFramework.systeminformation property enhancements
AppFramework.systeminformation now returns three new parameters, “family”, “manufacture”, and “model”, to determine if a device is a phone or a tablet, which vendor creates your device, and the model of your device. You can find how to use this property in the Screen and System Info sample, which is available in AppStudio Desktop and Player.
Screen and System Info Sample App
Secure Storage Enhancements
When using Secure Storage component, previously the maximum value and key size were 214 characters on all platforms even though some platforms would allow you to store more. We have introduced two new properties to the SecureStorage component - maximumKeyLength and maximumValueLength allow you to determine the limit on the length of the key and value. With these newly introduced properties, your apps can now take full advantage of a device’s limits. In addition, secure storage is now supported on the Universal Windows Platform (UWP).
Secure Storage Sample App
Sharing enhancement on iOS
The Clipboard.share() method opens a sharing dialog, allowing you to share data across apps. We have added a new option to open a URL link in Safari through this sharing dialog on iOS.
Share Sheet Sample App
We hope you appreciate and use all the new beta features added in AppFramework in your own apps. Please try them out and provide any suggestions or feedback before we finalize in the next releases. Also, let us know if you are looking for any new feature that might help every AppStudio user create app faster, better, and with ease.
Become an AppStudio for ArcGIS developer! Watch this video on how to sign up for a free trial.
Follow us on twitter @AppStudioArcGIS to keep up to date with the latest information and do not forget to let us know about your latest creations using AppStudio and be featured on the AppStudio Showcase.