Warning: file_get_contents(/data/phpspider/zhask/data//catemap/3/android/186.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/batch-file/5.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
如何使用ArcGIS SDK for Android编辑脱机.geodatabase文件?_Android_Offline_Arcgis - Fatal编程技术网

如何使用ArcGIS SDK for Android编辑脱机.geodatabase文件?

如何使用ArcGIS SDK for Android编辑脱机.geodatabase文件?,android,offline,arcgis,Android,Offline,Arcgis,我正在尝试使用ArcGIS SDK for Android编辑脱机.geodatabase文件。我一直在查阅文档,找到了使用服务的方法,但我的应用程序不使用任何服务,只使用脱机文件 我正在做的是打开.geodatabase文件,当文件打开时,它会自动创建两个文件(.geodatabase shm,.geodatabase wal)。稍后,当我想要编辑与地图单元格相关的信息时,我调用以下方法: GeodatabaseFeatureTable.updateFeature(long featureId

我正在尝试使用ArcGIS SDK for Android编辑脱机
.geodatabase
文件。我一直在查阅文档,找到了使用服务的方法,但我的应用程序不使用任何服务,只使用脱机文件

我正在做的是打开
.geodatabase
文件,当文件打开时,它会自动创建两个文件(.geodatabase shm,.geodatabase wal)。稍后,当我想要编辑与地图单元格相关的信息时,我调用以下方法:

GeodatabaseFeatureTable.updateFeature(long featureId, Map<String, Object> attributes)
GeodatabaseFeatureTable.updateFeature(长featureId,地图属性)
并更新文件(.geodatabase shm、.geodatabase wal),但不更新原始(.geodatabase)


我需要将文件.geodatabase发送到服务器,以便其他用户下载,那么如何将更改应用于此文件?是否有一些地理数据库事务需要我执行?

文件.geodatabase shm和.geodatabase wal是临时文件,当原始.geodatabase关闭时,更改将应用于原始.geodatabase

因此,解决方案包括在Geodatabase不再使用时调用方法
Geodatabase.close()
,例如在onDestroy方法中。以下是方法概述:

在我的例子中,我必须使用不同的方法,因为我可能使用的是旧版本的ArcGIS SDK。方法是
Geodatabase.dispose()
,您可以在这里看到描述: