Solved! Go to Solution.
No. I´m just testing a code. This feature only works after the app was licenced ?
I try to run this code with runtime 10.2.3 (using the new ExportTileCacheTask class instead TileCacheTask) but I got the error below
com.esri.core.io.EsriSecurityException: Unauthorized access to a secure service - http://tiledbasemaps.arcgis.com/arcg...iles/submitJob
/** * Creates tile Cache locally by calling submitTileCacheJobAndDownload * * @param params * @param tileCacheTask * @param tileCachePath */ private void createTileCache(GenerateTileCacheParameters params, final TileCacheTask tileCacheTask, final String tileCachePath) { // Set the recovery directory for incomplete tasks tileCacheTask.setRecoveryDir(recoveryDir); // estimate tile cache size tileCacheTask.estimateTileCacheSize(params, new CallbackListener<Long>() { @Override public void onError(Throwable e) { Log.d("*** tilecachesize error: ", "" + e); } @Override public void onCallback(Long objs) { Log.d("*** tilecachesize: ", "" + objs); } }); // Submit tile cache job and download tileCacheTask.submitTileCacheJobAndDownload(params, null, new CallbackListener<String>() { private boolean errored = false; @Override public void onError(Throwable e) { errored = true; // print out the error message and disable the progress bar Log.d("*** submitTileCacheJobAndDownload error: ", "" + e); mProgress.setVisibility(View.GONE); } @Override public void onCallback(String path) { if (!errored) { Log.d("the Download Path = ", "" + path); // Disable the progress bar and switch to the // successfully downloaded local layer mProgress.setVisibility(View.GONE); switchToLocalLayer(path); } } }, tileCachePath); // recover all incomplete jobs contained in the recovery directory tileCacheTask.recoverAllJobs(new CallbackListener<TileCacheStatus>() { @Override public void onError(Throwable e) { Log.d("*** recoverAllJobs error: ", "" + e); mProgress.setVisibility(View.GONE); } @Override public void onCallback(TileCacheStatus objs) { Log.d("***", " start recovery" + objs); } }, new CallbackListener<String>() { @Override public void onError(Throwable e) { mProgress.setVisibility(View.GONE); } @Override public void onCallback(String objs) { Log.d("***", " end recovery" + objs); mProgress.setVisibility(View.GONE); } }); }
Do you License your app at the Basic level?
No. I´m just testing a code. This feature only works after the app was licenced ?
I try to run this code with runtime 10.2.3 (using the new ExportTileCacheTask class instead TileCacheTask) but I got the error below
com.esri.core.io.EsriSecurityException: Unauthorized access to a secure service - http://tiledbasemaps.arcgis.com/arcg...iles/submitJob