0

I have a problem. If the app displays a website in a WebView and this website wants for example to access device files, does it require storage permission? The same with camera, geolocation etc. When I tried this, it works both with and without appropriate permissions (I tried that with geolocation and storage), but some people try to imply that the permissions are required. Why is that?

2 Answers2

0

Yes, App do need permission even if webview wants to access camera or storage,

And it's because of security issues that you need permission for using camera or storage or anything for that matter even if you're using webview.

Because even if you use webview, ultimately you are going to use camera or any hardware so you need to ask permission.

Karan Mehta
  • 1,442
  • 13
  • 32
0

Android 6.0 Marshmallow introduces a new model for handling permissions, which streamlines the process for users when they install and upgrade apps. Provided you're using version 8.1 or later of Google Play services, you can configure your app to target the Android 6.0 Marshmallow SDK and use the new permissions model.

If your app supports the new permissions model, the user does not have to grant any permissions when they install or upgrade the app. Instead, the app must request permissions when it needs them at runtime, and the system shows a dialog to the user asking for the permission.

To learn more, see the documentation for Android 6.0 Marshmallow and the changes you must make to your app for the new permissions model.

Google has added WebChromeClient.onShowFileChooser. They even provide a way to automatically generate the file chooser intent so that it uses the input accept mime types.

source

Arda Kazancı
  • 8,341
  • 4
  • 28
  • 50