I have app that loads features on my map, and it can generate and store geo-database to my local device.I does edit ans sync the existing features but what I want to achieve next is to create a new point on the map offline and sync back when I am online. I have tried several ways but no success. Also, tips for taking maps offline would be helpful.
Solved! Go to Solution.
This guide documentation should help: Edit features—ArcGIS Runtime SDK for Android | ArcGIS for Developers
In short, you create a feature using the table, set the attributes and geometry, and then add it to the table.
Working with offline geodatabases, that is all you need to do. If you are working with a ServiceFeatureTable connected directly to a service, you will also need to call applyEdits.
This guide documentation should help: Edit features—ArcGIS Runtime SDK for Android | ArcGIS for Developers
In short, you create a feature using the table, set the attributes and geometry, and then add it to the table.
Working with offline geodatabases, that is all you need to do. If you are working with a ServiceFeatureTable connected directly to a service, you will also need to call applyEdits.
Thanks, it worked.
Hi Nicholas,
I need some inputs here, have been trying this whole day, no success
I have geodatabase loaded on the map, I am trying to add a new geometry [ I am drawing geometry using sketch editor ]. Geometry gets drawn on the web, but doesn't persist in the geodatabase. It does not show the new feature if I reload the geodatabase.
Here s my simple code..
Would it be because of spatial reference ! Geodb being in different SR than that of my drawn geometry.
Missing source code file
Edit features—ArcGIS Runtime SDK for Android | ArcGIS for Developers
Earlier, I had achieved editing the geometry without drawing using sketch editor, is sketch editor unstable ! then what is the alternative to draw polygon, circle, triangle etc!
Any inputs/ samples would be helpful.
If you're not getting an error when you're writing the feature, then it's very likely the projection. I forget what Runtime does about automatically projecting but for performance we might not be doing that when writing to a local geodatabase. In general it's recommended not to make the Runtime project on the fly (each feature that is displayed from the local geodatabase must be projected to display on the map), so you might try specifying the spatialReference when you set up your GenerateGeodatabaseParameters. Note that when you read features from a service, it's the server that will be doing the projection so Runtime won't experience a hit in that case.
A simple test would be to use GeometryEngine.project() to get a version of the geometry projected to the spatial reference of the geodatabase table and write that then see if that passes your test when you re-run. I'm certainly not aware of any issues with the sketch editor.
When I checked the exception, exception was: you are not allowed to perform this operation with your licence.
I had placed one developer licence key to remove watermark, removed the licences, editing started working, strange !
Thanks
Yes. If there is no license, you will be in Developer Mode (you'll see the watermark). All capabilities are enabled then, but you are not permitted to release an app in Developer Mode. It is for development and testing only.
To do offline editing, you will need a Basic license. The free license provided from your developer account is a Lite license and would only allow connected editing against a public service. A Basic License can be enabled by logging in as a Named User of any role other than Viewer. Or you can buy license packs from your local distributor.