Offline Geocode not running through Appstudio Player

1453
3
03-03-2017 02:47 AM
MuhammadAfzal2
New Contributor II

 I have created an offline application which uses the LocalLocator to perform offline Geocode. The app loads fully when testing through the Qt Creator and Appstudio for ArcGIS  but the LocalLocator doesn't work when the app's loaded through the Appstudio Player (Error: Locator not initialized).

Following code i running:

    property string dataPath: AppFramework.userHomeFolder.filePath("ArcGIS/AppStudio/Data")
    property string inputLocFolder: "ABCLocator"
    property string outputLocFolder: dataPath + "/" + inputLocFolder
    property LocalLocator localLocator
    function copyLocalData() {
        var resourceFolder = AppFramework.fileFolder(app.folder.folder(inputLocFolder).path);
        var fileNames = resourceFolder.fileNames("*", true);
        for (var i = 0; i < fileNames.length; i++) {
            var fileName = fileNames[i];
            fileName = fileName.replace(/\\/g, "/");
            var outputFileFolder = AppFramework.fileFolder(outputLocFolder);
            var outputFileInfo = AppFramework.fileInfo(outputFileFolder.filePath(fileName));
            outputFileFolder.makePath(outputFileInfo.path);
            resourceFolder.copyFile(fileName, outputFileFolder.filePath(fileName));
        }
    }
    Component.onCompleted: {
        
        copyLocalData();
        arcGISLocalTiledLayerBasemap.path = outputLocFolder + "/streetmap.tpk";
        localLocator = ArcGISRuntime.createObject("LocalLocator", {path: outputLocFolder + "/plot_locator.loc"});
    }

Tpk file and all locator files (loc,lox,locb,loc.xml) properly created in ArcGIS/AppStudio/Data/ABCLocator but application not 
working in App studio Player.

Please Help me regarding this issue.

Advance Thanks.

0 Kudos
3 Replies
SathyaPrasad
Esri Contributor

The functionality you are trying to use requires "Advanced" runtime license. Refer: License your app—AppStudio for ArcGIS (Desktop Edition) | ArcGIS 

When running such apps in Player you will need to provide the license via code in your app before you initialize/use any runtime objects. Refer to the link above to get information and code required to do the same.

0 Kudos
MuhammadAfzal2
New Contributor II

Thanks Sathya Prasad..

I want to know I can get Trial base license for  ArcGIS Runtime Application on Appstudio Player?

Regards,

0 Kudos
MuhammadAfzal2
New Contributor II

Can Any Body  tell me either I run the offline Local Locator on Android Phone/App studio Player using my 60 days prepared ArcGIS online account.

 

Regards,

0 Kudos