AnsweredAssumed Answered

Deploy Local Offline Data

Question asked by patrickrwild on Aug 28, 2015
Latest reply on Oct 13, 2015 by zdjankovsky

I am trying to bundle my data as a resource for deployment in an iOS application. The relevant code below writes the .geodatabase to C:/Users/username/ArcGIS/Runtime/Data on my local machine and AppPlayer renders the featureLayers correctly. However, it does not work in the iOS AppPlayer, nor does it work in the deployed iOS application after a Cloud Make. I do see a folder in the Documents of the installed iOS application named myData.geodatabase but is 'zero KB'. I have tried replacing this with a copy of the myData.geodatabase but this apparently is not the correct path to the data as the app still does not render the featureLayers.

 

Any insight would be greatly appreciated.

 

PW

 

import ArcGIS.AppFramework 1.0

import ArcGIS.AppFramework.Controls 1.0

import ArcGIS.AppFramework.Runtime 1.0
import ArcGIS.AppFramework.Runtime.Controls 1.0

import ArcGIS.AppFramework.Runtime.Dialogs 1.0

 

property string runtimePath: AppFramework.userHomeFolder.filePath("ArcGIS/Runtime"

property string dataPath: runtimePath + "/Data"

property string inputGeodatabase: "myData.geodatabase"

property string outputGeodatabase: dataPath + "/" + inputGeodatabase

 

Geodatabase {

          id: attachmentGdb

          path: copyLocalData(inputGeodatabase)

          onValidChanged: {

                    if (valid) {

                         var gdbtables = gdb.geodatabaseFeatureTables;

                         for(var i in gdbtables) {

                               console.log (gdbtables[i].tableName);

                              }

                        }

               }

}

 

function copyLocalData(dataPath) {

          AppFramework.userHomeFolder.makePath(dataPath);

          resourceFolder.copyFile(inputGeodatabase, outputGeodatabase);

          return outputGeodatabase

     }

/*

Copy the data to the Runtime folder... Note the use of the ":/qml" prefix.  AppStudio project files are packaged in a resource file named qml.qrc with a prefix of "qml"

*/

FileFolder {

          id: resourceFolder

          path: AppFramework.player === null ? ":/qml" : "./"

   }

Outcomes