Adding Feature Layers to a runtime geodatabase

4052
3
Jump to solution
06-05-2015 04:43 AM
BishoyGerges1
New Contributor

Hello,

I am using ArcGIS Android SDK for developping application in my company.We have WebMaps that represent building floors.WebMaps are constructed in a way that each webmap has 4 Layers (Basemap ,Polygons,lines and points). The problem here is that i cannot find any way to ADD more layers (not sublayers) to a runtime geodatabase once it is created.

To be more clear here is a snippet of my code:

String gdbFileName = Environment.getExternalStorageDirectory().getPath() + "/ArcGIS/offlinedata.geodatabase"
GeodatabaseSyncTask myGdbTask=new GeodatabaseSyncTask(layerUrl, null)
myGdbTask.generateGeodatabase(params, gdbFileName , false, statusCallback, gdbResponseCallback);

The database is created successfully and i get the path in the callback. Moreover i can add it to the mapview.

I want to add more Feature Layers to the same geodatabase. Is that possible ? and if yes, How can i do that ?

Thanks in advance.

0 Kudos
1 Solution

Accepted Solutions
WillCrick
Occasional Contributor

Hi,

Unfortunately you cannot add new FeatureTables to an existing Geodatabase object using the API. You have to either author these geodatabases in ArcMap or generate them from a feature service (using the GeodatabaseSyncTask).

See this doc for the offline patterns we currently support.

Create an offline map—ArcGIS Runtime SDK for Android | ArcGIS for Developers

Thanks

Will

View solution in original post

0 Kudos
3 Replies
WillCrick
Occasional Contributor

Hi,

Unfortunately you cannot add new FeatureTables to an existing Geodatabase object using the API. You have to either author these geodatabases in ArcMap or generate them from a feature service (using the GeodatabaseSyncTask).

See this doc for the offline patterns we currently support.

Create an offline map—ArcGIS Runtime SDK for Android | ArcGIS for Developers

Thanks

Will

0 Kudos
BishoyGerges1
New Contributor

And since the GeodatabaseSyncTask takes only one feature service url, so i cannot even create a geodatabase with multiple FeatureTables. Right ?

0 Kudos
WillCrick
Occasional Contributor

No, a feature service contains many layers (consider these feature layers). The GeodatabaseSyncTask works at the feature service level so you can bring down many layers into many FeatureTables. By default, the default sync parameters we give you if you construct it with a feature service info will be set up to return all layers in the feature service.

Will

0 Kudos