How to evaluate arcade expressions

640
2
03-31-2020 10:03 AM
ForrestKaye
New Contributor III

I am trying to implement arcade expressions using the latest version of the quartz sdk for Android.  I am not having any success.  First off I want to confirm that this is supported in the Android runtime sdk at this time?  References in the Arcade matrix only mention "ArcGIS Runtime" not all the runtimes individually.  I see no mention of arcade specifically in the Android documentation API or sample code, whereas in the ios SDK resources I at least see some mention of it.

It seems like it is, or should be supported as the Collector beta for Android does evaluate arcade expressions as expected. However, after digging into this a bit I am starting to think they are doing something outside of the SDK directly.  Is this the case or am I not seeing something?

Any info, resources or sample code would be much appreciated.

Thanks,

0 Kudos
2 Replies
MikeWilburn
Esri Contributor

Forrest - let me know if my email reply helped. If so, I'll then summarize here. Cheers!

0 Kudos
ForrestKaye
New Contributor III

Yes it helped. After having the confidence of knowing that it should work I went back through my implementation and I realized I was creating the popup from a Feature of a FeatureSet which seems to have been the problem.  When I create the popup in other ways I can see all the PopFields expected as well as ArcadeExpression values properly evaluated.

It took awhile to figure this one out.  It was difficult to follow the api documentation and I didn't find much in the way of code samples for callouts or Popups in the Android sdk page.  I found myself going to the iOS page for some better samples to get me started. 

For instance in the api documenation for PopupManager all it says is -- "Manages the viewing and editing of a Popup."  Which seems very misleading as I took it to mean this class will have some sort of .show() method to display a template popup.  

//This was not giving me the webmap version of the popup when the feature was derived from a FeatureSet, Which the documenation states but took me awhile to realize.
Popup popup = new Popup(feature);

//By using the same feature derived from a Feature set and also passing in the featureLayer PopupDefinition It created my expected Webmap popup with Arcade Expressions.  
//This sort of made sense to pass in this paramater in my current business logic 
Popup popup = new Popup(feature,featureLayer.getPopupDefinition());‍‍‍‍‍‍

At any rate just food for though for other developers or ESRI who might end up here.  Thanks for the reply Michael.

Cheers,

0 Kudos