Select to view content in your preferred language

How to use standalone and related table in arcgis mobile?

2913
0
02-04-2014 03:13 AM
selcukcelik
Deactivated User
hi,

Still no cabability?

In some case esri resources say there is no support but the others are say "yes you can" let me show some code samples to describe myself properly.
//FeatureService Connection using replicamanager
            string featServiceUrl = @"http://<myserver>/arcgis/rest/services/test3/FeatureServer";
            FeatureServiceReplicaManager fsreplica = new FeatureServiceReplicaManager();
            //MobileCache 
            string cacheStoragePath = @"C:\GIS\Project\Mobil\db(Cache)\cache";
            MobileCache mobileCache = new MobileCache(cacheStoragePath);
            //delete old cache
            if (mobileCache.CacheExists == true)
                mobileCache.DeleteCache();
            ////////////////////////////
            //Create a token to access the service with valid username\password
            TokenCredential token = new TokenCredential("user", "pass");
            //Set feature service properties
            fsreplica.TokenCredential = token;
            fsreplica.Url = featServiceUrl;
            fsreplica.Initialize();
            fsreplica.MobileCache = mobileCache;

            //Get the data from the service to the local cache 
            fsreplica.CreateReplica();
            //Open the cache and add it to the maplayers 
            mobileCache.Open();
            if (!fsreplica.IsRegistered)
                fsreplica.RegisterReplica();
            map1.MapLayers.Add(mobileCache);


I saw an example for Arcgis 9.3 version named "working standalone tables in arcgis mobile" or something like this. Anyway Now also somebody can do with this code but is there any trick or bug because while I was trying this code after creating replica and then cache is created it throws error something like "any other task using the same file..." error line is "fsreplica.CreateReplica();". Especially "tempXXXX.json" file is problem at this point. Is there any sample or answer for this problem.

And One more question; Why we can just use nonverioned and archived data for sync capability to create editable cache?

Thanks
0 Kudos
0 Replies