We would like to create a offline RunTime application that gets data from our main database, edit it (add, update, delete) and sync it back to the database when it is on-line again.
Our office is not connected to the web and we mainly works with Pro (but have portal too).
A few questions:
1) Can we use MMPK at all or they just read only.
2) Can we create .geodatabase files using pro and edit them in RunTime - how do we sync them back.
3) Do we have to use the portal?
What are the best practices in such a case.
At the moment ArcGIS Pro doesn't have support for Check-Out / Check-In workflow that would allow you to create editable geodatabases/mobile map packages so the only option that you have is to use Feature Service based approach with Portal (or Online in general but since you don't have access to the web that's not an option).
To answer your questions directly:
You don't need to use Portal you can just use ArcGIS Server and generate the replicas from the feature services. You do lose security with this approach, but it is possible. I agree with Antti Kajanus if you can do a workflow that allows you to use the offline map approach it does simplify things
Thanks for the answers. After reading the docs I have a few more questions...
The docs say Pro can create mmpk for mobile from feature layer. Does that mean you cannot create mmpk for mobile from local layers (shape files or layers in enterprise geodatabase)?
How do I create editable mmpk from feature service directly without portal? All the examples used webmap and Python API.
As Antti mentioned in his response. MMPK created from Pro are not-editable. The only way to create anything for offline use is to create a feature service first and use that service for creating the offline data
You could look it this way:
1) Use webmap to define your map with layers, symbols, etc...
Use Portal and take the whole map offline using the new functionality. This has many good things such as better maintainability and faster to implement. This is of course assuming that the functionality that you need is supported by this workflow.
2) Use Feature Services hosted in ArcGIS Server as Joe mentioned and generate offline data from them
This is more work for in the client but you can control offline functionality in more detail. You can find more information from Create an offline layer—ArcGIS Runtime SDK for .NET | ArcGIS for Developer
I would recommend prototyping with the option 1 and seeing if that works for you, if it doesn't then start looking to option 2.
I would like to renew this discussion to see the changes in 100.6 and 10.7.1 or 10.8
The updated line is Take a layer offline—ArcGIS Runtime SDK for .NET | ArcGIS for Developers
My understanding is that you have 2 options:
1) Take offline a map - you need to write a small program in Runtime that does this and create a MMPK we can sync back.
2) Take a layer offline - this layer MUST be hosted (we would like our data to stay in the database). This is not MMPK and also need a program in Runtime to create and sync.
The simplest way to generate replicas is with Runtime. Each of the above is slightly different, but follow the same pattern and are quite straight forward. There are samples of how to do each in documentation
For completeness: The Runtime API is not required to generate offline data. The Runtime API simplifies things greatly, but the Runtime API just wraps a bunch of ArcGIS Server Rest API calls. One could generate replicas using the ArcGIS Server Rest API directly, including doing this from the web interface provided by esri. In the same manner one could sync data using ArcGIS Server Rest API directly.
Just to follow on from Joe's comments,
> I believe these are basically the same files contained in an MMPK package, just not packaged.
That's correct. When you take a map offline via the Runtime it creates the same structure as a MobileMapPackage created from Pro just not archived (to allow editing of data). In both cases you can access the data using the MobileMapPackage API in Runtime bu supplying the path to the .mmpk file or to the directory.
> the number of pre-packaged maps is very limited (I believe 16 per web map)
Also correct. You can create new copies of the webmap if you require more areas.
If you want to go the route of taking individual layers offline, the relevant Runtime API is the GenerateGeodatabaseSyncTask.
We definitely recommend using the Runtime APIs to take maps/layers offline. Whilst you could do this directly via the REST API you would need to handle authentication, edit validation, error handling etc. yourself. Using the Runtime API takes care of these things for you and also gives access to the other parts of the API for visualizing and analysing your data etc.