webview access to sdcard?

tomb

Member
Licensed User
Longtime User
I'm using WebView.LoadUrl( "file:///android_asset/some.html") and it works correctly processing JQuery/CSS/javascript HTML stuff.

It would make my life far simpler if I could access the sdcard from WebView in that I could maintain various files from the app or load the sdcard with different images, change the HTML without recompiling the app, etc. Is there a way to access the SDcard or any Android memory with WebView besides ("file:///android_asset/ ") ?

Best
Tom B
 

tomb

Member
Licensed User
Longtime User
Thanks Erel,
The general idea works. Because I have a Droid X2, the path wasn't
File.DirRootExternal exactly but rather was another path:
root = "/mnt"
folder = "sdcard-ext"
subfolder = "appfolder"

sdf=root & "/" & folder & "/" & subfolder & "/"
WebView1.LoadUrl("file://" & File.Combine(sdf, "slideshow-example.html"))

This construction works perfectly and my Jquery driven slideshow works as intended from sdcard-ext.

It appears that DirRootExternal = "/mnt/sdcard/" which is an internal sdcard at least on the droid X2

One other small gotcha is if you don't change the USB setting to PC and leave it set to sdcard, the program won't find the sdcard-ext.




Thanks Again.
Tom B
 
Upvote 0
Top