The file Kml is downloaded using FTP with the apache library and saved on storage:
File dir = Environment.getExternalStoragePublicDirectory(Environment.DIRECTORY_DOWNLOADS);
File downloaded = new File(dir.getAbsolutePath() + "/0001_0005.kml");
OutputStream outputStream1 = new BufferedOutputStream(new FileOutputStream(downloaded));
boolean success = ftp.retrieveFile("/0001_0005.kml", outputStream1);
outputStream1.close();
How can I convert the File into type KmlLayer and show it in the map? I can show the file if is imported from raw package on resources with no problems.
KmlLayer layer = new KmlLayer(mMap,R.raw.test,getContext());
layer.addLayerToMap();