Sample code, which demonstrates the usage of Chrome Custom Tabs with action buttons, menu items and compares it with opening a webpage in Chrome Browser and WebView.
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
.idea
app
gradle/wrapper
screenshot
.gitignore
ChromeCustomTabs.iml
LICENSE
README.md
build.gradle
gradle.properties
gradlew
gradlew.bat
settings.gradle

README.md

Chrome Custom Tabs

Tutorial on my blog

Sample code, which demonstrates the usage of Chrome Custom Tabs with action buttons, menu items and compares it with opening a webpage in Chrome Browser and WebView.

What is Chrome Custom Tabs

Chrome Custom Tabs is a new way to show third party content in android, which allows you to change how chrome looks and feels making the transition from app to web seemless.

With Chrome Custom Tabs, you can have

  • Toolbar color
  • Start/Exit animation
  • Up button
  • Action buttons
  • Menu items

Sample preview of Chrome Custom Tabs

Usage

  1. Include the gradle dependency
  2. Connecting to browser service
  3. Chrome warmup
  4. Prefetch the webpage
  5. Load the webpage in Chrome Custom Tabs

Keep In Mind

Chrome Custom Tabs is only supported in Chrome browsers which are version 45 & above.

Also google has forgot to add dependency name in their [sample codes on GitHub] (https://github.com/GoogleChrome/custom-tabs-client). The gradle dependency for Chrome Custom Tabs is

compile 'com.android.support:customtabs:23.0.0'

Author

Anjith Sasindran