Android Environment and Set Up

From RidgeRun Developer Connection
Jump to: navigation, search

Introduction

This wiki has important and critical information about the needed stuff to start developing in Android, and specifically for the RidgeRun's Mobile Framework. If you plan to use the Framework for developing your own custom application, please carefully read the contents of this wiki.

IDE for Development

Usually, develop mobile applications require several files to provide the proper build and deployment system. Because of this, an automated IDE that holds those is used to ease the process. In the past, the Eclipse IDE was the only way of develop Android application, however Google knew this wasn't the proper way therefore they launched Android Studio as the only official and recommended way to develop for Android.

Android Studio is based on Gradle build system. More information about it can be found here: http://gradle.org/getting-started-android-build/

One advantage that Gradle provides, is apps run from Android Studio, from command line or even from continuous integration servers.

The basic work of Android Studio is performed by IntelliJ IDEA (https://www.jetbrains.com/idea/) which has all the utilities needed to work with Java code.

Android Studio Set up

The last version of the IDE can be downloaded from https://developer.android.com/studio/index.html

Once it is downloaded, you just need to decompress it on a known path and run it. Usually the binary to run is located at:

<DECOMPRESSED_PATH>/bin/studio.sh

The recommended path (in order to simplify other reads) is at:

$HOME/Android-Developer/Android-Studio

Android Studio Minimum Requirements

The user must meet the next requirements to properly run Android Studio.

- GNOME or KDE desktop

- Tested on Ubuntu® 12.04, Precise Pangolin (64-bit distribution capable of running 32-bit applications) 64-bit distribution capable of running 32-bit applications

- GNU C Library (glibc) 2.11 or later

- 2 GB RAM minimum, 8 GB RAM recommended

- 2 GB of available disk space minimum,

- 4 GB Recommended (500 MB for IDE + 1.5 GB for Android SDK and emulator system image)

- 1280 x 800 minimum screen resolution

- Java Development Kit (JDK) 8

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

On Linux distributions is quite common to find OpenJDK instead of Oracle's. Google recommends to usage of Oracle's, although there were no big issues when running with OpenJDK.

An important read for developers that will use Android Studio: https://developer.android.com/studio/intro/index.html

Android support for C/C++ libraries and apps

Even though Google and Android discourage the usage of low-level languages such as C and C++ on the applications, there is an experimental support for it called NDK that stands for Native Development Kit which at same time uses the Java Native Interface, a concept be explained later on.

On the previous supported Eclipse IDE, NDK was completely supported, nevertheless as it usually comprises hard work compiling and setting up everything to work adequately it's usage has been decreased. Nevertheless using it is sometimes essential as the Java Libraries not always provide the needed means to perform a required action, as in this RidgeRun framework.

The NDK

Android NDK Set up

Download and install

The last NDK revision can be downloaded from here: https://developer.android.com/ndk/downloads/index.html

Once downloaded, just unzip to a known location. This location will be needed several times when developing an app with Native code usage. The recommended path to install it is at:

pre> $HOME/Android-Developer/Android-NDK

Some useful hints: https://developer.android.com/ndk/guides/setup.html

Please notice that many of the steps on the above web page are aimed to Eclipse, so they are not needed for Android Studio.

There is also a complete user guide to develop with NDK: https://developer.android.com/ndk/guides/index.html