Local GDB path

1136
0
04-21-2014 10:40 AM
DarrenWiens2
MVP Honored Contributor
Long time GIS user, first time Android/Java coder - so no instruction can be too basic.

I am attempting to make my way through the Create an offline map tutorial. I have created Runtime Content in ArcMap, and saved the resulting files and folder structure on my phone's SD card. The ".geodatabase" file appears in my PC's file explorer at the path: Computer\SGH-I747M\Card\ArcGIS\runtime_esri\runtime\data\test.geodatabase (SGH-I747M is the phone)

In the tutorial, I have made it to:
Geodatabase geodatabase = new Geodatabase("{/path/to/geodatabase}");


What, exactly, should the geodatabase path syntax be? The code below tells me that /Card/ArcGIS/runtime_esri/runtime/data/test.geodatabase does not exist. I've tried many other paths, removing slashes and the word "Card". Any ideas?

My code looks like:
       mMapView = (MapView)findViewById(R.id.map);
       Toast.makeText(this, "Start", Toast.LENGTH_SHORT).show();
       
       try {
        //Open the geodatabase file
        Geodatabase geodatabase = new Geodatabase("/Card/ArcGIS/runtime_esri/runtime/data/test.geodatabase");
        Toast.makeText(this, "Success", Toast.LENGTH_SHORT).show();
        GeodatabaseFeatureTable geodatabaseFeatureTable = geodatabase.getGeodatabaseFeatureTableByLayerId(0);

           //create a feature layer
           FeatureLayer featureLayer = new FeatureLayer(geodatabaseFeatureTable);
           mMapView.addLayer(featureLayer);
           mMapView.addLayer(new ArcGISTiledMapServiceLayer("" +
           "http://services.arcgisonline.com/ArcGIS/rest/services/World_Street_Map/MapServer"));
       
       } catch (FileNotFoundException e) {
        Toast.makeText(this, "Failure", Toast.LENGTH_SHORT).show();
        Toast.makeText(this, e.getMessage(), Toast.LENGTH_SHORT).show();
    // TODO Auto-generated catch block
    e.printStackTrace();
   }
0 Kudos
0 Replies