Скачать книгу

Mac OS X 10.8.5 or higher, up to 10.9 (Maverick)

      • 2GB RAM minimum, 4GB RAM recommended

      • 400MB hard disk space

      • At least 1GB for Android SDK, emulator system images, and caches

      • 1280 × 800 minimum screen resolution

      • Java Runtime Environment (JRE) 6

      • Java Development Kit (JDK) 7

      • Optional for accelerated emulator: Intel processor with support for Intel VT-x, Intel EM64T (Intel 64), and Execute Disable (XD) Bit functionality

      Linux

      • GNOME or KDE desktop

      • GNU C Library (glibc) 2.15 or later

      • 2GB RAM minimum, 4GB RAM recommended

      • 400MB hard disk space

      • At least 1GB for Android SDK, emulator system images, and caches

      • 1280 × 800 minimum screen resolution

      • Java Runtime Environment (JRE) 6 or higher

      • Oracle Java Development Kit (JDK) 7

      More details about system requirements can be found at https://developer.android.com/sdk/index.html#Requirements.

      Keep in mind that based on the size of the project, number of your dependencies, and emulator usage, you will likely need more resources. Typically, you will need at least 8GB of RAM and GPU support to run an emulator and work smoothly with better compilation times.

      In most cases, developers need to test applications on multiple devices. Because they usually don't have enough devices to test adequately, they rely on emulators. Emulators require a high amount of storage and memory to run faster.

      NOTE

      Emulators are virtual devices, so having a CPU with virtualization support is crucial for developers to get the best experience with Android emulators.

INSTALLING JAVA

      Java is essential for all operating systems. You must install Java SE (Standard Edition) Development Kit (JDK) for your operating system.

      NOTE

      We suggest the Java distribution provided by Oracle. It is possible to encounter problems with OpenJDK or other Java distributions.

      NOTE

      At the time of this writing, Java SE 8 is the latest version of JDK.

The JDK 7 download page can be accessed directly at http://www.oracle.com/technetwork/java/javase/downloads/jdk7-downloads-1880260.html. When you navigate there, the page shown in Figure 1.1 appears.

Figure 1.1 JDK download page

      To download the required installation binary or packages, select the Accept License Agreement option and then click the download link of the binary or package for your operating system.

      The following sections provide installation instructions for Oracle Java version 7 on 64 bit Windows, Mac OS X, and Linux.

      Installing Java for Windows OS

      Java installation on Windows is pretty straightforward. As mentioned in the previous section, installing JDK provides JRE as well.

      NOTE

      Depending on the version of your Windows installation, you need to download and install either the 64 bit or 32 bit version of the JDK. Since most modern computers are equipped with 64 bit CPUs, we will continue with installation of the 64 bit version. If you have a 32 bit Windows installation, use the 32 bit JDK, which is listed as the Windows x86 version.

      Download the jdk-7u79-windows-x64.exe file and run it to start the installation.

      Install Java

Start the Java installation by clicking the jdk-7u79-windows-x64.exe file after downloading it; you will see the dialog box shown in Figure 1.2.

Figure 1.2 Java installation setup wizard

      1. Click the Next button to continue.

      2. In the window that opens, all items are selected by default to be installed on your local hard drive. You can change the installation path and which installation modules to install. For Android application development, the Public JRE and Development Tools options must be selected if they are not already installed on your machine. (If they are already installed, they will not be listed inside the window.) You may deselect Source Code, which is used to install public Java API classes. It is not mandatory to install the source code. Make your selections in the dialog shown in Figure 1.3.

      3. We suggest that you continue with the default selections and use the default installation path, then click Next to finish the installation.

Figure 1.3 Java installation setup window

      Setting Paths for Java on Windows 10

      After the installation finishes, you need to set the Windows 10 environment paths for Java to configure the system environment. You need to set a path for the JAVA_HOME system variable.

      WARNING

      In earlier versions of Windows, the steps for setting the environment path might be a little different.

      1. Right-click the Start menu icon and click File Explorer. In the window that opens, right-click This PC and select Properties to open the System window.

      2. From the options at the left of the System window, select Advanced system settings. This will open the dialog box shown in Figure 1.4 with the Advanced tab enabled.

      3. Click the Environment Variables… button shown in Figure 1.4.

      4. From the Environment Variables window that opens, click the New button and set the Java path with your installation directory. As shown in Figure 1.5, the path is C: \Program Files\Java\jdk1.7.0_79 for our 64 bit installation. If you installed the x86 version, your path would be different, such as C: \Program Files (x86)\Java\jdk1.7.0_79.

Figure 1.4 Java path setup for Windows 10

Figure 1.5 Java Environment Variables setup for Windows 10 64-bit

      Installing Java for MacOS X

      Java used to be a part of Mac OS X and was shipped by Apple. This changed several years ago. Apple also decided to remove Java from Mac OS so JDK, which is provided by Oracle, needs to be installed separately.

      1. Start by downloading the jdk-7u79-macosx-x64.dmg file from the page shown in Figure 1.1.

      2. Launch the dmg file to display the window shown in Figure 1.6.

      3. Double click the JDK 7 Update 79.pkg file link to start the installation.

      4. Select the

Скачать книгу