O'Reilly logo

Cardboard VR Projects for Android by Matt Schoen, Jonathan Linowes

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

The activity_main.xml file

Our app needs a layout where we'll define a canvas to paint our graphics. The new project created by Android Studio makes a default layout file in the app/res/layout/ folder (using the Android view or app/src/main/res/layout using the Project view). Find the activity_main.xml file and double-click on it to edit it.

There are two views of a layout file in the Android Studio editor: Design versus Text, selected by tabs on the lower-left hand side of the window pane. If the Design view tab is selected, you'll see an interactive editor with a simulated smartphone image, a palette of UI components on the left-hand side, and a Properties editor on the right-hand side. We're not going to use this view. If necessary, select the ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required