Select to view content in your preferred language

MapGraphicsView on Android

1295
6
Jump to solution
03-23-2021 11:19 AM
TomNorby
Occasional Contributor

Greetings,

I've got a Qt application that cross-compiles windows and linux (and android sans ArcGIS) that is pure c++ (no QML). I currently use MapGraphicsView but when trying to compile to android I trigger the error in the class header:

#ifndef GRAPHICSVIEW_SUPPORTED
#error "MapGraphicsView is not supported on this platform."
#endif

The Qt Android samples all use MapQuickView - but is there a known way to circumvent QtQuick for ArcGIS on Android?

Tags (1)
0 Kudos
1 Solution

Accepted Solutions
JamesBallard1
Esri Regular Contributor

@TomNorby I will discuss it with the team and see if this is something we can add support for. You are right, we'd need to add that support in our build in order to enable it; it's not just a matter of removing the ifdefs.

May I ask, what is your use case for needing Widgets support on mobile platforms? That is not a pattern that's been widely adopted or promoted by The Qt Company.

View solution in original post

6 Replies
JamesBallard1
Esri Regular Contributor

Hi @TomNorby .  We don't support the MapGraphicsView (QWidget-based view) on the mobile platforms.

If you want a truly cross-platform experience I would recommend you use our MapQuickView class and follow the pattern used by our samples as you pointed out.

>but is there a known way to circumvent QtQuick for ArcGIS on Android?

Unfortunately no.

TomNorby
Occasional Contributor

@JamesBallard1, do you happen to know if support for pseudo-pure c++ will become available in the future. I may be naïve, but it seems that these classes would merely need to be defined in the library.

When running make I'm just running into the linker errors (as expected):
ld: error: undefined symbol: Esri::ArcGISRuntime::MapGraphicsView::<method()>

I imagine not officially supporting specific classes on Android but allowing the developers to #define GRAPHICSVIEW_SUPPORTED prior to including the respective header would be sufficient.

Anyhow, great product and many thanks!

0 Kudos
JamesBallard1
Esri Regular Contributor

@TomNorby I will discuss it with the team and see if this is something we can add support for. You are right, we'd need to add that support in our build in order to enable it; it's not just a matter of removing the ifdefs.

May I ask, what is your use case for needing Widgets support on mobile platforms? That is not a pattern that's been widely adopted or promoted by The Qt Company.

TomNorby
Occasional Contributor

@JamesBallard1, currently I'm working for Oak Ridge National Laboratory, we have many projects that are interconnected and use TriBITS and CMake for package management and configuration. We've avoided .pro, .qml, and qmake. I'm not sure of the history, whether it's for our CI, static analysis tools, security scans, legacy developer preference, or something else entirely.

I've updated a widget from QMapControl (because ArcGIS is superior) last year and everything's been great for Windows and Linux. Now we're interested in Android, and used https://github.com/LaurentGomila/qt-android-cmake with minor tweaks to easily generate our APKs.

I hope it's not much of a lift, and appreciate your consideration even if the request won't be accommodated.

Much appreciated,

Tom

0 Kudos
JamesBallard1
Esri Regular Contributor

Thanks for the info, Tom. I will add this into our tracking issue.

0 Kudos
JamesBallard1
Esri Regular Contributor

@TomNorby ,

  We had a recent meeting with the Qt Company and they confirmed my previous recollection that Widgets, while technically supported on mobile, is not the recommended workflow. Qt Quick is. The main issue is the look-and-feel and styling options for Widgets on mobile.

As such, we will not pursue supporting Widgets on mobile platforms for the ArcGIS Runtime SDK for Qt.

I do hope you're still able to make the Runtime work in your project.

0 Kudos