FREELessons: 8Length: 41 minutes

Next lesson playing in 5 seconds

Cancel
  • Overview
  • Transcript

1.2 Set Up the Cardboard SDK and Sample Project

In this lesson, I’ll show you how to get Android Studio ready for Cardboard SDK development. We’ll download the Cardboard library jar file and clone the sample project from GitHub. Finally, we’ll create a new project in Android Studio and import the sample project for further exploration.

Related Links

1.2 Set Up the Cardboard SDK and Sample Project

Hello, welcome back to the Tuts+ VR for Google Cardboard on Android course. My name's Sue Smith. In this course we are exploring how to build VR content for Android using the Cardboard SDK. We'll be using Android Studio, so install it now if you haven't already done so. Our app will be targeting version 19 of the Android SDK. And to run it you'll need a physical Android device running at least Jellybean, that's version 16 of Android. To try out the fill functionality even you'll also need a Cardboard viewer. In order to develop with the Cardboard SDK we need the client libraries from Google. Visit the Cardboard SDK GitHub repository in your web browser. You can find a link to it on the Google Developers Get Started page for Cardboard. And the cardboard.jar file is in the libs folder. If you click the Raw button your browser will download the file. Whenever you create a new Android app for Cardboard, you'll need to copy this into your apps libs folder. We'll see that when we import the sample project next. But for the moment, keep your cardboard.jar file in your system so that you can use it later. Let's look at the sample project now. We can clone it from GitHub. Open a terminal on your system. I'm using Linux here. Clone the Google sample on to your local system. And this is the same repository that we download the jar file from. Once you have it downloaded you can import into a new application project in Android Studio. Choose File > New > Import. And navigate to the sample you cloned from GitHub. Select the build.gradle file at the root directory [INAUDIBLE]. Android Studio will build the sample project. At this point you may see some errors if the sample expects different versions of the Android Studio components than what you have installed. If that happens just click the links in the log messages that appear and follow the instructions to sync your software until your environment is set up for the sample. In the next lesson we'll explore the project in detail. But for now, just notice that if you open the project explorer, choose Project from the drop down list to show the file structure, open the app, and the libs directory, you see the cardboard.jar file. When you're ready to create your own projects, you'll copy that file into the libs folder for your own apps. At this stage you should be able to run the sample app on a physical Android device. So if you connect one now you can try it. This scene presents a floor shape with a cube floating above it. When the user looks at the cube it changes color. And when the user presses the trigger, the app presents some overlay text and moves the queue. Next, we'll look at the component parts in the sample app.

Back to the top