WebView vs Chrome Custom Tab

Angelo Parente picture Angelo Parente · Mar 9, 2017 · Viewed 18.7k times · Source

I am building an app where in a Detail Activity I have to show a web page. I was going to use WebView, but then I saw Chrome Custom Tab.

What do you guys think it's better to implement and why?

Answer

stamanuel picture stamanuel · Mar 9, 2017

If you just want to show a certain page then I would suggest you use chrome custom tabs. You can style the toolbar in a way it resembles your app style and they are intended for showing content without you having to worry much about anything else.

if you want to have full control over what the user is doing inside this website you have to use a webview. (you can prevent the user clicking links on the webview, you could intercept data the user inputs into controls on the website...) But this can also be a negative aspect since the user really has to trust you that you don't log his data or even fiddle with it.

summary: "The WebView is good solution if you are hosting your own content inside your app. If your app directs people to URLs outside your domain, we recommend that you use Chrome Custom Tabs"

-> If it isn't your website you probably should go with custom tabs.

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