Select to view content in your preferred language

Unable to query related table in offline sqlite database replica

7606
11
06-11-2014 11:14 AM
by Anonymous User
Not applicable
I am working with the latest version of the Android SDK (2.2.3) and AGO Sync capabilities to provide a local, offline SQLite database.  I have created a feature service that includes a feature layer and related a table that is essentially a 'stand alone' table, rather than a related feature layer.  The relationship information is coming across fine in the SQLite database replica downloaded from the feature service.  I am able to query the feature layer for it's relationship, and use that to formulate a query of the related tables.  The problem is that it keeps coming up with an empty result when I query the related table, even though there are data in that table.  It seems like there is good support for related tables if they are feature layer tables, but not if they are stand alone business tables.  I am currently querying the related table by using the FeatureTable class, because that seems to be the only appropriate class within com.esri.core.geodatabase for querying an offline SQLite database.  I thought that there might be a generic 'Table' class that would support related tables that are not FeatureTables, but I don't see one in the API reference.  Querying the related table using the FeatureTable class does not appear to be working.  In the code snippet below, the results are correct for FlightlinePoints which is a Point Layer, but return an empty result for Mission, which is a table.  Does anyone know if query of non-feature tables is supported using ArcGIS Android version 2.2.3 API?  If so, can you provide API reference or code snippet showing this in action?  If not, is there any workaround other than rolling our own SQLite database using standard Android tools and coding the CRUD to sync it programatically with the standard AGS REST endpoint?

Any thoughts or suggestions would be much appreciated.

Thanks,

Kerry
0 Kudos
11 Replies
by Anonymous User
Not applicable
Rama,

Thanks for these examples, VERY helpful.  We are now able to create public services which are sync-enabled.  It is not clear which chang to our our data model fixed this problem, but it is working now.  We are also now able to retrieve correctly populated related tables from the HTML interface as well as the Android SDK using the layerQueries and the "queryOption": "all" approach and using filters.  Relationship queries are still not working for us, however.  Here is an example test service which fails during createReplica with the error 'Exporting relationships for layer 1 failed': http://services1.arcgis.com/TODNt0c7hfy5HvPN/arcgis/rest/services/DMSM_prototype_v0_8_6_globalid_tes...  Can you help identify what is causing this error?  Additionally, we are not able to edit data from the services we have created when using the 'Create Local Copy for Editing' approach.  The error message we are receiving is 'A local copy could not be created.  A general error when something is wrong with a Field. [DAMAGE_AREA_ID]'.  Any ideas on what is going wrong?

Thanks,

Kerry
0 Kudos
RamaChintapalli
Esri Contributor
Hi Kerry,

Sorry for the delayed reply. The issue you are seeing with the createReplica is the same one that I mentioned in my previous reply which is happening with hosted services.  I have already notified it to the server/online team

For your question on editing, can you clarify if you are asking for editing from the Runtime Android SDK or editing from ArcMap ( 'Create Local Copy for Editing') ? I was able to perform edits on the DAMAGE_AREA_ID field using the Runtime Android SDK

Thanks
Rama
0 Kudos