But, don't forget about Android Webviews
June 10, 2024
Focusing on Android Webviews since I've seen more issues with it compared to iOS webviews.
Difficulty explaining it to different stakeholders. This is a source of confusion because a WebView can be interpreted as a web view. "Isn't that what I use when I am on a Safari browser or Chrome Browser?", someone will ask. You will have to tell people that it's similar to the browser in that it can load web content. However, you will have to further explain that it's a entity inside of your Native Android or iOS application and the native application has control over the content in the webview. The Web View then talks through a Bridge with the native application to interact with APIs and platform. Forever, you will have to explain that a webview is similar to a browser, but it is its own distinct browser living inside of your native application. If I could, I would opt for a name like NativeWebContent instead.
Permissions is something to watch out for when using a webview. In iOS, you have to list the permissions required in info.plist. In Android, you have to declare the permissions in Manifest.xml and then handle runtime permissions by overriding PermissionRequest when accessing camera from a webview.
My current opinion is that webviews are really good for static content that can be shared across browser and native apps. However, if you do decide to use highly interactive forms, utilizing inputs/cameras, note that there will be coordination between your mobile native codebase and your web codebase. This has implications depending on your team's expertise. In lots of cases, the idea of webviews is to reduce "duplicated" code in two places, which it does. In its place, you have to add a different type of code instead and make sure teams have context between the mobile native code and the web code.
Handling file input has to be done in Android code. Otherwise, that simple input on the web will not behave as you expect in a webview.
Don't forget to check MDN. There's a column just for WebView Android. For example, As of writing on June 11, 2024, parts of Storage Access API and Web Authentication API are not supported.
Posts
Previous Posts
Home
Go Home