Getting Started With Developing Virtual Reality Apps Using Google Cardboard
Google recently gave away their newest version of the Cardboard viewer at Google I/O 2015. It consisted of an updated cardboard frame, lenses and an improved activation button. It works with all modern, high-end smart phones. Cardboard applications present a stereo 3D rendering of scenes on your phone. With Cardboard the user can view and develop realistic “experiences,” becoming immersed in an interactive virtual reality (VR) world. Cardboard is similar in function to other VR systems, such as Oculus Gear VR.
The Cardboard apps for Android are mostly demos that introduce users to the viewer; however, the Cardboard app for Google Earth is functional and realistic. Using Google Earth and starting in Chicago, I traveled west, at high altitude, to San Francisco. Once there, I descended to street level (about 100 ft up) and flew around the city. The app renders pretty fast, although filling out the buildings took a couple of seconds, as I hovered in one place. I then journeyed to Portland and flew around downtown. In all, the Cardboard app gives a good feel for basic VR functions.
Developing For Cardboard
You’ll clearly need to have experience coding regular applications for Android and/or the iPhone before you are able to tackle building a virtual reality experience with Cardboard.
The following are a few places to check if you want to start to transition over from regular app development on an Android to VR development with Google Cardboard:
- Developer’s overview for Cardboard: If you want to develop apps, like the VR version of Google Earth, you should start out here. You’ll find listings of the various software developer kits (SDK), with much of what you need to get applications working baked in.
- Treasure Hunt: Google suggests initially working with this demo app to learn the basic calls to CardboardActivity and other functions.
- CardboardActivity: This is the base activity for VR rendering with Cardboard.
- Unity Gaming Engine: Likewise, if you want to develop VR games there’s a lot of interest focused on this development platform. Google offers an SDK for that as well.
- PCWorld: If you need a quick refresher on VR, there’s a pretty comprehensive review of current VR concepts, capabilities, and limitations over here.
- VR best practices: The new layer of software functions needed for VR experiences on a smart phone include concepts you generally wouldn’t consider for regular old Android apps. The developer site has a whole section devoted to VR best practices and physiological considerations. For example, in a typical VR app you’ll need to account for head tracking; when the user looks through the viewer and turns their head, the gyroscopes and accelerometers in the phone register the movement and render new scenes, depending on direction and the speed of the turn. It gets tricky, because you have to make sure there isn’t any lag or lack of tracking, because if that happens, the user could experience an unpleasant sensation of imbalance or even nausea. The libraries and functions in the SDK take those kinds of things into account.
Then there are controls. When looking through the Cardboard viewer, how do you control the behavior of the app? You certainly don’t want to take the phone out, push a button, then put it back in the viewer to continue using the app.
One suggested solution is to use a fuse button. The idea is to display a button that you focus on for a short period of time, resulting in a push. Fuse buttons are used in the Cardboard app to chose which demo you want to view.
Another example shows up in the Cardboard app when you want to return to the home screen. Simply tilt the view on end and it goes back to the first screen.
Using the Cardboard viewer is pretty cool. Starting from scratch to build VR apps for the thing is fairly involved and you need to know quite a bit about programming for mobile devices before you get started.
The good thing is that Google has put Cardboard out there and made the backend stuff available so developers can get started learning the technology at a fairly low cost.
Who knows where it will go at this point, since affordable VR is pretty new. A lot of companies are selling their viewers, and it will be interesting to see how Google’s experiment in VR pans out.
VR might be the next big thing.