I need to get the file URL to an image that I store locally in my app. I don't care where I store the file locally, just somewhere in which I can get a URL to it. I have tried assets and resources with no luck.
What I am trying to do is override UrlTileProvider:
public class FileSystemTileProvider extends UrlTileProvider {
public FileSystemTileProvider(int width, int height, String assestsDirectory) {
super(width, height);
}
@Override
public URL getTileUrl(int x, int y, int z) {
String tile = "file://<somewhere>/background.png";
URL fileUrl = null;
try {
fileUrl = new URL(tile);
} catch (MalformedURLException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
return fileUrl;
}
}
I need to return a URL for this to work. I have hardcoded a file url and it does work. However I need a way to get a URL for my background.png image. Is this possible?