ArcGIS Maps SDKs Native Blog - Page 6

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Latest Activity

(213 Posts)
EricBader
Honored Contributor

You can use an Android x86 emulator for testing your applications in Qt Creator. This particular emulator has a much faster start-up time than the Android ARM emulators, which in turn speeds up your time spent on testing. However, setting up your development environment for this can be tricky! Here are some  steps that we hope will help you get started.

First of all, we highly recommend that you use Qt 5.9.0+, as this provides support for "host GPU". Prior versions of Qt should work also, but you'd have to disable host GPU support, which slows up the process, so much so that the emulator becomes simply unusable.

Install the Android SDK x86 bits

First, make sure the proper Android SDK API level is installed by running the Android SDK Manager, and be sure to install the x86 packages. The Intel x86 Atom System Image , for example, seems to work well. 

Install Intel® Hardware Accelerated Execution Manager (Intel® HAXM)

Intel® Hardware Accelerated Execution Manager (Intel® HAXM) is a hardware-assisted virtualization engine (hypervisor) that uses Intel® Virtualization Technology (Intel® VT) to speed up Android* app emulation on a host machine. Note that HAXM is only supported on machines with Intel® processors.

You can download it from here: https://software.intel.com/en-us/android/articles/intel-hardware-accelerated-execution-manager/. Or, you can install it using the Android SDK manager: 

Then, access the HAXM dmg installer from your Android SDK install:<path_to_android_sdk>/android-sdk-macosx/extras/intel/Hardware_Accelerated_Execution_Manager

Set up the Android x86 emulator device

Start the AVD Manager. You can also launch AVD Manager from Qt Creator's Android device settings: 

Create a new device. For the Target, select Android 6.0 - API Level 23 , for example. Make sure CPU/ABI is selected as Intel Atom (x86). At the bottom of the form check, the Use Host GPU box. Then click OK to create the device.

Here is an example:

 

You should now see your Android Virtual Device added in the AVD Manager. Start the device by selecting it in the list and clicking Start.... This should launch the emulator that you created. If you receive errors about HAXM, then repeat the step above about installing HAXM.

You're all set!

Now you can create an Android x86 template project, choose Android x86 in the project configuration, and hit the Play button to deploy and launch the app on the Android emulator device that was just created. If you don't see the Android device in the list of devices from Qt Creator, then a configuration step must have been missed.

Enjoy!

Sincerely,

The ArcGIS Runtime SDK for Qt Development Team

more
1 0 4,492
EricBader
Honored Contributor

We wanted to share with you some important information regarding a Qt Framework 5.8 networking issue that affects performance retrieving data over the network, such as ArcGIS Runtime raster tile layers from a service. You can avoid this problem by using another version of the Qt Framework.

A description of this issue is available on the Qt Company's website at https://bugreports.qt.io/browse/QTBUG-58608. The issue is titled QNetworkManager get() repetitive request stuck for many msecs.

One way this issue manifests itself is through slow draw performance of raster tile layers (commonly called tiled layers) from an online service. When the problem occurs, you will see something like what is shown in the images below. The images below show the C++ Change Viewpoint sample as the viewpoint drop-down is changed to Geometry or Animation.

This issue is not specific to this sample. The examples shown above are extreme, but all network data retrieval performance will be affected to some degree.

This network performance issue did not appear prior to Qt Framework version 5.8. Preliminary testing with 5.9 Beta indicate that the problem should be fixed in Qt Framework version 5.9.

Sincerely,

The ArcGIS Runtime SDK for Qt Development Team

more
0 2 974
EricBader
Honored Contributor

We are happy to announce that ArcGIS Runtime Local Server SDK 100.0.1 for Windows and Linux is now available. You can log in and download them from developers.arcgis.com today!

 

As we first announced last November when ArcGIS Runtime SDK 100.0 for Qt was released, Local Server, which at 10.x was part of the entire Runtime SDK, is now an optional installation component of the ArcGIS Runtime. We only released the Windows version at that time as part of ArcGIS Runtime SDK 100.0. This new release now introduces the Linux version of Local Server, and adds some bug fixes for Windows as well. That is why you'll notice the version number 100.0.1 is the same for both. Learn more about the powerful analytic capabilities that are found in the Local Server at this release.

 

In addition to providing the same capabilities as in the previous release, Local Server provides additional tools supported at the Standard, Advanced and Analysis levels, opening up new workflows for data management, analytical, and runtime content packaging. For a complete listing of supported tools, please refer to the Local Server geoprocessing tools support topic.

We invite you to give it a run and give us feedback.

Have fun out there! 

Native App Developers

more
1 0 1,368
LucasDanzinger
Esri Frequent Contributor

Up until now, Qt ArcGIS Runtime developers could follow one of two paradigms - either write their apps in all C++ with Qt Widgets or all QML with Qt Quick. One of the new and exciting things about our newest release of ArcGIS Runtime 100.0 is that we now support a third paradigm - writing your frontend in QML and your backend in C++ using the Qt Quick framework. This is a great opportunity for C++ developers to embrace a more modern approach to the Qt framework, and to start leveraging some of the advantages that QML brings to the table as a UI language. Some of the main benefits you will see with using Qt Quick is that:

  • You can easily seperate your business logic (C++) from your declarative UI (QML)
  • This is supported on nearly every platform. When using the Qt Quick framework, our C++ API is now supported on all the same platforms as our QML API.
  • QML supports touch interactions
  • QML scales well between different platforms and form factors
  • QML supports fluid animations and other similar features expected in modern user interfaces

If you'd like to get started using this new paradigm, there are 3 main concepts to understand: registering C++ classes as QML types, creating C++ methods that can be called from QML, and creating QML properties.

Registering C++ classes as QML types:

In order to access a C++ class in QML, you must register it as a QML type. For example, one of the most common things you will want to do as an ArcGIS Runtime developer is declare a MapView in QML, but write the business logic for the MapView in C++. To do this, you will register the MapQuickView (a version of the MapView that inherits from QQuickItem) as a QML type somewhere in the main.cpp with the following syntax:

qmlRegisterType<MapQuickView>("Esri.Samples", 1, 0, "MapView");

In this case, replace "Esri.Samples" with whatever you would like your namespace to be called, replace 1 and 0 with the major and minor version of your application, and optionally replace "MapView" with whatever you want to call the type in QML. Once you have done this, you can declare a MapView in QML by importing your new namespace, and declaring a MapView:

import Esri.Samples 1.0‍‍

MapView {
    anchors.fill: parent
    objectName: "mapView"
}‍‍‍‍‍‍‍‍‍‍

In this case, we gave the MapView an object name so that we could obtain it from the C++ side, and then add a Map into the MapView in C++.

// find QML MapView component
m_mapView = findChild<MapQuickView*>("mapView");

// create a new basemap instance
Basemap* basemap = Basemap::imageryWithLabels(this);
// create a new map instance
m_map = new Map(basemap, this);
// set map on the map view
m_mapView->setMap(m_map);‍‍‍‍‍‍‍‍‍

This full workflow can be found in the Display a Map sample. You would use the same workflow to create a 3D scene, and a similar workflow for any other QObject* type that you want to expose from C++ to QML. This is only a very basic example. More information on how this all works, along with additional parameters and workflows can be found in Qt's Documentation.

Invoking C++ methods from QML

Once you have your C++ classes exposed as QML types, the next logical step is to be able to call a method on that class from the QML side. For example, you may have a QML Slider control that you want to rotate the MapView whenever the Slider is moved. To do this, you simply need to add the Q_INVOKABLE macro to any of your method declarations that you want to be able to be called from QML:

Q_INVOKABLE void setMapViewRotation(double degrees);

Then, from QML, you would call the method with the following syntax:

Slider {
    onPressedChanged: {
        // Call C++ invokable function to change the rotation of the map view
        mapRotationSample.setMapViewRotation(value);
    }
}‍‍‍‍‍‍

This full workflow can be found in the Map Rotation sample. The section entitled "Exposing Methods (Including Qt Slots)" in this Qt documentation explains this in further detail.

Creating bindable QML properties

Once you begin using QML, you begin to realize that the true power in QML is not in calling functions whenever some signal emits, but rather in using property binding so that things are updated automatically without any imperative code needing to be written at all. This is true declarative code, and is the way QML was intended to be used. For example, if you are signing into your organizations portal, and you want to obtain several things about the user's login information to display on the screen, such as username, thumbnail, and email, you don't want to call a getter from the QML side every time. Instead, you want to simply create a property that you can bind onto, and whenever that property changes, all UI elements will automatically update with the new information.

To do this, you must follow several steps. First, you must declare your property in the C++ header file with the Q_PROPERTY macro. This macro requires you give it a name, a type, a getter, an optional setter, and a signal. For example:

Q_PROPERTY(QString username READ username NOTIFY usernameChanged)

In this example, QString is the type, "username" is the name referenced from QML, "username" is the getter in C++, and "usernameChanged" is the signal.  Next, you need to set up your declaration for the getter and signal:

private:
  QString username() const;

signals:
  void usernameChanged();‍‍‍‍‍

The C++ implementation would look something like this:

QString PortalUserInfo::username() const
{
  if (m_user)
    return m_user->username();

  return "UNKNOWN";
}‍‍‍‍‍‍‍

Whenever this value changes, you must emit the signal, which will trigger the Q_PROPERTY to update any other object that has bound to it:

void PortalUserInfo::onPortalLoadStatusChanged(LoadStatus loadStatus)
{
  if (loadStatus == LoadStatus::Loaded)
  {
    m_user = m_portal->portalUser();
    emit usernameChanged(); // this will trigger all elements to update with the new value
  }
}‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍

 

Finally, bind to the Q_PROPERTY in QML:

Text {
    text: username
}‍‍‍

This full workflow can be found in the PortalUserInfo sample. Further details and options for specifying bindable properties with QML can be found in the Qt documentation.

These are the basic things you will need to understand to get started with using the Qt Quick framework with C++ and QML. All of our samples on GitHub use this new paradigm, so I highly encourage you to check these out to get some ideas on how everything works. We also have a new template that is integrated into Qt Creator that will get you started with building Qt Quick C++/QML applications.

more
3 1 2,983
EricBader
Honored Contributor

By now, you probably heard the great news about ArcGIS Runtime SDK v100.0. The commercial offering released yesterday, and we here at Esri are very excited and grateful. Excited that such a revolutionary vision has been realized for Runtime developers, and at the same time extremely grateful to you, our users. You've partnered with us to bring this all about, Now, let's go forth and build! We are looking forward to your success.

I want to point out some of the Qt-specific items from this release that you'll be able to go to market with. Not only do you have even more capabilities such as 3D visualization, vector tiled basemap support, enriched error handling in the API, additional GP tools for Local Server, and all the rest, but you have more deployment and design options for your applications:

  • Support for writing C++ apps that can target all platforms, including macOS, iOS and Android. In our 10.2.x offerings, this was only possible for Windows and Linux. We are committed to providing as many developer options for Qt developers as possible!
  • Support for separating your QML and C++ business logic. Enabling support for this design pattern frees up the Qt developer to adopt best-design practices while writing great GIS apps!
  • Local Server is now an optional, separate install. If it's something you don't need, you don't have to get it!

There are too many capabilities to describe in this short post, so go check it out for yourself. You’ll be surprised by how much you can achieve with v100 of ArcGIS Runtime for Qt.

So, get the latest: ArcGIS Runtime SDK for Qt | ArcGIS for Developers. Experience the updated developers guide and give us feedback. If you're wondering if this is the right time to migrate to v100.0. we hope you'll find this guide useful in helping you decide.

Thanks!

The ArcGIS Runtime SDK for Qt Team

more
3 2 1,202
EricBader
Honored Contributor

Today we've released "Patch 2" for ArcGIS Runtime SDK 10.2.6 for Qt. This patch addresses the following stability and security issues with ArcGIS Runtime SDK 10.2.6:

  • An API libpng dependency fix to address security vulnerabilities, which allows ArcGIS Android apps that are published to the Google Play store to be updated and any new published apps to comply with Google Play's Malicious Behavior policy. You can read more about this vulnerability in CVE-2015-8540.
  • A fix for BUG-000096913: Edits from mobile geodatabases that contain empty geometry fail to synchronize.
  • A fix for QML apps built with Qt 5.6.0 running on iOS 8.4 devices. These apps were crashing.

Go here for more information and instructions for downloading the patch.

ArcGIS Runtime SDK for Qt Development Team

arcgis runtime sdk for qt‌

more
0 0 1,147
LucasDanzinger
Esri Frequent Contributor

Starting with Android 6 (marshmallow), Google has moved away from OpenSSL to their own SSL implementation called BoringSSL. This affects all Qt developers targeting Android 6 and later, as libssl.so and libcrypto.so are no longer available from Android, causing https requests to fail in Qt applications. The solution suggested at this time by The Qt Company is to compile these libraries and package them in the APK with the ANDROID_EXTRA_LIBS qmake variable. For example, you could build the two libraries from OpenSSL, copy them into your Android kit’s lib folder, and then add the following line to your project's *.pro file:


android {
    ANDROID_LIBS = $$dirname(QMAKE_QMAKE)/../lib
    
    ANDROID_EXTRA_LIBS += \
        $$ANDROID_LIBS/libssl.so \
        $$ANDROID_LIBS/libcrypto.so
} 

This suggestion is applicable to any Qt developer targeting Android 6, whether using ArcGIS Runtime for Qt or not. Therefore, if you are using ArcGIS Runtime SDK for Qt, this suggestion is applicable whether you are using 10.2.5, 10.2.6, or Quartz (which is currently in beta). See the Qt documentation for further details on how to build OpenSSL and integrate the binaries into your project. In addition, licensing requirements for OpenSSL can be reviewed at https://www.openssl.org/docs/faq.html#LEGAL1  and https://www.openssl.org/source/license.html.

more
0 3 3,224
LucasDanzinger
Esri Frequent Contributor


We have discussed the relationship of QML with JavaScript in previous blogs, and are seeing more and more Esri web developers build native apps with the QML and Qt framework. Many of these developers have given us feedback about how much they enjoy Qt and QML, and have stated that the transition from building HTML5/JS based web apps to QML/JS based native apps was very smooth. One of the common question we get asked by JS devs interested in QML is if QML supports JavaScript promises. While this pattern is not directly built into QML, it is easily doable with a QML library called QuickPromise, which is available project on GitHub.

For those of you not familiar with JavaScript Promises, the patterns and specification are explained in great detail here. The important thing to know is that it is a very productive way to work with asynchronous methods, and can be especially helpful when you are running several async methods concurrently, and you want some action to occur once all of those async methods are complete. A great example in the case of ArcGIS Runtime is when you are wanting to take your data offline. Imagine that you have an app that does editing in an online and offline mode. Initially, your data is online, and your user can edit directly against the service. You also have a button to take the data offline, in which case all of your feature services will generate geodatabases, and your tiled service will export all of the tiles into a local tile package. When your user presses the button, you want to display a screen that indicates the download is in progress, and you don't want that screen to go away until all of the asynchronous operations are complete. Also, once everything is complete, you want to remove the online layers from your map, and add in the offline layers. How would you accomplish this? There may be several ways to do this, but one great way to do this is with promises in QML (QuickPromise).

Screen Shot 2016-07-05 at 1.52.50 PM.png

I set out to try the above scenario to see if I could come up with a clean way of doing this with the QuickPromise library. Here were the steps I took:

  • I first installed the Quartz beta release of the ArcGIS Runtime SDK for Qt, and I cloned the Qt Sample repo on GitHub. I then combined the GenerateGeodatabase and ExportTiles samples into one project, so that I had an app that would both take a feature service and a tiled map service offline.
  • Next I cloned the QuickPromise repo, and followed the installation instructions in the project's readme. It was really as simple as cloning the project, including the pri file in my project, and adding an import path to the app engine, as explained in the read me.
  • Finally, I imported the QuickPromise plugin in my QML file, and I created a Promise. I set the Promise's resolveWhen property to list a list of signals (each signal emits when one of the offline tasks completes). Finally, I created a signal handler for the fulfilled signal- this signal will emit once all of the promises are resolved. In this case, I want to update the download screen once all of the promises are resolved, and I also want to switch out my online layers to my offline layers.

Screen Shot 2016-07-05 at 1.48.35 PM.png

This worked wonderfully, and was very simple to setup and use. I found that this particular usage of QuickPromise worked wonderfully for the declarative type QML workflow. Beyond this, there are several other ways you can use QuickPromise, both declaratively, and in imperative JavaScript code. Many of the alternative functions fit more into the traditional pattern of how a JavaScript Promise is used in a web application (e.g. a then() function). The alternative methods of creating a promise in QML are documented here.

If you are interested in giving this a try, I attached my sample project to this blog post. In order to build/run this sample on your machine, you will need to install the Quartz beta 1 release of ArcGIS Runtime SDK for Qt, install QuickPromise, and update the path to the pri file in the project's pro file.

more
1 0 2,709
LucasDanzinger
Esri Frequent Contributor


The ArcGIS Runtime SDK for Qt Quartz beta is now available. You can find out more details in this blog, and you can sign up for the beta here.

Cheers,

Luke

more
0 0 1,098
LucasDanzinger
Esri Frequent Contributor

I'm happy to share with you all that we are nearly complete with our release certification of ArcGIS Runtime SDK for Qt (Quartz Beta 1). We expect to have the release available for you to download next week. We are very excited for this release, and we hope that you all are just as excited to test out the new features and the newly designed API. Here are a few of the highlights that you all have to look forward to:

  • 3D
  • Vector Tiles
  • Mobile Map Packages
  • Webmaps (Read/Create/Edit/Save)
  • Suggestions in Geocoding
  • Support for C++ Qt Quick apps, where the UI is in QML and backend is in C++ (this is huge if you're a C++ dev that needs to create mobile apps or wants to use QML for UI instead of Widgets!)
  • C++ Qt Quick supports means that our C++ API is now supported on all of the same platforms as QML (Win, Mac, Linux, iOS, Android)
  • We expose many more model types that can be directly plugged into views (ex: Layer List Models, Legend Models, etc), making creation of UI components massively simpler
  • Samples will be available on GitHub
  • The API reference now integrates better with Qt Creator (all of our C++ and QML classes/types can be viewed directly in Qt Creator by hitting F1, just like any other Qt type)

Watch Geonet and the ArcGIS blog for the official announcements next week, which will contain more details on what to expect, and how to access the beta from the Early Adopter Community. We hope you will be able to take some time to try out the new SDK and give us feedback, so that we can make sure the final release will contain everything you need to be productive and continue building amazing apps. Keep up the great work everyone! We eagerly await your feedback.

Cheers,

Luke

more
1 0 1,385
108 Subscribers