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 MainActivity class

The default project generated with Empty Activity also created a default MainActivity.java file. In the hierarchy pane, locate the app/java/ directory that contains a subdirectory named com.cardbookvr.skeleton.

Note

Note, this is different than the androidTest version of the directory, we're not using that one! (Your name may vary based on the actual project and domain names given when you created the project.)

In this folder, double-click on the MainActivity.java file to open it for editing. The default file looks like this:

package com.cardbookvr.skeleton; import ... public class MainActivity extends AppCompatActivity { @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_main); ...

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