Modify Collector attachments from Android

473
4
Jump to solution
05-17-2018 08:00 AM
WaldemarNowak
New Contributor III

I want to develop Android application manipulating geodatabase (SDE). Application needs to read/modify attachments gathered by "Collector" (photos) and modify additional feature attributes. The geodatabase is on MSSQL Server Express hosted inside our company (on-premises). This geodatabase contains our own data in custom attributes. So far, I was accessing this database directly (using ADO.NET) from Windows desktop applications without usage of any ESRI API or ESRI libraries. 

Questions:

1) What is the preferred technology for this application: 

  • ArcObjects SDK
  • ArcGIS Runtime SDK for .NET (with Xamarin.Android)
  • ArcGIS Runtime SDK for Android.

2) I see in the database how Collector attachments are connected to feature class (using AttachmentID), but I would like to make more "legal", API access to them. Can somebody point me to documentation/training/samples where I can study API manipulating Attachments and how to modify SDE geodatabase from Android? I am new to ESRI API and would like your help to show me where to start ESRI API education to achieve the above goal.

3) Is "Essentials Developer Subsciption" enough for this task?

Thanks,

Waldek

0 Kudos
1 Solution

Accepted Solutions
dotMorten_esri
Esri Frequent Contributor

...btw I just realized you're looking at the old 10.x API Documentation.

Here's the correct documentation: ArcGISFeature Class 

View solution in original post

4 Replies
dotMorten_esri
Esri Frequent Contributor

While it's probably technically possible to modify the backing data directly, I'd advice heavily against it, as there's some finicky database relationships behind a feature server. Attachments should be edited via a feature service endpoint to ensure data consistency.

So you would be using the ServiceFeatureTable class to connect to that feature service, query its features, and there's then attachment operations on these features (this is also what the Collector apps are doing).

0 Kudos
WaldemarNowak
New Contributor III

Thank you Morten for the response. I can can create ServiceFeatureTable:

ServiceFeatureTable table = new ServiceFeatureTable(uri);

The documentation describes working with attachemtns:

https://developers.arcgis.com/net/10-2/desktop/guide/work-with-feature-attachments.htm

and API reference describes function QueryAttachmentsAsync:

https://developers.arcgis.com/net/10-2/desktop/api-reference/html/M_Esri_ArcGISRuntime_Data_ArcGISFe...

However Esri.ArcGISRuntime.dll in version 100.2.1.0 does not contain this function.

Compile error:

'ServiceFeatureTable' does not contain a definition for 'QueryAttachmentsAsync' 

I have reinstalled ArcGIS_Runtime_SDK_DotNet_100_2_1.vsix and it did not help. Any suggestions?

0 Kudos
dotMorten_esri
Esri Frequent Contributor

The method is on the ArcGISFeature: GetAttachmentsAsync.

So you'd first query for the feature you're interested in, then call GetAttachmentsAsync on it. It also has the methods for add, update and delete attachments.

dotMorten_esri
Esri Frequent Contributor

...btw I just realized you're looking at the old 10.x API Documentation.

Here's the correct documentation: ArcGISFeature Class 

View solution in original post