Install and configure Java SDK and Android SDK

Follow this procedure to install and configure the Java SDK and Android™ SDK. Once configured, the Tools > Android Tools menus are enabled in Genero Studio.

Before you begin:
  • If a proxy is needed on your network, it must be defined in Tools > Preferences (or, if you are on a Mac, Genero Studio > Preferences).

You must configure for the Java and Android SDKs.

  1. Download the Java Standard Edition Software Development Kit and install it to a location of your choice.
    Important:

    JDK version 8 is required to build Android apps. For the latest information regarding system requirements and Java support, please refer to the Supported platforms and databases document, available on the "Products" download page of the Four Js Web site.

    To download the Java package, visit http://www.oracle.com/technetwork/java/javase/downloads/index.html. Choose the Java package (32 bit or 64 bit) that matches your Genero installation (32 bit or 64 bit).
    Note: Genero Mobile requires Java SE Development Kit. To identify version requirements, refer to the Supported platforms and database document found on the Four Js Web site.

    Make a note of the installation path.

  2. Launch Genero Studio.
  3. Select Tools > Genero Configurations to open the Genero Configuration Management window.
  4. Set the JAVA_HOME variable to the location of the Java SDK directory. To edit the JAVA_HOME environment variable, select an Android configuration, highlight the Java SDK environment set, and double-click the JAVA_HOME environment variable.
    Figure: Set Java environment

    Genero Hosts Management Java SDK environment set
  5. Set the ANDROID_HOME variable to the location where you want to install the Android SDK, for example C:\Android\android-sdk. To edit the ANDROID_HOME environment variable, highlight the Android environment set, double-click the ANDROID_SDK_ROOT environment variable, change the name to ANDROID_HOME, and edit the value to point to the Android SDK directory.
    Note:

    Setting ANDROID_HOME is not mandatory, and keeping ANDROID_SDK_ROOT should still be fine. However, all procedures have been updated to promote the use of ANDROID_HOME over ANDROID_SDK_ROOT.

    Note:

    On Windows, it is recommended to set ANDROID_HOME to a location outside of the Program Files directory. If you install Android SDK in the Program Files directory, Genero Mobile must be run as administrator to auto-configure the SDK.

    Figure: Set ANDROID_HOME in Android environment (formerly ANDROID_SDK_ROOT)

    Genero Hosts Management Android SDK environment set with ANDROID_SDK_ROOT highlighted.
  6. In the ANDROID_HOME directory, create a subdirectory called cmdline-tools.
  7. In the PATH variable of the Android environment set, ensure that $(ANDROID_HOME)\cmdline-tools\latest\bin is included, and add it if it is not.
    Important:

    If you are using the default Android environment set, or if you made a copy in the past, you may need to edit the directory set to change all occurrences of $(ANDROID_SDK_ROOT) to $(ANDROID_HOME).

    Figure: Verify PATH in Android environment set

    The "Edit Environment variable" dialog is opened for the PATH variable. The browser icon is highlighted, which opens the "Edit directories" dialog (indicated by a red arrow). The "Edit directories" dialog is shown with "$(ANDROID_HOME)\cmdline-tools\latest\bin" highlighted.
  8. Download the Android Software Development Kit (SDK).
    1. Go to http://developer.android.com/studio/index.html#command-tools
    2. Find the Command line tools only section.
    3. Download the installer zip file for your operating system.
    4. Unzip the installer file into the ANDROID_HOME/cmdline-tools directory.
      Warning: On Windows®10, the default zip tool corrupts the Android Command Line Tools zip archive. Use another zip program, such as 7zip.

      If the Android SDK Manager launches, close it.

    5. Rename ANDROID_HOME/cmdline-tools/cmdline-tools to ANDROID_HOME/cmdline-tools/latest. The path to find command line tools binaries must be ANDROID_HOME/cmdline-tools/latest/bin.
  9. In the Configuration Name list, right-click on the Android configuration and select Set Genero Configuration Active.
  10. Select OK to save the changes and close the Genero Configuration Management window.
  11. Select Tools > Android Tools > Auto-configure Android SDK. Update progress is written to the Output view.
    When prompted, answer 'y' to any question. This step can take several minutes.
    Important: It is recommended to run Auto configure Android SDK regularly to ensure you have the latest SDK updates. The Auto configure Android SDK tool upgrades Android SDK and add-ons to the latest version.
  12. You are now ready to setup your Android physical or virtual device. See Display to an Android physical device or Display to an Android virtual device.

You need an internet connection the first time you build an Android package. During this first build, an automated process downloads and installs Gradle with all necessary extensions into a directory in your user directory. Gradle is a project automation tool; find out more at http://www.gradle.org.