Skip navigation
All Places > AppStudio for ArcGIS > Blog

AppStudio Player for ArcGIS is a great testing tool, it lets you instantly view AppStudio apps on a real device without requiring a full build and deployment cycle. But did you know that you can also use Player to distribute apps into your organization? And the source code of Player is available as an enterprise template in AppStudio Desktop. You can easily customize Player by configuring properties in the App Settings tool, or by editing the source code. Over the past releases, we have exposed more configuration options, such as the ability to change portal URL, branding color, and Font file, hiding certain pages, and more to help you rebrand Player easier and faster without writing any code.

 

 

Why distribute apps using Player? 

Getting your app prepared for app stores is not a trivial process, with numerous steps and prerequisites involved. On top of that, it takes time for your app to be approved, and the app approval process can be a little tricky because of restrictive submission policies and need to keep updated with the latest store review guidelines and design criteria. However, if you don’t intend to make an app publicly available, and they will only be used by members of your organization, you can use AppStudio Player as your own “enterprise app store”.  Just as you can share maps and data stored in your ArcGIS Organization (ArcGIS Online or Enterprise) with others, you can also share apps built with AppStudio.  The end user can simply log in to AppStudio Player, download and use the app on their device.  This is a safe and efficient solution for distributing apps without publishing to app stores, and it gives the app developer control of how the app is distributed.

 

As was mentioned early the source code for AppStudio Player is included with AppStudio as an Enterprise Templates, this means you can create your own version of Player to distribute in your organization.  There are many reasons you might want to customize player; somewhat an app that includes their own branding (colors, logos, etc.), you may want to remove some of the default feature and tools, and others might go as far as adding completely new functionality through code.

 

Here are some key points we want you to remember:

  • It’s easy to customize Player
  • Support for ArcGIS Online and Enterprise
  • Simple process to install a customized Player over-the-air through a hyperlink
  • Utilize Groups to share apps with organization members
  • Any ArcGIS User Types with essential app bundle can log into Player
  • Includes support for iOS, Android, Windows, MacOS and Linux platforms

 

 

The goal of this tutorial

In this blog, we are going to configure the Player for the City of Cilantro with the following changes:

  • Changing app icon and title
  • Changing branding colors
  • Changing onboarding images and messages
  • Hiding the Skip button on the onboarding page
  • Hiding the Samples page
  • Hiding Capabilities, Devices, and Licensing sections in the App Details page
  • Hiding Scan QR code, Diagnostics, and Remote Console options in the side menu
  • Hiding the Dark Mode option in the App Settings tool

 

The final app will look like the images below.

 

Time: 15 minutes

 

Note: An AppStudio Standard License is required for this tutorial. If you don't have one, please follow this video to register a trial account. 

      

How to configure AppStudio Player?

 

Step 0. Downloading AppStudio Desktop and attached resources folder

 

Step 1. Creating a new app using the Player enterprise template

  • Open AppStudio Desktop
  • Click on the “New App” button
  • Go to the Enterprise tab
  • Double click on the Player (3.3 Template) thumbnail to create a new Player enterprise template app
  • Click on the Edit Title icon on the side panel to rename the app to “The City of Cilantro"

                   

 

Step 2. Registering your application

To allow users to sign in to your app with OAuth 2.0 (a standardized authorization framework), you will need to register your app to generate an ArcGIS Client ID (or App ID). To do this:

 

  • Select your app and click on the Upload button to upload your app to ArcGIS Online or ArcGIS Enterprise
  • Click on the Settings tool on the side panel
  • Click on the Licensing from the left-hand side navigation menu
  • Click on the Register button and Apply button

                         

 

Step 3. Configuring Player Enterprise Template

 

  1. Select the app you have created from Step 1, then click on the Settings tool.
  2. Click on the Resources from the left-hand side navigation menu and change the App Icon into the Icon - City of Cilantro.png from the attached resources folder.                                                                                                                                         
  3. Click on the Advanced from the left-hand side navigation menu and add “Cilantro” in the Short Name field.                             
  4. Click on the Properties from the left-hand side navigation menu, and then Enterprise tab.
  5. If you have a portal, you can add your own portal URL and name in the Portal URL and Portal name You can skip this step if you don’t have a portal                                                                                                                                                    
  6. Go to the Onboarding tab and turn off the Show Skip button. Select the onboarding_Cilantro.png image from the attached resources folder as the Onboarding image one and enter “The City of Cilantro” into the Onboarding messages one field. Provide your own images and messages for the rest onboarding pages.                                                                               
  7. Go to the General tab, enter the hex code of the brand color #f15a24. Turn off Show Sample Page and Show Capabilities, Devices, and Licensing sections.
  8. Go to Side Menu, turn off all the properties and enter a preferred email into the Feedback.                                                         
  9. Click on the Apply button and run the app to see if your customized Player recognizes your settings.

Note: Please do not download and test your configured Player in AppStudio Player. If you wish to test on a mobile device, use the Make to create app installation files. This requires an Apple Developer account if you are going to create a build for iOS.

Step 4 Editing Player’s source code

 

If you wish to customize Player further, you can edit the source code of the Player by clicking on the Edit icon in the side panel to open the Qt Creator IDE. Then expand the MyPlayer folder on the left-hand panel to open the structure of the Player app. You can navigate to the desired files and modify the source code. 

   

 

We hope you find this blog helpful. We want to hear from you and continue to improve Player’s configuration experience to make it as easy as possible. Don't hesitate to email your feedback to appstudiofeedback@esri.com

 

 

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 on the latest information and let us know about your creations built using AppStudio to be featured in the AppStudio Showcase.

 

The AppStudio team periodically hosts workshops and webinars; please click on this link to leave your email if you are interested in information regarding AppStudio events.

1. Mary had a little lamb

 

AppStudio 3.3 is based on Qt5.12.1 which includes a new JavaScript engine supporting ECMAScript 6 and ECMAScript 7. In this blog we will be looking at multiline string literals, specifically, different ways of realizing the following nursery rhyme:

 

Mary had a little lamb, little lamb, little lamb
Mary had a little lamb
Whose fleece was white as snow.

 

2. The 1 liner example

 

var str = "Mary had a little lamb, little lamb, little lamb\nMary had a little lamb\nWhose fleece was white as snow.\n"

 

The above code gives us what we want. A 3 line rhyme stored in a string. It's short, but, it is hard to read and maintain. The newline \n character makes reading the first word in the following sentence awkward.

 

3. String lists

 

var list = [ "Mary had a little lamb, little lamb, little lamb",
             "Mary had a little lamb",
             "Whose fleece was white as snow." ]
var str = list.join("\n") + "\n"

 

Using a staging list means we don't need to remember to put \n to break every line. It's looks nicer in code and easier to maintain the rhyme since we can now split the code over multiple lines. It does suffer from the fact that we need to ensure the syntax of lists is correct (i.e. the commas needed to be correctly placed). It has the advantage that we can make use of array functions such as appending to the end of the list. The joining line does look awkward but it's always the same pattern so you'll get used to it. Because we are using join, we must remember to append the last \n.

 

4. Using the files

 

var str = app.folder.readTextFile("rhyme.txt")

 

By storing strings in files, we can dramatically reduce the code that appears in your program. This reduces error significantly, and, maintenance on your rhyme can be done in a regular text edit without worrying about the Javascript side of things.

 

5. ECMAScript 6 multiline string

 

var str = `Mary had a little lamb, little lamb, little lamb
Mary had a little lamb
Whose fleece was white as snow.
`

As of AppStudio 3.3 (and Qt 5.12.x) we can now use backticks ` to surround a multiline string element. This is incredibly easy to read and maintain. Backticks also introduces a new feature called expression interpolation. Here's a simple example involving our poem:

 

var name = 'Mary';
var str = `${name} had a little lamb, little lamb, little lamb
${name} had a little lamb
Whose fleece was white as snow.
`

 

Here's a more extended form which includes operators:

 

var customer = { name: "Foo" }
var card = { amount: 7, product: "Bar", unitprice: 42 }
var str = `Hello ${customer.name},
want to buy
${card.amount} ${card.product} for
a total of
${card.amount * card.unitprice} bucks?`

 

References

 

 

Send us your feedback to appstudiofeedback@esri.com

 

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 on the latest information and let us know about your creations built using AppStudio to be featured in the AppStudio Showcase.

 

The AppStudio team periodically hosts workshops and webinars; please click on this link to leave your email if you are interested in information regarding AppStudio events.

We are pleased to announce the release of AppStudio for ArcGIS version 3.3. This release includes many exciting new features and enhancements to help you write apps faster and easier than ever. Please click on this link to learn what's new.  

 

Bug Fixes and Enhancements

 

 

Salesforce ID
Synopsis
BUG-000089678
AppStudio for ArcGIS app is German yet Map Tour Templates are in English
BUG-000092273
Title for Make tool is not localized (AppStudio)
BUG-000092436
MOR_I18N: "Sign In" string is not correctly centered / truncated on some languages
BUG-000117083
In AppStudio for ArcGIS Desktop, when the app auto-signs in using Enterprise logins while accessing a secured service, the Map Viewer template returns the error "Client_id not specified".
BUG-000119230
Android build fails in AppStudio for ArcGIS (Desktop Edition) when a valid Java KeyStore (JKS) is supplied with Cloud Make.
BUG-000120353
AppStudio for ArcGIS Map Viewer applications fails to load secured maps using Portal for ArcGIS.
ENH-000089904
AppStudio for ArcGIS app is German yet Map Viewer Templates are in English
ENH-000089905
AppStudio for ArcGIS app is German yet Quick Report Templates are in English
ENH-000096403
Enable the ability in AppStudio for ArcGIS app to access and use the GPS while the screen is locked or if another app is currently enabled in the app stack on the device.
ENH-000118292
Unable to add more than one feature layer in AppStudio Quick Report template

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. We are excited to share new features and enhancements added to AppStudio 3.3 beta release with you in this blog post.

 

Support for AppConfig and Enterprise Mobile Management (EMM)

We have included a new AppFramework.Management plugin to support Enterprise Mobile Management (EMM), which allows you to manage and secure your apps and data across mobile devices. Please check this blog post for more information.

 

Browser View Component Enhancements:

We have introduced BrowserView component in the previous release, which brings you a full Safari web browser experience for iOS devices, we have been continuing working on BrowserView to support Chrome web browser experience for Android. Besides, you can customize the native browser view (Safari and Chrome) by changing the background and controls color with newly introduced primaryColor and forgroundColor properties in the BrowserView component. The following code snippet demonstrates how to define the BrowserView component and invoke a browser view.

 

 

import ArcGIS.AppFramework.WebView 1.0

Button {
   anchors.centerIn: parent
   text: qsTr("Open BrowserView")
   onClicked: {
   browserView.show()
     }
  }

BrowserView {
  id: browserView
  anchors.fill: parent
  primaryColor:"#8f499c"
  foregroundColor: "#f7d4f4"
  url: "https://www.esri.com/en-us/arcgis/products/appstudio-for-arcgis"
   }

  

Browser View Sample

Browser View Sample is available on AppStudio Desktop and AppStudio Player. To find this sample in AppStudio Desktop, first, launch AppStudio Desktop > click on the New App button > click on Search icon > type Browser View. You can also find the Browser View sample in the AppStudio Player, launch Player on your mobile device > go to Samples page > search for Browser View. 

                

                                                  Browser View Sample (available on AppStudio Desktop and Player)

 

Support for changing status bar color and theme 

We have introduced a new StatusBar component in ArcGIS.AppFramework.Platform plugin, which provides you access to manage the appearance of the status bar such as changing status bar color and theme color. In addition, we have also created a new AppLayout component, which can handle various heights of the status bar across devices especially devices with a notch. It should be used along with the StatusBar component.  You will need to set your App object as the contents of the delegate property within an AppLayout object. The sample code below demonstrates how to use AppLayout component.

 

import ArcGIS.AppFramework.Platform 1.0
AppLayout {
    width: 480
    height: 640
    delegate: App {
        id: app
           ...
    }
}

 

Note: Status bars are not displayed by default on these devices; it first has to be enabled by setting the property display.statusBar to true in the app's appinfo.json

 

                           

                                                    Status bar sample (available on AppStudio Desktop and Player)

 

 

DocumentDialog component enhancements

DocumentDialog component was introduced from the last release, it allows access your device's native document picker and returns a selected file path. With AppStudio 3.3 beta, we have improved the DocumentDialog preference by adding restrictions while selecting files only available on the device's local storage. 

 

Note: You will need to declare your app needs storage permission for Android when using DocumentDialog to access external resources and information. AppFramework provides a FileFolder component, which can invoke storage permission dialog. For example, you can include the following code into your app.

 

// Show storage permission pop-up on Android 
FileFolder {
        id: fileFolder
        path: AppFramework.userHomePath    }
 
    Component.onCompleted: {
        fileFolder.makeFolder()
    }

 

Also, please don’t forget to enable external storage capability in the AppStudio Desktop > Settings first.

DocumentDialog Sample 

We have implemented the Document Dialog feature into an existing "Edit Feature Attachments" sample app. When you try to add a new attachment, a native document picker will open, which is invoked by the DocumentDialog from AppFramework Platform plugin.

 

                             

                                               Edit Feature Attachment sample (available on AppStudio Desktop and Player)

 

                                                       

 

AppFramework.checkCapability enhancements

AppFramework.checkCapability() now supports BackgroundLocation as a capability to determine whether it is enabled in runtime.

 

You can try above new features and enhancements from AppFramework with AppStudio Desktop and Player version 3.3 beta, AppStudio Desktop 3.3 beta is available at Early Adopter Community and AppStudio Player 3.3 beta is available at Apple's TestFlight and Android Beta Program.

 

The API References of above new features and enhancements are available at Qt Creator help documentation included with the AppStudio Desktop 3.3 (Beta) install.      

 

We hope you enjoy all the new features and enhancements added to the AppFramework. For bugs or other issues, you may find, please submit a bug report or join the beta forum to provide feedback. You can also send us an email to appstudiofeedback@esri.com.

 

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 on the latest information and let us know about your creations built using AppStudio to be featured in the AppStudio Showcase.

 

The AppStudio team periodically hosts workshops and webinars; please click on this link to leave your email if you are interested in information regarding AppStudio events.

Managing the safety and security of mobile devices, apps and data in your enterprise network is now more important than ever. With AppStudio 3.3 Beta we have added support for managed app configuration, also known as AppConfig, when managing and deploying your apps through your Enterprise Mobility Management solution.

  

What are EMMs and MDMs?

Enterprise Mobility Management (EMM) is a set of people, processes and technology focused on securely and efficiently managing systems and devices (desktop, server, and mobile). This includes setting policies, pre-configuring settings, applying restrictions, deploying apps, and setting profiles and assignment policies to deliver apps to your managed devices. The management of mobile devices is one of the many components available as part of an EMM solution.

  

There are a number of Mobile Device Management (MDM) solutions that can help you implement your EMM solution for managing your enterprise mobile devices, and these MDM solutions include support for what is known as Mobile Application Management (MAM). Here are just a few of the available MDM solutions that many of the Esri apps have already been tested and deployed with: VMware AirwatchMicrosoft Intune, MobileIron Cloud, Samsung Knox, Citrix XenMobile, IBM MaaS360, Cisco Meraki.

  

What is managed app configuration?

Managed app configuration allows apps to be remotely configured through an EMM solution. In order to use managed app configuration, the app must be installed on the device and managed via an MDM solution. While managed app configuration is a feature supported by most of the popular MDM providers, it's best to check with your provider if this feature is supported.
  
In general, MDM providers support AppConfig using key-value pairs. In AppStudio we are following the guidelines found within the AppConfig community's xml standard specification for iOS, Windows, MacOS and Linux. On Android, we support Android's Restriction Manager xml spec.
  
Note: Currently, managed app configuration in AppStudio is only supported on iOS and Android platforms.
  
Adding managed app configuration settings in your MDM

Below is an example of how to set the key-value pairs when creating an assignment, from within the VMware AirWatch MDM console:

  

  

How to read the managed app configuration settings in an AppStudio app

In AppStudio 3.3 beta we have added a new plugin called AppFramework.Management which needs to be imported for your apps to read the settings provided by the MDM. This plugin contains a ManagedAppConfiguration singleton component that provides access to policyDefaults, which are the default key-value pairs the app honors and policySettings which is the list of configured key-value pairs the MDM provides.

  

Defaults

In order to specify the defaults that your app supports, you can use the following new appinfo properties:
  
"management": {
        "android": {
            "restrictionFile": "restrictions.xml"
        },
        "configurationSchema": "specfile.xml"
    },
  
Settings
To make reading policy defaults and settings easier, we have also provided two new helper methods: value and defaultValue. They work by fetching either the default value of the app or the settings value that the MDM has provided with the given key.
  
For instance, this is how your AppStudio app would read the portalUrl and portalName keys specified by the MDM in the above example:
  
Connections {
        target: ManagedAppConfiguration
        onPolicySettingsChanged : {
            portalName.text = ManagedAppConfiguration.value("portalName", false, "ArcGIS");
            portalUrl.text = ManagedAppConfiguration.value("portalUrl", false, "www.arcgis.com");
        }
        onPolicyDefaultsChanged : {
            defaultPortalName.text = ManagedAppConfiguration.defaultValue("portalName");
            defaultPortalUrl.text = ManagedAppConfiguration.defaultValue("portalUrl"); 
        }
    }
Note: AppStudio for ArcGIS 3.3 beta downloads are available through the Early Adopter Community.  
Using the sample app
A new sample app called "Managed App Config" which demonstrates all of the above configurations is now available for you to try. You can find this sample app in the latest AppStudio Desktop edition:
  
1.   Launch AppStudio Desktop
2.   Select New App
3.   Select the Search Icon
4.   Type: Managed App Config
5.   Select the "Managed App Config" sample
  
                                                                         Managed App Config sample app 
  
Please try out this new feature with your favorite MDM provider and give us your feedback by leaving your comments below or email us at appstudiofeedback@esri.com.
  
To find out more about Esri’s ongoing efforts to support our customers implementing EMM solutions, you may also be interested in reading about Mobile Application Management and Esri’s Field Apps. Additionally, for more information about Esri's approach to Mobile Application Management, please read our ArcGIS Secure Mobile Implementation Patterns on the ArcGIS Trust website.

Templates downloaded from AppStudio desktop have been updated to work with the AppStudio 3.3 beta. The AppStudio website will be updated when version 3.3 goes final. These updates include:

 

  •       Quick Report supports multiple feature layers
  •       All templates now supports Qt 5.12
  •       Support for Hindi language for all templates
  •       Bug fixes and minor UI improvements

  

Quick Report

 

  • Quick Report now supports multiple feature layers (configurable with AppStudio Desktop only) from a single feature service in the template. This has been one of the top enhancement requests over the past year. When configuring multiple feature layers, you can now have a mix and match of different geometry types. For example, you can configure one or more point feature layers, polyline and/or polygon feature layers in the same app while allowing end users to collect desired field data across different layers or geometries on the fly.

 

      How to configure multiple feature layers? -  First, you need to configure multiple feature layer IDs in the        AppStudio desktop template app Settings. E.g. in the wildfire feature service (currently the default feature service for       the template) if you want to include all three layers, you need to add the Layer IDs as “0,1,2” in the AppStudio       Desktop > Settings > Form > Layer IDs of the feature service field (see screenshot below). 

 

 

 

      When you run the app, you will see a new Report Galley page (see screenshot below), which includes the                      configured feature layer options in it. You are allowed to add as many layer IDs as you want as long as they are       hosted under the same feature  service. This will work with both secured and public feature services.

 

 

  • Known issues – If you experience crash right after submitting the report in your existing Quick report application based on version 3.2 template or before, please update your app using the Quick Report 3.3 template code. 

 

Map Viewer

 

  • Bug fixes and enhancements
  • Known issues – If you experience crash when accessing web maps in your existing Map Viewer application within the latest AppStudio 3.3 Desktop or Player, please update your app using the Map Viewer 3.3 template code. As this issue has been fixed.

 

Map Tour

 

  • Number of bug fixes and small improvements have been made under the hood.

 

 

Please feel free to test and provide your feedback through the GeoNet or emailing the team at appstudiofeedback@esri.com.

 

 

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 on the latest information and let us know about your creations built using AppStudio to be featured in the AppStudio Showcase.

 

The AppStudio team periodically host workshops and webinars; please click on this link to leave your email if you are interested in information regarding AppStudio events.

We are excited to announce the beta release of AppStudio for ArcGIS 3.3.  Downloads are available through the Early Adopter Community.  We encourage you to participate in the beta program to try out new features, enhancements, and report bugs.  Your feedback is greatly appreciated, as it helps us improve AppStudio and deliver a stable and high-performance product for everyone. 

 

Highlights of this beta release include:

 

Upgraded Xcode to 10.1

The Apple App Store has announced that all new apps and app updates submitted to the App Store will need to be built with Xcode 10 or above starting from March 2019. We are aware of this change and have upgraded our build environment to Xcode 10.1 in this beta release to make sure you can continue to upload your app to the Apple App Store successfully.  

 

Support for building Android 64-bit apps

The Android NDK has also been upgraded from version 10 to 18, to support building Android 64-bit (ARMv8) apps. This will not only bring better performance to your app by taking advantage of the ARMv8 architecture but also helps you prepare for the future requirement to provide 64-bit versions to the Google Play Store starting August 2019  Currently, you can build an Android 64-bit app using the AppStudio Desktop Make tool, and we will support this on the AppStudio website in the final 3.3 release.

 

Upgraded Qt to version 5.12

The underlying Qt framework has been upgraded to version 5.12.0, which allows you to take advantage of new features, enhancements, and bug fixes added to Qt 5.12.0

 

Support for App Configuration and Enterprise Mobile Management (EMM)

This has been one of the most popular requested features, and we are excited to release a new AppFramework.Management plugin to support Enterprise Mobile Management (EMM) software to read and overwrite certain provided default settings for iOS and Android devices, this allows you to manage and secure your apps and data across mobile devices. We will share more information about managed app configuration support in coming blogs.

 

AppStudio for ArcGIS Extension for Visual Studio Code 

You can now try the AppStudio for ArcGIS extension for Visual Studio Code as an alternative for using Qt Creator. AppStudio Desktop is still used to create new apps, but you can edit, upload and run your AppStudio apps from within Visual Studio Code. To learn more see this documentation on the Early Adopter Community.

 

Other New Features and Enhancements:

  • Browser View support for Chrome experience on Android devices.
  • checkCapability() now supports checking whether the background location capability is enabled.
  • iOS minimum supported version has been changed from iOS 10 to iOS 11.
  • Better experience to Register Client ID when the App is not yet uploaded.

 

Note: API references of new features and enhancements are available at Qt Creator Help documentation included with the AppStudio Desktop 3.3 (Beta) install.    

 

Deprecations

The ArcGIS.AppFramework.Controls and ArcGIS.AppFramework.Promises modules are in the process of being deprecated. We advise that you discontinue using these plugins and begin to remove them from your existing AppStudio apps. You can use JavaScript Promises to replace ArcGIS.AppFramework.Promises.    

 

A more comprehensive list of new features and enhancements can be found in the Early Adopter community website

 

Getting Started

The beta program is open to anyone – join the Early Adopter Community today to get access to the latest versions of AppStudio 3.3 beta.

 

  • AppStudio Desktop - You can download the beta version of AppStudio Desktop 3.3 here.
  • AppStudio Player (iOS) - AppStudio Player is available via Apple's TestFlight. Please click on this link to download AppStudio Player 3.3 (Beta).
  • AppStudio Player (Android) - AppStudio Player is available via Android Beta Program. Please go to this link to download.

You are now all set to start testing the AppStudio 3.3 Beta!

 

Feedback

Your feedback is greatly appreciated and will help us to improve the final release of AppStudio for ArcGIS 3.3. For bugs or other issues, you may find, please submit a bug report or join the beta forum to provide feedback. You can also send us an email to appstudiofeedback@esri.com.

 

The final release is scheduled for April.  We want to thank everyone who contributes to AppStudio for ArcGIS 3.3 in advance and we wish you happy testing!

 

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 on the latest information and let us know about your creations built using AppStudio to be featured in the AppStudio Showcase.

 

The AppStudio team periodically hosts workshops and webinars; please click on this link to leave your email if you are interested in information regarding AppStudio events.

We are excited to announce that AppStudio for ArcGIS version 3.2 is now available to download! This release rolls out many exciting new features, as well as improvements to help drive your overall development productivity. Read this ArcGIS Blog to learn what’s new in AppStudio 3.2.  

 

Bug Fixes:

 

 BUG-000103663

 The AppStudio Player wizard installer has inconsistencies in the translation to German 

 ENH-000116806

 Request to clarify the document "License AppStudio Standard"

 BUG-000118306

 When clicking the Landing Page button at appstudio.arcgis.com, an error is thrown: "Unable to complete operation"

 ENH-000089681

 Overlapping translated text

 BUG-000089485

 Finished download window contains a white square (AppStudio)

 BUG-000089467

 Tooltip missing

 BUG-000091419

 Localization: AppStudio Player About page not localized

 BUG-000099446

 The following error, "Fatal Error C1060: Compiler is out of heap space" occurs when using the Cloud Make tool for Windows   (x64).

 BUG-000092191

 Upload tooltip is not localized (AppStudio)

 BUG-000092175

 AppStudio UI: unlocalized button

 BUG-000087207

 MOR_I18N: AppPlayer - Search and Download strings contain incorrect character "%1"

 BUG-000087203

 MOR_I18N_STR: Show/Hide Details buttons are not translated

 BUG-000087200

 MOR_I18N_STR: App download prompt is not translated

 BUG-000087227

 MOR_I18N_STR: AppStudio Player: Untranslated dialogs when downloading App

 BUG-000089397

 Unable to install AppStudio for ArcGIS when the installation path contains '\con'. Error: The installation path must not contain   '\con', please specify a valid folder.

 BUG-000087467

 Add support for Enterprise SSO to AppStudio for ArcGIS app with ArcGIS Online or Portal Single Sign On

 BUG-000087285

 AppStudio for ArcGIS Player - iOS: "No matches for <search item>" string is not localized

 BUG-000105156

 Hyperlink for 'tel' and 'mailto' in Story Map Tour does not work in AppStudio for ArcGIS.

 BUG-000103575

 An ArcGIS Online named user is required to access AppStudio for ArcGIS downloads. This may prevent users from getting   AppStudio for ArcGIS in organizations only utilizing Portal for ArcGIS.

 BUG-000103386

 The Cancel button is not translated in the AppStudio for ArcGIS app.

 BUG-000106457

 The overview of the application in AppStudio for ArcGIS is not translated to German on a German operating system.

 BUG-000115064

 The Quick Report template in AppStudio for ArcGIS (Desktop Edition) is unable to add video attachments in Android devices.

 BUG-000111490

 The default values of the coded domain in the hosted features service is not submitted using Quick Reporter template of the   AppStudio Dev Edition Desktop Version 2.1.19

 ENH-000107824

 Customer would like to make us aware that AppStudio application DLLs do not support several security mechanisms.

 BUG-000101164

 MOR_LOC_ALL: Untranslated "Content" tab in Settings of AppStudio for ArcGIS Desktop.

 BUG-000101055

 MOR_LOC_HE: Incorrectly placed parenthesis bracket in AppStudio Make tool of AppStudio for ArcGIS Desktop on Hebrew   Mac OSX.

The goal of AppStudio is to bring native app creation tools to all ArcGIS users. As you know AppStudio provides productivity tools for building, testing, and distributing apps that can be used by both developer and non-developers...and everyone in-between.  If you peel back the technical layers of the AppStudio stack you will find various components such as the Qt SDK, Android SDK, Apple Xcode and ArcGIS Runtime that enable things like cross platform development and geospatial mapping tools.  These components are development projects in themselves, each with release timelines and feature updates. This blog post is to update you on some the current state of AppStudio versions and upcoming important dates and dependencies for different platforms.

 

AppStudio for ArcGIS 2.1 Deprecation and ArcGIS Runtime 10.2.6 Retirement

The ArcGIS Runtime is the core mapping component that gives AppStudio access to various mapping and geospatial capabilities. The initial 1.0 release of AppStudio was built on earlier 10.2.x version of the ArcGIS Runtime, and at AppStudio 2.0 we included support for both the 10.2.x Runtime as well as introduced the new 100.x Runtime.  In April of 2018 AppStudio 3.0 was released and the 10.2.x Runtime was removed completely form the AppStudio product.

The 10.2.6 ver of ArcGIS Runtime for Qt that was included in AppStudio 2.1 is now in Mature Support. This means that it will no longer receive updates, patches, or platform testing and certification.

AppStudio for ArcGIS 2.1 has been in Mature Support since April 2018 and will be retired starting April 1 2019.

Because of the support status of ArcGIS Runtime 10.2.x and issues with submitting to app stores (see the next sections), AppStudio 2.1 is being deprecated and it is recommended that users move any current development projects to a newer version of AppStudio. The apps you have already created and/or published to the app stores will continue to work, but your ability to support and enhance these apps will be limited (see next section about Android and iOS support). The AppStudio 2.1 Desktop download has already been removed from our website, if you require access to download AppStudio Desktop 2.1 for app maintenance purpose please reach out to the AppStudio team directly at appstudio@esri.com.

 

Android API Level 26 Requirement for the Google Play Store

At the beginning of November 2018 any Android app submitted to the Google Play Store (new app or update to existing app) needs to be built to target the Android API Level 26 (Android 8.0) or higher.  The AppStudio Cloud Make servers have been upgraded to support API Level 26 Android builds if you are using AppStudio Desktop 3.0 or higher.  If you have apps built with AppStudio 2.1 earlier you will not be able to submit an apps (new or update) to the Google Play Store.

Xcode 9 / iOS 11 SDK Requirement for the Apple App Store

The Apple App Store currently requires that all new apps and updates are built with Xcode 9 (iOS 11 SDK). AppStudio 2.1 and the ArcGIS Runtime 10.2.6 are use an older verion of Xcdoe and thus are not capable of creating iOS binaries (IPA files) that meet the App Store requirement.

 

April 2019 Xcode 10.1 / iOS 12 SKD Requirement for the Apple App Store

When you request an iOS build using the AppStudio Cloud Make service your AppStudio app is compiled using Apple’s Xcode tools to create a binary (ipa) file suitable for distribution.  In March 2019 Apple Inc will require that all apps (new and updates) submitted to the Apple App Store are compiled using a XCode 10.1.  This timing of the requirement is problematic because support for XCode 10 in the Qt SDK is a recent addition and the ArcGIS Runtime for Qt is still working on support for this version of the Qt SDK.  What does this mean for the AppStudio Developers? Starting in March of 2019 you will not be able to submit AppStudio app to the Apple App Store using any version of AppStudio, including the released 3.2 version of AppStudio.  We will release a beta version of AppStudio 3.3 in the beginning of March that supports Xcode 10 so you can develop and test your apps in preparation of the final release. In April we will release AppStudio 3.3 with support for Xcode 10.1 and providing a way for you to submit apps to the Apple App Store on a released version of AppStudio.  We are providing this information so you can plan accordingly with any iOS releases that may be scheduled for March or April 2019.  If you have questions or concerns about the timeline for iOS / Xcode 10.1 support, please contact the AppStudio Team appstudio@esri.com.

 

 

Ref links

https://support.esri.com/en/Products/Developers/native-runtime-sdks/arcgis-runtime-sdk-for-qt/10-2-6#product-support

 

https://support.esri.com/en/Products/Apps/app-builders/AppStudio-for-ArcGIS/3-1#product-support

 

https://android-developers.googleblog.com/2017/12/improving-app-security-and-performance.html

 

https://developer.apple.com/news/?id=05072018a

 

https://developer.apple.com/news/?id=09122018c

Introduction

 

I have some strings in my database. I would like to query them. Also, I want the results quick. Simple, use SQL LIKE and put an index on it.

 

Oh wait, that's weird, it didn't work like how I want... this blog covers the common traps with searching text strings in SQLite.

 

Scenario

 

Let's look at a sample database table. This one is representing property parcels and their very famous owners.

 

CREATE TABLE parcel
(
  owner TEXT
);

INSERT INTO parcel (owner) values ('Bill Gates');
INSERT INTO parcel (owner) values ('Steve Jobs');
INSERT INTO parcel (owner) values ('Jack Dangermond');
INSERT INTO parcel (owner) values ('Steve Wozniak');
INSERT INTO parcel (owner) values ('Tim Cook');
INSERT INTO parcel (owner) values ('Mark Zuckerberg');

 

We will be running queries on the above data, similar to:

 

SELECT * FROM parcel;

 

and, at the same time, we will be studying the query's execution plan with something similar to:

 

EXPLAIN QUERY PLAN SELECT * FROM parcel;

 

Using and optimizing LIKE

 

Once you dabble in a bit of SQL you'll quickly realize that you need to use LIKE for your string searches. For example, if we want to find all owners with names beginning with the letter J we do this:

 

SELECT *
FROM parcel
WHERE owner LIKE 'j%';
-- EXPLAIN QUERY PLAN: SCAN TABLE parcel
-- OUTPUT: {"owner":"Jack Dangermond"}

 

Here, we observe that it found the right result, i.e. Jack Dangermond, however, the query needed to do a full table scan (i.e. SCAN TABLE parcel) to find that this was the only result.

 

Let's attempt to speed this up with an index and try again:

 

CREATE INDEX ix_parcel_owner ON parcel (owner);
SELECT *
FROM parcel
WHERE owner LIKE 'j%'
-- EXPLAIN QUERY PLAN: SCAN TABLE parcel
-- OUTPUT: {"owner":"Jack Dangermond"}

 

Well, we got the right result, i.e. Jack Dangermond, but, why is it still doing a full table scan (SCAN TABLE parcel)?

 

Why didn't it use my index ix_parcel_owner?

 

The answer is SQLite, unlike other databases, implements LIKE as a case insensitive search so we got Jack Dangermond which begins with a capital J even though our search pattern was "j%" which begins with a lowercase J. The index that we created was a case sensitive index. LIKE ignored the index because it needed a case insensitive index.

 

To fix this, we try again. We create an index specific for case insensitive searches.

 

CREATE INDEX ix_parcel_owner_collate ON parcel (owner COLLATE NOCASE);
SELECT *
FROM   parcel
WHERE  owner LIKE 'j%';
-- EXPLAIN QUERY PLAN: SEARCH TABLE parcel USING COVERING INDEX ix_parcel_owner_collate (owner>? AND owner<?)
-- OUTPUT: {"owner":"Jack Dangermond"}

 

There, we did it. The result is still Jack Dangermond, this time the index was used (SEARCH TABLE parcel USING COVERING INDEX ix_parcel_owner_collate). Take home message, COLLATE NOCASE is your friend.

 

Alternatives to LIKE for string contains searches

 

Now that we've got some success with LIKE, let's use it to find more things. Let's see if we can find all owners with the letter C anywhere in their name:

 

SELECT *
FROM parcel
WHERE owner LIKE '%c%';
-- EXPLAIN QUERY PLAN: SCAN TABLE parcel
-- OUTPUT: {"owner":"Jack Dangermond"}
-- OUTPUT: {"owner":"Tim Cook"}
-- OUTPUT: {"owner":"Mark Zuckerberg"}

 

Okay, we got the results we wanted. Jack Dangermond, Tim Cook and Mark Zuckerberg all have the letter C is their names. However, why are we back at full table scans (SCAN TABLE parcel)? Why isn't the index (ix_parcel_owner_collate) being used any more? That's because the B-Tree index being used works like how you look up names in a phone book. It works great if you have the starting letter(s) (i.e. divide the book in half, choose the half your letter is in, divide the book in half again).

 

However, because we don't have a starting letter, we can no longer use the phone book trick. We're back scanning every record in the table. The index we created is useless for this type of query.

 

So, what can we do? Well, there's a technique you can use but it requires rewriting the query, have a look at the following:

 

SELECT *, INSTR(LOWER(owner), LOWER('c')) idx
FROM parcel;
-- EXPLAIN QUERY PLAN: SCAN TABLE parcel
-- OUTPUT: {"idx":0,"owner":"Bill Gates"}
-- OUTPUT: {"idx":0,"owner":"Steve Jobs"}
-- OUTPUT: {"idx":3,"owner":"Jack Dangermond"}
-- OUTPUT: {"idx":0,"owner":"Steve Wozniak"}
-- OUTPUT: {"idx":5,"owner":"Tim Cook"}
-- OUTPUT: {"idx":8,"owner":"Mark Zuckerberg"}

SELECT *
FROM parcel
WHERE INSTR(LOWER(owner), LOWER('c')) > 0;
-- EXPLAIN QUERY PLAN: SCAN TABLE parcel
-- OUTPUT: {"owner":"Jack Dangermond"}
-- OUTPUT: {"owner":"Tim Cook"}
-- OUTPUT: {"owner":"Mark Zuckerberg"}

 

What is happening is we're using a function INSTR which returns the position of a substring (i.e. the letter C) in a string (i.e. owner). If the substring doesn't exist, you will simply get 0. We use the LOWER function on both the letter C and the owner to make it a case insensitive search.

 

The result is still the same as the previous version involving LIKE, i.e. we are getting all owners with the letter C in their names. However, the query plan is still doing a full table scan (SCAN TABLE parcel).

 

So, what's the point?

 

Well, SQLite allows you to index expressions! Think of it like a pre-calculated column.

 

CREATE INDEX ix_parcel_owner_instr_c ON parcel (INSTR(LOWER(owner), LOWER('c')));

 

The above statement will create an index. It may take some time. For example, if you had over 200000 records, that index may take several seconds to create. Consider that to be a good thing. Time spent here means the INSTR expression is being calculated for all records in the database once and only once. Every time we add a new record or modify an existing record, it will be the only time when that INSTR expression is calculated / recalculated.

 

That expression will never be recalculated at the time of the query. The query would just reuse the pre-calculated value that was stored in the index:

 

 

SELECT *
FROM parcel
WHERE INSTR(LOWER(owner), LOWER('c')) > 0;
-- EXPLAIN QUERY PLAN: SEARCH TABLE parcel USING INDEX ix_parcel_owner_instr_c (<expr>>?)
-- OUTPUT: {"owner":"Jack Dangermond"}
-- OUTPUT: {"owner":"Tim Cook"}
-- OUTPUT: {"owner":"Mark Zuckerberg"}

 

The above confirms we are now using the index (SEARCH TABLE parcel USING INDEX ix_parcel_owner_instr_c).

 

Code Sample

 

This AppStudio code sample was used to generate all the SQL content in this blog:

 

import QtQuick 2.7
import QtQuick.Controls 2.1
import ArcGIS.AppFramework 1.0
import ArcGIS.AppFramework.Sql 1.0

App {
    id: app
    width: 800 * AppFramework.displayScaleFactor
    height: 640 * AppFramework.displayScaleFactor

    property string logText: ""

    Flickable {
        id: flickable

        anchors.fill: parent
        anchors.margins: 10

        contentWidth: textArea.width
        contentHeight: textArea.height
        clip: true

        TextArea {
            id: textArea

            width: flickable.width
            wrapMode: Text.WrapAtWordBoundaryOrAnywhere
            selectByMouse: true
            text: logText
        }
    }

    SqlDatabase {
        id: db
        databaseName: ":memory:"
    }

    Component.onCompleted: {
        db.open();
        exec( [
            "CREATE TABLE parcel",
            "(",
            "    owner TEXT",
            ");"
            ].join("\n") );
        exec("INSERT INTO parcel (owner) values ('Bill Gates');");
        exec("INSERT INTO parcel (owner) values ('Steve Jobs');");
        exec("INSERT INTO parcel (owner) values ('Jack Dangermond');");
        exec("INSERT INTO parcel (owner) values ('Steve Wozniak');");
        exec("INSERT INTO parcel (owner) values ('Tim Cook');");
        exec("INSERT INTO parcel (owner) values ('Mark Zuckerberg');");
        exec( [
            "SELECT *",
            "FROM parcel",
            "WHERE owner LIKE 'j%';"
            ].join("\n") );
        exec("CREATE INDEX ix_parcel_owner ON parcel (owner);");
        exec( [
            "SELECT *",
            "FROM parcel",
            "WHERE owner LIKE 'j%';"
            ].join("\n") );
        exec("CREATE INDEX ix_parcel_owner_collate ON parcel (owner COLLATE NOCASE);");
        exec( [
            "SELECT *",
            "FROM parcel",
            "WHERE owner LIKE 'j%';"
            ].join("\n") );
        exec( [
            "SELECT *",
            "FROM parcel",
            "WHERE owner LIKE '%c%';"
            ].join("\n") );
        exec( [
            "SELECT *, INSTR(LOWER(owner), LOWER('c')) idx",
            "FROM parcel;",
            ].join("\n") );
        exec( [
            "SELECT *",
            "FROM parcel",
            "WHERE INSTR(LOWER(owner), LOWER('c')) > 0;"
            ].join("\n") );
        exec("CREATE INDEX ix_parcel_owner_instr_c ON parcel (INSTR(LOWER(owner), LOWER('c')));");
        exec( [
            "SELECT *",
            "FROM parcel",
            "WHERE INSTR(LOWER(owner), LOWER('c')) > 0;"
            ].join("\n") );
    }

    function exec(sql) {
        logText += "\n";
        logText += sql + "\n";

        var explain = db.query("EXPLAIN QUERY PLAN " + sql);
        if (!explain.error && explain.first()) {
            logText += "-- EXPLAIN QUERY PLAN: %1\n".arg(explain.values.detail);
            explain.finish();
        }

        var query = db.query(sql);
        if (query.error) {
            logText += query.error.databaseText;
            logText += query.error.driverText;
            logText += qsTr("NativeErrorCode: %1").arg(query.error.nativeErrorCode);
            logText += qsTr("ErrorType: %1").arg(query.error.type);
            return;
        }

        var ok = query.first();
        while (ok) {
            logText += "-- OUTPUT: %1\n".arg(JSON.stringify(query.values));
            ok = query.next();
        }
        query.finish();
    }
}

 

 

Summary

 

If speed matters to you, you cannot just create an index and just leave it there.

 

You need to check whether your queries use the index with EXPLAIN QUERY PLAN. If your index isn't being used, look at your query. Look at your WHERE clause. Think of what is happening there. Rewrite your WHERE clause if necessary. Create indexes that matches your WHERE clause.

 

If necessary, be prepared to index on expressions. Don't go overboard, we didn't create an index for every letter of the alphabet. That wasn't in our requirements today. We only wanted to search for the letter C and do that better. Over time, requirements changes. We probably will become disinterested in search for the letter C, then, feel free to drop that index. However, if a new criteria becomes more important, e.g. we want to search for all owners with Jack in the first, middle or last name, then, we will create an index to help with that purpose.

Building native apps using AppStudio for ArcGIS allows you to integrate all sorts of cool hardware with your app. The hardest part is knowing how to communicate with the hardware, and what to do with the information that you can get from (or send to) it. The following intends to be an overview of the three B's - Bluetooth, Bluetooth LE and beacons, which may help you decide which of these you might need to learn more about, to solve your hardware communication requirements.

 

Bluetooth

 

In AppStudio 3.0, we introduced support for classic Bluetooth connectivity. The most common use of classic Bluetooth for many years has been by GNSS vendors to connect their receivers to devices. You can also communicate with other sensors using Bluetooth, such as laser rangefinders and environmental sensors. The GNSS Info sample in AppStudio demonstrates how you can connect to a device with Bluetooth. To learn more about this sample see this blog.

 

Bluetooth LE

 

In AppStudio 3.1, we added beta support for Bluetooth low energy (LE). A subset of Bluetooth, as the name suggests, Bluetooth LE uses less power and is ideal for more frequent transmission of smaller amounts of data. Code samples of these are a little harder for us to offer you, as typically the devices that transmit data via Bluetooth LE, do so with proprietary information. The most prolific Bluetooth LE devices in the community are fitness devices. To use your Garmin or Fitbit device you need to connect to a proprietary app to see the information: for example, steps, distance, and calories burned. You will be able to use AppStudio's Bluetooth LE components to detect Bluetooth LE devices, but typically you wont be able to interpret the data that is transmitted. Here is a sample that demonstrates connecting to a fitness device. You may not be able to use this exactly, but it shows how to get started. Once a known device is found: a known service, characteristic and descriptor is also detected by the sample.

 

Services, characteristics and descriptors are how devices package information that they want to share via Bluetooth LE. For more information (including a diagram of how these are related) see the BluetoothLEDevice page in our API Reference. Note:  We are working to add more description and samples here!

 

One of our friends, GPS-IT, have already used AppStudio's Bluetooth LE support to create an app that communicates with their very own hardware! Their platemeter device is used to measure pasture volumes and the accompanying iOS and Android apps built with AppStudio, receive the measurement values from the hardware via Bluetooth LE.

 

Beacons

 

In coming releases of AppStudio we will be adding specific support for beacons. You can consider beacons as a subset of Bluetooth LE devices. They use the same LE protocol, but make identifier information more readily available, suitable for create alerts and triggers when interacting with the beacons.

 

And because this is not complex enough, when reading about beacons, you will see two terms: iBeacon and Eddystone. In short, these are the Apple (iBeacon) and Google (Eddystone) ways of communicating with beacons, but they don't limit which device you use to communicate with the beacon. One is not necessarily better than the other, they are just different. In AppStudio we've made progress with iBeacon properties first, and will share more about our beacon support in coming blogs and releases.

 

You might be thinking: why beacons? The most common beacon use case is that of an interactive shop or gallery. Imagine entering a museum, and when you buy your ticket you are directed to launch the museum tour guide app. In the foyer area the app will show you general info about the museum. As you enter a gallery space, information about the room and the collection you are about to see, is shown (or dictated) to you. As you approach an individual object, information about that specific object is shown to you. This guided navigation can be achieved using beacons located near each object, or entrance to a space.  This is a great way for keeping propriety information on site. The user can only see or interact with the information, whilst they at your venue. Retailers also use a similar pattern to engage with a customer: as you approach an item or location in the store, targeted advertising or specials can be shared with the user.

 

Summary

 

Knowing whether to use Bluetooth or Bluetooth LE is very much dependent on the hardware you want to integrate with your app, and the hardware itself may restrict what type or amount of information you can receive from (or send to) it. We are keen to hear what Bluetooth hardware you have or would like to integrate with your AppStudio app, and look forward to expanding more on these concepts in more blogs and in our AppStudio help.

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
EmailComposer {
id: emailcomposer
to: "example@example.com"
cc: ["example2@example.com", "example3@example.com"]
bcc: "example4@example.com"
subject: "Feedback for " + app.info.title
body:
"Device OS:" + Qt.platform.os + AppFramework.osVersion + "<p>" +
"Device Locale:" + Qt.locale().name + "<p>" +
"App Version:" + app.info.version + "<p>" +
"AppStudio Version:" + AppFramework.version
html: true
}

Button {
id: openEmailButton
text: qsTr("Generate Email")
onClicked: {
emailcomposer.show()
}
}

 

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
Button {
text: "Open BrowserView"
onClicked: {
browserView.show()
}
}

BrowserView {
id: browserView
anchors.fill: parent
url: "https://appstudio.arcgis.com/"
}

 

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. 

Property:

url: url  

The URL of the web page that you wish to load 

Method

show ()  

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. 

 

Rectangle {
width: 25
height: width
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.

Sorry, the AppStudio for ArcGIS workshop (Nov 28-29, 2018) registration is closed. If you wish to stay updated with AppStudio for ArcGIS upcoming workshops, news, and resources, please click on this link to leave your email. 

 

The AppStudio for ArcGIS team will be holding a 2-day workshop on November 28-29, 2018. This hands-on workshop will give attendees the knowledge and skills they need to quickly start building cross-platform native apps with AppStudio.


Who should attend? Esri users who are interested in building cross-platform apps using AppStudio for ArcGIS.

 

Agenda:

 

Day 1: We will introduce AppStudio for ArcGIS, its components/features, and why they’re important. You will learn to build consumer-friendly mobile apps with the AppStudio for ArcGIS templates, plus learn about AppStudio Desktop, Player, and the Cloud Make service. The day will conclude with an introduction to QML and JavaScript, the language used to create custom apps with AppStudio.

 

Day 2: Technical deep-dive into understanding AppStudio stack, building custom applications, the architecture of AppStudio and its components, e.g., ArcGIS Runtime, AppFramework, reusable components. Also, you will be exposed to user interface Material Design concepts, advanced samples, and tips and tricks to write cool apps.

 

It is recommended that you bring your own laptop (Mac or Windows) for development and a smartphone or tablet (iOS or Android) to test your apps. HTML/JavaScript or hybrid app development experience, and light reading on QML (qmlbook.org) is helpful, but not required.

 

To sum it up:


What: AppStudio 2-day Workshop
Where: Esri Campus (380 New York St, Redlands, CA 92373) or Online
When: Wednesday, Nov. 28th - Thursday, Nov. 29th
Cost: FREE

 

Registration:


Only 10 seats left! Please click this link and complete the registration form.

 

If you have any questions about the workshop, please leave a comment below.  

Kale is not food!


Kale, apparently has many health benefits such as being high in fiber and water. However, me, personally, I find it on par on eating paper and I refuse to even accept that kale is proper food!

 

Kale rant aside, this blog post is really about coding patterns for writing conditionals in an AppStudio (QML) app.

 

"Kate is not food!" app

 

I've come up with a simple app that demonstrate the conditional coding pattern.

 

It has a combo box with the values "apple", "carrot" or "kale" where. Upon a user's selection, the app will respond with the corresponding food type: "fruit", "vegetable" or "unknown" respectively.

 

To implement the above app, there are many methods I've come across, thus, I take a comparative approach covering the most common to the most peculiar.

 

Each approach has a complete working code sample and discussed.

 

Approach 1 - if statement

import QtQuick 2.7
import QtQuick.Controls 2.1
import ArcGIS.AppFramework 1.0

App {
id: app

property alias food: foodComboBox.currentText
property string foodType: getFoodType(food)

Column {
anchors.fill: parent
anchors.margins: 10
spacing: 10


ComboBox {
id: foodComboBox
model: [ "apple", "carrot", "kale" ]
}

Text {
text: foodType
}
}

function getFoodType(food) {
if (food === "apple") {
return "fruit";
}
if (food === "carrot") {
return "vegetable";
}
return "unknown";
}
}

 

The above is a complete code sample that determines a type of food given a user's input.

 

We see there are two visual components, ComboBox component for the user to select "apple", "carrot" or "kale" and a Text component to display the corresponding food type "fruit", "vegetable" or "unknown" respectively.

 

The visual component is constant in all the apps shown in the blog. The only thing that differs is the implementation of the foodType property.

 

In this example, it is implemented with the if statement via the getFoodType function.

 

It's very obvious, very easy to read and maintain.


I'm usually against the if statement pattern:

  • Tends to invite over application of else and else if
  • Tends to force additional code block indentation
  • Tends to lead to unintended code paths
  • Requires repeated applications of the if statement to describe your business logic


I've carefully crafted the answer to not utilize any else statements. When using if statements, I prefer to implement early exit with return statement following the guard pattern removing one level of nesting for flatter code and helps avoids errors. See Guard (computer science) - Wikipedia 


When there are 3 or more cases if statements can become cumbersome to read and maintain. Terse cases may require a refactor moving code to their own functions.

 

Approach 2 - conditional expressions

 

import QtQuick 2.7
import QtQuick.Controls 2.1
import ArcGIS.AppFramework 1.0

App {
id: app

property alias food: foodComboBox.currentText
property string foodType: food === "apple" ? "fruit" : food === "carrot" ? "vegetable" : "unknown"

Column {
anchors.fill: parent
anchors.margins: 10
spacing: 10

ComboBox {
id: foodComboBox
model: [ "apple", "carrot", "kale" ]
}

Text {
text: foodType
}
}
}

 

The conditional (ternary) operator is very short and deceptively simple. It is often used in 1-liner solutions.

 

I tend to use conditional for very simplest of cases.

 

As your application complexity grows, the conditional expression rapidly becomes hard to read and maintain. They tend to obfuscate what you're trying to achieve.

 

When there are 3 or more cases, it quickly loses its appeal as a 1-liner solution.

 

 

Approach 3 - switch statements

 

import QtQuick 2.7
import QtQuick.Controls 2.1
import ArcGIS.AppFramework 1.0

App {
id: app

property alias food: foodComboBox.currentText
property string foodType: getFoodType(food)

Column {
anchors.fill: parent
anchors.margins: 10
spacing: 10

ComboBox {
id: foodComboBox
model: [ "apple", "carrot", "kale" ]
}

Text {
text: foodType
}
}

function getFoodType(food) {
switch (food) {
case "apple":
return "fruit";
case "carrot":
return "vegetable";
}
return "unknown";
}
}


The switch statement is designed to handle multiple cases. If the values for each case is concise, then, this approach works well.

 

In my apps, I find, however, as my requirement grows, the switch statement becomes longer and longer and they it ends up as code that's longer than one screenful. When that happens, we lose the conciseness of this approach. In order to get back down to something that's manageable we refactor the cases by moving the code for each cases to their own function.

 

 

Approach 4 - lookup table

 

import QtQuick 2.7
import QtQuick.Controls 2.1
import ArcGIS.AppFramework 1.0

App {
id: app

property alias food: foodComboBox.currentText
property var foodTypes: {
"apple": "fruit",
"carrot": "vegetable"
}
property string foodType: foodTypes[food] || "unknown"

Column {
anchors.fill: parent
anchors.margins: 10
spacing: 10

ComboBox {
id: foodComboBox
model: [ "apple", "carrot", "kale" ]
}

Text {
text: foodType
}
}
}

 

This approach implements a lookup table. We leverage a Javascript object's ability to hold key value pairs. The advantages to this approach is the code is declarative with minimal imperative code.

 

I used this approach when managing large list of keys whose values are simple and defined. We simply hard code the list at the top of the app, and/or deployed the list via JSON object resource that gets loaded when the app starts.

 

This is approach is easy to read and maintain. We have a limitation that the key to the lookup table must be a string.

 

Approach 5 - invoking function by name

 

import QtQuick 2.7
import QtQuick.Controls 2.1
import ArcGIS.AppFramework 1.0

App {
id: app

property alias food: foodComboBox.currentText
property string foodType: getFoodType(food)

Column {
anchors.fill: parent
anchors.margins: 10
spacing: 10

ComboBox {
id: foodComboBox
model: [ "apple", "carrot", "kale" ]
}

Text {
text: foodType
}
}

function getFoodType_apple() {
return "fruit";
}

function getFoodType_carrot() {
return "vegetable";
}

function getFoodType(food) {
var func = "getFoodType_" + food;
return func in app ? app[func]() : "unknown";
}
}


This approach uses the fact that we can invoke a Javascript function by name. It also requires us to use the name of the parent object (here it is called app). We have to construct the function name, and, if it exists we invoke that function.

 

I used this approach in app where the requirements were changing. I was building a conversion app. The requirements were changing, i.e. the list of inputs (e.g. the list of foods) will grow over time. This pattern was useful as it allowed me to focus on handling new cases as they occur.

 

property var bool use_merriam_webster: true

function getFoodType_tomato()
{
// A tomato is actually a fruit -- but it's a vegetable at the same time
// https://www.businessinsider.com.au/tomato-fruit-or-vegetable-2018-5?r=US&IR=T
if (use_merriam_webster) {
return "fruit";
}
return "vegetable";
}

 

Despite being the driver function being hard to read, it has advantage that it doesn't require maintenance to add new cases. We simply start coding the new cases and they will automatically be picked up.

 

Summary

 

For the "Kale is not food" app all 5 approaches shown above achieve the task and one may argue that there isn't much differences between them in achieving that task.

 

For more complex applications, some of the more obscure approaches such as lookup table or invocation by function name may become more appealing in long term ability to maintain and scale.

 

Generally, whenever I see code involving either the if or switch statement, I ask myself would it be worthwhile to check to see if another approach works better?. Usually, I find: yes, it is.

AppStudio for ArcGIS Desktop Edition provides feature-rich development tools to allow you to further configure templates, edit source code, test, distribute, and build your custom mobile or desktop apps easily and quickly. We are excited to share some of the new features and enhancements that are added to this release with you.
Upgrade ArcGIS Runtime to version 100.3
The ArcGIS Runtime API powers the mapping capabilities of AppStudio apps. With this release, we’ve upgraded ArcGIS Runtime libraries to version 100.3, which means all of the new features, enhancements, and bug fixes added to ArcGIS Runtime 100.3 are available in AppStudio 3.1, such as displaying web scenes from ArcGIS  or ArcGIS Enterprise and enhancements to scene analysis and Web Mapping Services (WMS).  
Upgrade Qt Framework to version 5.11.1 
Behind the scenes, the underlying Qt framework has been upgraded from 5.10.0 to 5.11.1, which enables you to take advantage of new functionalities, enhancements, and critical bug fixes received in Qt 5.11 and 5.11.1
Enhancements to UI
We have made a few small UI tweaks to AppStudio Desktop in this release, such as a New App button moving down to the main gallery area, and the header and side panel border width increasing. These UI updates were based on Esri’s Calcite style standard and were made to keep visual consistency across Esri’s products.  
              
                                                                                AppStudio Desktop UI
AppStudio Desktop’s Settings tool has also received a UI/UX revamp.  It's now easier than ever to use the Settings tool to navigate and find all the options and settings organized into sections.  Also as part of the redesign, the previous contents of the Advanced Settings dialog are now integrated into the Licensing, Platforms & Advanced sections.
    AppStudio Desktop Settings Tool Dialog
                                                                AppStudio Desktop Settings Tool Dialog
Enhancements to Make tool  
The Google Play Store recently changed requirements for new apps, which must target at least Android 8.0 (API level 26) to publish. AppStudio, as a cross-platform development tool, is always aware of store submission requirements for all platforms and has been taking care of this for you. We’ve updated our cloud Make servers to target Android API level 26 by default for Android apps in this release. Please check out this blog post for more details.    
 
New UI to specify app’s short name 
Your app’s title that appears under the icon on the Home screen of iOS and Android devices can now be specified, with newly introduced UI in the Settings tool’s Advanced section. This can be used to avoid a longer app title being truncated.
 
                                          AppStudio Desktop > Settings Tool > Advanced Dialog
New UI to enable background external accessories for iOS devices 
AppStudio 3.0 added support for the high accuracy GPS receivers, and introduced support for a new property, capabilities.ios.backgroundExternalAccessory, in the appinfo.json file. In this release, we have added a corresponding UI in the Settings tool Platform > iOS settings to easily help you enable or disable external accessories running in the background.    
  
                                               AppStudio Desktop > Settings Tool > Platforms > iOS Dialog
New UI to configure Windows rendering engine 
AppStudio 3.1 now supports OpenGL and ANGLE for Windows.  While adding support for two different graphics rendering engines, we’ve also introduced a new UI in the Settings tool > Platform > Windows section to allow you to choose your desired graphics rendering engine. 
 
                                AppStudio Desktop > Settings Tool > Platforms > Windows Dialog
New samples 
 We have included new samples to show newly introduced components and plugins to AppSudio AppFramework: Email Composer, Cryptographic Hash, and Browser View.  
    
                                                        Email Composer sample running in AppStudio Player
Other enhancements: 
•        New languages added: Hungarian (hu) and Catalan (ca)
•        The minimum Android version has been updated from 16 to 19
•        Gradle is now used instead of Ant for building Android apps 
•        Improved background location capture performance for Android
Bug Fixes: 

     BUG-000087200

App download prompt in AppStudio is now getting translated

     BUG-000099446

Cloud Make failing with error "Fatal Error C1060: Compiler is out of heap space" on Windows (x64) when submitting built request for a large app has been fixed.

     BUG-000101054

Misaligned strings in AppMake Summary window of AppStudio for ArcGIS Desktop on Hebrew in Mac OSX has been fixed.

     BUG-000101055

Incorrectly placed parenthesis bracket in AppStudio Make tool of AppStudio for ArcGIS Desktop on Hebrew in Mac OSX has been fixed.

     BUG-000101164

"Content" tab in Settings of AppStudio for ArcGIS Desktop now gets translated.

     BUG-000101600

Security vulnerabilities with custom URL schemes in an iOS app developed with AppStudio for ArcGIS have been resolved.

     BUG-000101979

Security vulnerability regarding system information leak with an Android application built with AppStudio for ArcGIS has been resolved.

     BUG-000103384

The 'Hide Details' and 'Show Details' buttons are now getting translated in  AppStudio for ArcGIS installer.

     BUG-000103386

The Cancel button is now getting translated in the AppStudio for ArcGIS app.

     BUG-000106457

The overview of the application in AppStudio for ArcGIS is now getting translated to German on a German operating system.

 

You can download the latest AppStudio Desktop from our website and we hope you enjoy the new features and enhancements added in this release!
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 latest information and do not forget to let us know about your latest creations using AppStudio and be featured on the AppStudio Showcase.