I need to get the absolute path of the assets folder in my app as I want to serve the files within using a webserver and it needs the absolute path. Is this possible?
I would have thought there might be something like this:
String rootDir = getAssets().getRootDirectory();
but there’s not.
Any help appreciated, cheers.
No. There is no “absolute path of the assets folder in [your] app”. Assets are stored in the APK file.
In select cases, such as URLs supplied to a
WebView, you can use the specialfile:///android_assetbase URL to reference files in your assets.