title: OSMDROID - loading .map file downloaded from mapsforge
body: <p>I'm trying to load .map file which is placed in /assets folder in android studio. The .map file was downloaded from mapsforge
       @Override
      protected void onCreate(Bundle savedInstanceState) {
          super.onCreate(savedInstanceState);
          setContentView(R.layout.activity_main);</p>
  
  <pre><code>    map = (MapView) findViewById(R.id.map);
      map.setBuiltInZoomControls(true);
      map.setTileSource(TileSourceFactory.MAPNIK);
      IMapController controller = map.getController();
      GeoPoint point = new GeoPoint(41.2585, 69.2097);
      controller.animateTo(point);
      controller.setZoom(10);
  
      File f = new File("file:///android_asset/" + "myfile.map");
      if (f.exists()) {
          File[] list = f.listFiles();
          if (list != null) {
              for (int i = 0; i &lt; list.length; i++) {
                  if (list[i].isDirectory()) {
                      continue;
                  }
                  String name = list[i].getName().toLowerCase();
                  if (!name.contains(".")) {
                      continue; //skip files without an extension
                  }
                  name = name.substring(name.lastIndexOf(".") + 1);
                  if (name.length() == 0) {
                      continue;
                  }
                  if (ArchiveFileFactory.isFileExtensionRegistered(name)) {
                      try {
                          OfflineTileProvider tileProvider = new OfflineTileProvider(new SimpleRegisterReceiver(this),
                                  new File[]{list[i]});
                          map.setTileProvider(tileProvider);
                          String source = "";
                          IArchiveFile[] archives = tileProvider.getArchives();
                          if (archives.length &gt; 0) {
                              Set&lt;String&gt; tileSources = archives[0].getTileSources();
                              if (!tileSources.isEmpty()) {
                                  source = tileSources.iterator().next();
                                  map.setTileSource(FileBasedTileSource.getSource(source));
                              } else map.setTileSource(TileSourceFactory.DEFAULT_TILE_SOURCE);
  
                          } else map.setTileSource(TileSourceFactory.DEFAULT_TILE_SOURCE);
                          map.invalidate();
                          return;
                      } catch (Exception ex) {
                          ex.printStackTrace();
                      }
                  }
              }
          }
          Toast.makeText(this, f.getAbsolutePath() + " did not have any files I can open! Try using MOBAC", Toast.LENGTH_SHORT).show();
      } else {
          Toast.makeText(this, f.getAbsolutePath() + " dir not found!", Toast.LENGTH_SHORT).show();
      }
  }
  </code></pre>
  
  <p>Getting error "myfileDirectory" did not found. </p>