Availability:Public Title: Android Development Reference Crumbs:%ROOT%, Platforms, Platforms/Android Description:How to install different Android SDKs, set environment variables, and work with texture formats. [TOC(start:2 end:3)] %Globals:OSSelect% ## Overview Here is what we currently require for Android game development: |Project Type | Components | Environment Variables | | ------------- | ---------- | --------------------- | | Blueprint Only Projects | [INCLUDE:#bpcomponents] | [INCLUDE:#bpenvvar] | | C++ Projects | [INCLUDE:#codecomponents] | [INCLUDE:#codeenvvar] | ## Installing Components There are several methods for getting the components. If you have already installed one of these, look in the corresponding section for additional requirements: ### TADP (Tegra Android Development Pack) [OBJECT:ToggleButtonContent] [PARAMLITERAL:category] OS [/PARAMLITERAL] [PARAMLITERAL:id] windows [/PARAMLITERAL] [PARAMLITERAL:active] active_button_content [/PARAMLITERAL] [PARAM:content] [INCLUDE:#TADPWindowsSetup] [/PARAM] [/OBJECT] [OBJECT:ToggleButtonContent] [PARAMLITERAL:category] OS [/PARAMLITERAL] [PARAMLITERAL:id] mac [/PARAMLITERAL] [PARAMLITERAL:active] [/PARAMLITERAL] [PARAM:content] [INCLUDE:#TADPMacOSSetup] [/PARAM] [/OBJECT] ### ADT (Android Development Tools) This is Google's recommended development environment. It contains the SDK, Ant, and Eclipse (which you may want to use for your own tools, but we do not support Eclipse with Unreal Engine 4). We recommend you install everything into C:\Android for simplicity. * [Download it here](http://developer.android.com/sdk/installing/bundle.html). In addition, you will need to install JDK 6 or later. * [Download it here](http://www.oracle.com/technetwork/java/javase/downloads/index.html). For code projects only, you will need to install the NDK: * [Download it here](http://developer.android.com/tools/sdk/ndk/index.html). ### Android SDK (Software Development Kit) This is a more bare bones installation of the SDK (it does not include Eclipse or Ant). * [Download it here](http://developer.android.com/sdk/index.html). In addition, you will need to install JDK 6 or later. * [Download it here](http://www.oracle.com/technetwork/java/javase/downloads/index.html). You will need to install the Ant tool (version 1.8 or later). * [Download it here](http://ant.apache.org/) then unzip the .zip file. For code projects only, you will need to install the NDK: * [Download it here](http://developer.android.com/tools/sdk/ndk/index.html). ## Environment Variables [OBJECT:ToggleButtonContent] [PARAMLITERAL:category] OS [/PARAMLITERAL] [PARAMLITERAL:id] windows [/PARAMLITERAL] [PARAMLITERAL:active] active_button_content [/PARAMLITERAL] [PARAM:content] [INCLUDE:#ENVWindowsSetup] [/PARAM] [/OBJECT] [OBJECT:ToggleButtonContent] [PARAMLITERAL:category] OS [/PARAMLITERAL] [PARAMLITERAL:id] mac [/PARAMLITERAL] [PARAMLITERAL:active] [/PARAMLITERAL] [PARAM:content] [INCLUDE:#ENVMacOSSetup] [/PARAM] [/OBJECT] ## Android Tips and Tricks [OBJECT:ToggleButtonContent] [PARAMLITERAL:category] OS [/PARAMLITERAL] [PARAMLITERAL:id] windows [/PARAMLITERAL] [PARAMLITERAL:active] active_button_content [/PARAMLITERAL] [PARAM:content] [INCLUDE:#ATTWindowsSetup] [/PARAM] [/OBJECT] [OBJECT:ToggleButtonContent] [PARAMLITERAL:category] OS [/PARAMLITERAL] [PARAMLITERAL:id] mac [/PARAMLITERAL] [PARAMLITERAL:active] active_button_content [/PARAMLITERAL] [PARAM:content] [INCLUDE:#ATTMacOSSetup] [/PARAM] [/OBJECT] ## Android Texture Formats Not all Android devices are made the same. In particular, there are 4 different kinds of rendering hardware. They each support different formats of compressed textures. [EXCERPT:AndroidFormats] |Format | Description| |-------|------------| |DXT |This is what your desktop computer uses, and used by Tegra-based devices.| |ATC |This is used in Qualcomm Snapdragon based devices.| |PVR |This is used in ImgTec PowerVR based devices.| |ETC1 |This is supported on all devices, but does not support textures with an alpha channel, so those textures are uncompressed, making your game's download large and use more runtime memory.| |ETC2 |This is used by MALI based devices and some others.| [/EXCERPT:AndroidFormats] When you deploy or package your game for Android, the data will be converted to a format usable by an Android device (we call this process "cooking"). Because different devices support different compressed formats, you have a choice of what format you want to be cooked. In the **Launch** or **Package** submenu, you will see **Android** followed by the possible formats. The first one (**Android**) actually takes all formats and puts them into the cooked packages. This will take longer, and will make larger packages, but will guarantee the minimal memory usage by choosing the best format at runtime. It will work on any device (as will **Android (ETC1)**). ### Choosing a Format You most likely will want to choose an optimal format for your device. If you know the type of GPU in your device, you can look at the table above to choose a format. However, if you do not know, then you can choose **Android** or **Android (ETC1)**. When you run the game, if you tap the screen with 4 fingers at once, a dialog will pop up. This dialog is usually used to enter a console command (like `stat fps`), but it will also display the formats that your device supports. Once you have that list, you can use that to choose a more ideal type when deploying/packaging. If you choose a format that your device does not support, it will fail to load.