Time for action – downloading Java, the Android SDK, and the ODK
The first component we'll need is the Java Development Kit (JDK) and Java Runtime Engine (JRE) to handle the Java-side of the OUYA console. Because these are common packages, you may already have them installed on your computer; to check this, open a command line (Command Prompt in Windows or Terminal in Mac) and type the command javac -version
. If a version number is displayed, skip over step one of this section and move on to downloading the Android ADT bundle. If you receive an error message that reads "command not found", continue with these steps to install the JDK and JRE.
- Download and install the JDK and JRE, both of which are available on the Oracle website at http://www.oracle.com/technetwork/java/javase/downloads/index.html.
The download links will be in the middle of the page, as shown in the following screenshot, with a Server JRE download button between them that you can ignore:
- Once you've downloaded and run the installers, you'll need to download the Android SDK/ADT bundle, which can be found at http://developer.android.com/sdk/index.html.
When installing, you'll want to put everything into a folder called
Development
in your root directory so that if you're using Windows, the full path of the bundle will appear asC:\Development\adt-bundle-windows-x86_64
. If you're using Mac OS, put it in your home directory so that it appears as~/Development/adt-bundle-mac-x86_64
. This is important because later, you'll need to change your computer's PATH variable to point to that location. - Create a new OUYA developer account by navigating to the developer portal at https://devs.ouya.tv/developers and clicking on Sign in to download the OUYA Development Kit. Click on Sign up on the following page and follow the instructions to create your OUYA developer account.
The Sign up button is directly below the login area on the Sign in page, as shown in the following screenshot:
- Finally, download the OUYA Development Kit from the front page of the developer portal. When you unpack it, put it in your
Development
folder so that its path isDevelopment\OUYA-ODK
.
What just happened?
The Java packages you installed first are necessary for building a game on OUYA, even though you won't be programming in Java; we'll demonstrate the application of the JDK in a later tutorial.
You'll be developing with the API included in the Android SDK/ADT bundle. The OUYA OS is based on Android, which means that there are similarities between it and other devices that run some version of Android. The OUYA Development Kit, on the other hand, is for everything OUYA-specific in development, such as controller input or in-app purchasing. The packages you've downloaded so far are in your Development
folder, which we will now add to your computer's PATH variable so that the command line recognizes it.