I am using a plugin cordova-plugin-bluenet-dfu I put the required firmware directly within the www folder. However, I have trouble targeting the file correctly with either file path or URI.
With filePath
for example, the plugin in Java opens file the following way:
final InputStream is = new FileInputStream(filePath);
I tried to specify the file by
file:///android_asset/www/firmware/sdk11_lock_20161215_resDelay.zip
android_asset/www/firmware/sdk11_lock_20161215_resDelay.zip
www/firmware/sdk11_lock_20161215_resDelay.zip
None of which seems to work. I tried the first one with fileUri
too and it doesn't work.
How do I specify the path to the file inside the the assets
folder?
Cordova access your file as a relative path. Mainly, Cordova think you're using the www directory. So if you want to find a file, i.e. myfile.html, you just use this filename if the file is in the www dir. If the file is in the dir inside (i.e. www\MyDirInside), you can access to it using MyDirInside\myfile.html (Sincerely I don't remember if \ or / ).
Let's try using your dir and files.