cylonid / NativeAlphaForAndroid

GNU General Public License v3.0
599 stars 58 forks source link

Chrome Custom Tabs as optional WebView holders #4

Open linuxct opened 3 years ago

linuxct commented 3 years ago

Opening this issue to further discuss this idea: Have you considered an option to enable Chrome Custom Tabs as a method to display a desired web page?

If you find this option would be a nice addition to NativeAlpha, I'm willing to implement it myself and submit a PR.

linuxct commented 3 years ago

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

cylonid commented 3 years ago

Thanks, I did not know this Chrome feature beforehand. Had a quick look over the documentation but so far I do not see any major advantages over the WebView approach.

Apparently, the biggest advantage is a performance boost, but that is only true in very certain scenarios. Say we have an activity screen with a button named "Open my webshop" which should open a website with the webshop. In this scenario, the custom tab approach is great because it allows to preload the page even though the user is still on the activity and has not clicked on the button. But as soon as he does, the webshop will open in an instant. This is basically the scenario shown on the doc page.

However, this will never occur in Native Alpha, right? I have no clue (apart from behaviour tracking which is not an option obviously) which Web App the user will open next so there is no point in preloading anything.

Regarding other points mentioned:

So all in all I am not convinced this approach would work better than with WebViews. Perhaps you can elaborate a bit more on possible advantages?