So I realized that I had to supply User Credentials (the free trial/developer account I had created) to the constructor of ExportTileCacheTask ... and it worked! I got my files.
Now, however, I can't get anything to display. I just see grid lines.
I have not seen this issue specifically, but I can suggest a few things I would try.
Make sure you're setting map extent or zooming in and out to the levels that you actually exported to the TPK. Also check you you did load the layer correctly - check the layer got initialized for example using MapView.getOnStatusChangedListener.
I am posting my "compact cache" files, and my TPK file.
Thanks, Mike
P.S. - Perhaps this is something: I'm not clear what the levels parameter in the ExportTileCacheParameters is supposed to be. Per the sample code, it's an array of doubles containing 1.0, 2.0, 3.0 ... and so forth. Is that correct?
You are most likely seeing the grid because you are not zoomed into the Level of Detail you downloaded.Did you attempt to download without selecting levels in the sample? A quick look at the layer compact cache you attached shows you downloaded levels 0 - 9 and your json description is valid. Did you select those 10 levels? I noticed that the sample will start the download if you have not selected levels which I will fix and republish.
You are correct in suspecting that the levels parameter are doubles representing the level of detail available in the tile service. The service provided in the sample has 10 levels of detail available as described in the service description here.
Thanks, Dan. That did it. It was indeed a matter of setting the resolution correctly. Mind you, I didn't know what resolution to set it to, since I couldn't find documentation for this in the map I'm using (http://tiledbasemaps.arcgis.com/arcgis/rest/services/NatGeo_World_Map/MapServer). So, I had to first get the map into view (by using hand gestures to zoom in and zoom out), and then, in a debug point, I did a mapView.getResolution().
Whew!
The whole process is exacerbated by the fact that it takes over a minute for Android to do a compile, due (I presume) to the fact that it re-compiles ArcGIS' library each time. Have you encountered this? And if so, have you figured out a way to get around this?