I am working in xamarin android project. I am downloading .CSV file and store it in internal storage. File path is given below. filepath: /storage/emulated/0/Android/data/com.abc.def/files/ABC/MyListSample.csv
I want to load this .csv file into webview. I tried the below given code but couldn't able to load the .csv file in webview.
_webview = (WebView)FindViewById(Resource.Id.webView);
_webview.SetInitialScale (0);
_webview.Settings.JavaScriptEnabled = true;
_webview.Settings.SetSupportMultipleWindows (false);
_webview.Settings.AllowFileAccess = true;
_webview.Settings.SetPluginState (WebSettings.PluginState.On);//Try
_webview.Settings.BuiltInZoomControls = false;
_webview.Settings.JavaScriptCanOpenWindowsAutomatically = true;
_webview.Settings.AllowUniversalAccessFromFileURLs = true;
_webview.LoadUrl(string.Format("file://" + filepath));
Second method I tried is given below:
Java.IO.File csv = new Java.IO.File(filepath);
_webview.LoadUrl(string.Format("file://" + csv));
I don't want any third party library like open csv to view/load this csv file. I have searched a lot and tried many methods but couldn't able to find solution.