Reading HTML files from SDCard using WebView in Xamarin.Android

I want to locate my app's help system on the SDCard of the device.

How do I specify the File location in this case?

The application works quite happily when the file(s) are read from the application assets as in:

                    AppCache.BrowserFragment = new WebviewActivity.WebviewFragment("file:///android_asset/HelpSystem/index.html");

However, I want to locate the HelpSystem folder on the SDCard. Can anyone suggest the filepath which I should use instead of "file:///android_asset/HelpSystem/index.html" ?

Posts

  • DavidPybusDavidPybus AUMember ✭✭

    The following snippet works:

    string targetfile = "file://" + Android.OS.Environment.ExternalStorageDirectory.Path + "/SAQDB/HelpSystem/index.html";
    AppCache.HelpFragment = new WebviewActivity.WebviewFragment(targetfile);

Sign In or Register to comment.