In my android app, I am trying to load a webpage (that must access the camera) on WebView
. On my laptop, when I load the webpage, I could access the camera.
Everything else on the html
page is shown.
Here are the permission I am putting in the Manifest.xml
<uses-permission android:name="android.permission.CAMERA" />
<uses-permission android:name="android.webkit.PermissionRequest" />
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
<uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION" />
<uses-permission android:name="android.permission.ACCESS_FINE_LOCATION" />
<uses-permission android:name="android.permission.INTERNET" />
I am setting the SDK as follow:
<uses-sdk
android:minSdkVersion="18"
android:targetSdkVersion="21" />
Here is my webview setting:
private void setMyWebviewSettings(WebSettings MyWebviewSettings) {
MyWebviewSettings.setAllowFileAccessFromFileURLs(true);
MyWebviewSettings.setAllowUniversalAccessFromFileURLs(true);
MyWebviewSettings.setJavaScriptCanOpenWindowsAutomatically(true);
MyWebviewSettings.setJavaScriptEnabled(true);
MyWebviewSettings.setDomStorageEnabled(true);
MyWebviewSettings.setJavaScriptCanOpenWindowsAutomatically(true);
MyWebviewSettings.setBuiltInZoomControls(true);
MyWebviewSettings.setAllowFileAccess(true);
MyWebviewSettings.setSupportZoom(true);
}
If I could access the camera from my app directly (using a normal activity), why can't I open it from within the WebView
?!