Design Support Library (current method).
The Design Support Library includes the TabLayout
widget which allows you to implement a Google Play-lie tabs:
<android.support.design.widget.TabLayout
android:id="@+id/tabs"
android:layout_width="match_parent"
android:layout_height="wrap_content" />
and then initializing it:
TabLayout tabLayout = (TabLayout) findViewById(R.id.tabs);
tabLayout.setupWithViewPager(viewPager);
For a full example see the Cheesesquare app
PagerSlidingTabStrip Library
This is a ready-to-use library that you can find on Github.