When you have finished using a mobile map package, it is recommended that you remove the mobile map package, to free up disk space on your device, and remove replicas on online feature services. You should do the following:
- Unregister any geodatabases that are no longer required for synchronization.
- Close all mobile map packages that are no longer required.
Unregister a geodatabase
Geodatabases are registered with an online sync-enabled feature service to ensure that any of their feature updates can be synchronized with the feature service. A geodatabase is registered automatically when you do the following:
- Take a map offline using the preplanned workflow.
- Take a map offline using the on-demand workflow.
- Take a feature layer offline using the geodatabase sync task. See Take a layer offline.
You can perform this operation later if your device cannot be online when you delete the mobile map package. Obtain the Sync ID from the geodatabase, store this, and use this to unregister the geodatabase when your device is online.
Close the mobile map package
When a mobile map package is loaded and used by a Runtime app, the operating system will lock the underlying mobile map package file or unpacked package files until the memory is freed or garbage collection runs (depending on the platform). These locks prevent files from being inadvertently moved or deleted. It is strongly recommended that you close a mobile map package if you need to move, delete, or reopen it while the application is running. Reopening a mobile map package may be required after applying scheduled updates. Close the mobile map package, as follows:
- Stop using the mobile map package. Remove the map from the map view. Remove all references to the mobile map package including maps, layers, geodatabases, networks, locators, and so on.
- Call the mobile map package's close method to free its locks. If active references to mobile package data exist, the close method will still close the package and subsequent rendering and data access methods will fail.
- The underlying mobile map package file or directory can be moved or deleted and the app can be terminated.
When you have released all references to the contents of the mobile map package and closed it, you can close your application and delete or move the mobile map package, if required.