Chrome Web Browser and User Tab

I am creating an application where in a detailed action I have to show a web page. I was going to use WebView, but then I saw the Chrome Custom tab.

What do you guys think is best to implement and why?

+8
source share
2 answers

If you just want to show a specific page, I suggest you use custom chrome tabs. You can stroke the toolbar so that it resembles your application style, and they are designed to display content without having to worry about anything else.

if you want to have full control over what the user is doing on this website, you need to use web browsing. (you can prevent the user from clicking links to the web view, you can intercept the data that the user enters into the controls on the website ...) But this can also be a negative aspect, since the user really needs to trust you that you are not registering his data and do not even play with him.

summary: "WebView is a good solution if you host your content inside your application. If your application directs people to URLs outside your domain, we recommend that you use custom Chrome tabs."

-> If this is not your site, you should probably go with custom tabs.

https://developer.chrome.com/multidevice/android/customtabs#whentouse

+15
source

Web browsing: if you want your own content to have click listeners and data capture, you need to go to web browsing. But this will not share the state with the browser.

Chrome custom tab: if you just redirect to a URL, I prefer the Chrome custom tab. But he also has few drawbacks. We will not change the color of the title text, where we can change the color of the title. The color of the text will be selected only by the color of the theme. And we can add actions, but we cannot change the overflow menu icon or all the actions displayed in the overflow action. Although the restrictions do not matter much. I recommend Chrome Custom Tab via webview.

0
source

Source: https://habr.com/ru/post/1015605/


All Articles