Creating a colored cube with the Google Cardboard SDK

A colored cube seen from inside.

Visit this GitHub repository for a complete, working project with the code presented in this article.

The Google Cardboard and other virtual reality headsets have become pretty popular in the virtual reality community and the general public.

As any consumer level hardware platform, virtual reality headsets live and die with applications that they can be used with - imagine a console like the PlayStation 4 or the Xbox One that supports only a handful of games. Pretty boring, right? …

A tabbed activity that combines a ViewPager and a TabLayout. Navigation is realized by a host fragment for every tab that can replace the currently hosted fragment with another one and keeps track of a separate back stack.

When I wanted to create a tabbed view pager with separate back navigation for every tab, I had to dig through various resources and examples to accomplish exactly what I needed. As I had to do quite a bit of adjusting and tinkering to finally get it all working, I decided to publish this tutorial, representing the quintessence of my research.

I’m always grateful for feedback, so please share your thoughts onthis article or the source code itself in a response below. Note that this is the first tutorial I’ve ever written, so any feedback is more than welcome.


Nilan Marktanner

Understanding the world one person at a time.

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store