user11882920
user11882920

Reputation:

What are webviews and how can I use them

I am learning how develop android applications and I am having trouble understanding web views.

I read multiple articles online to understand them and I became confused with the usage of it.

my questions are:

  1. Does a web view perform like a browser and supports browser functionality such as following links, going back and forth with links, submitting forms ?
  2. I read that the web view gives you more control over the UI unlike browsers, so how do I know if the currently open view to me is a web view or not ?
  3. Is it safe to use web views instead of browsers for, for example, login screens, payment pages, anything that is a critical process and what are the scenarios I should use a web view?

Upvotes: 0

Views: 148

Answers (1)

Bhavesh Patadiya
Bhavesh Patadiya

Reputation: 25830

Does a web view perform like a browser and supports browser functionality such as following links, going back and forth with links, submitting forms ?

Yes it does.

I read that the web view gives you more control over the UI unlike browsers, so how do I know if the currently open view to me is a web view or not?

Basically, you can track the instance of UI Widget to decide whether the user is seeing webview component or not.

Is it safe to use web views instead of browsers for, for example, login screens, payment pages, anything that is a critical process and what are the scenarios I should use a web view?

Browser itself is a separate Application. So, In Android app, you anyways have to load the website contents inside Webview. With regards to security, you can follow this link to make sure to follow below-mentioned points. More information you can find HERE

1. Enabling JavaScript

JavaScript execution is disabled by default on WebViews. This behavior is changed with the “setJavaScriptEnabled” function and the first recommendation is to maintain the default behavior if there is no need for client-side scripting. This way, the app becomes resilient to Cross-Site Scripting (XSS) attacks and reduces the consequences of a Man in the Middle (MitM) attack.

2. SSL Error Handling

Improper SSL Error Handling can lead to severe security breaches. By default, a WebView will not load web content if errors are detected during the SSL/TLS negotiation. The most common scenario in which these errors happen is when the server certificate is not signed by a recognized authority.

Upvotes: 1

Related Questions