Eclipse Android Development Environment

From HaFrWiki42
Jump to navigation Jump to search

Eclipse IDE can be used for creating Android Applications and emulating/testing using Genymotion. The implementation in Eclipse in based on:

  • Plugins for Eclipse:
    • Android Developement Tools Plugin
    • Genymotion plugin.

Both plugins require installed tooling (See the pre-requirements). The Genymotion emulator is also depended on the Oracle VirtualBox without the need of a VirtualBox plugin).

Pre Requirements

Installing and using the ADT plugin in Eclipse has dependencies with other tools. These tools have to be installed prior to the installation of the Eclipse Plugin.
NB: Please note that the installation of these tools depends on the Operation System.

  • Android Developer Tool [1][2].
  • Oracle VirtualBox [3].
  • Genymotion [4].
    Registration for Gemymotion is required. The UID/PWD are needed when installing/using the Genymotion-plugin for Eclipse.
  • Genymotion Eclipse plugin.

Download the ADT Plugin

Eclipse Android Installation


To add the ADT plugin to Eclipse:

  • Start Eclipse, then select Help > Install New Software.
  • Click Add, in the top-right corner.
  • In the Add Repository dialog that appears, enter "ADT Plugin" for the Name and the following URL for the Location:
    https://dl-ssl.google.com/android/eclipse/
    Note: The Android Developer Tools update site requires a secure connection. Make sure the update site URL you enter starts with HTTPS.
  • Click OK.
  • In the Available Software dialog, select the checkbox next to Developer Tools and click Next.
  • In the next window, you'll see a list of the tools to be downloaded. Click Next.
  • Read and accept the license agreements, then click Finish.
  • If you get a security warning saying that the authenticity or validity of the software can't be established, click OK.
  • When the installation completes, restart Eclipse.

Configure the ADT Plugin

Once Eclipse restarts, you must specify the location of your Android SDK directory:

  • In the "Welcome to Android Development" window that appears, select Use existing SDKs.
  • Browse and select the location of the Android SDK directory you recently downloaded and unpacked.
  • Click Next.

Your Eclipse IDE is now set up to develop Android apps, but you need to add the latest SDK platform tools and an Android platform to your environment. To get these packages for your SDK, continue to Adding Platforms and Packages.

Oracle VM VirtualBox

Genymotion operation relies on the use of Oracle VM VirtualBox in the background.
This enables virtualizing Android operating systems.
If you do not already have Oracle VM VirtualBox installed on your computer, you will be asked to do so prior to installing Genymotion.

VirtualBox is a cross-platform virtualization application. What does that mean? For one thing,

  • First it installs on your existing Intel or AMD-based computers, whether they are running Windows, Mac, Linux or Solaris operating systems.
  • Secondly, it extends the capabilities of your existing computer so that it can run multiple operating systems (inside multiple virtual machines) at the same time.
    So, for example, you can run Windows and Linux on your Mac, run Windows Server 2008 on your Linux server, run Linux on your Windows PC, and so on, all alongside your existing applications.
    You can install and run as many virtual machines as you like – the only practical limits are disk space and memory.

To emulate an Android do in Virtualbox, configure a Virtual Machine that abides to these specs:

  • OS: Linux – Linux 2.6
  • Memory Size: 512 MB
  • Hard Drive Size: 3 GB or More

But before doing that, Genymotion is doing that for you, so you do not have to create a virtual machine by yourself.

Install Genymotion

First install Genymotion. To be able to download the software you have to be registered. After registration and activating your account the software wil be automatically downloaded. For Mac OS/X this will be a installtion package (dmg file).

If Oracle VirtualBox and Genymotion are installed, it is possible to start Genymotion.

Eclipse

Prerequirements

Installed Android Toolkit
  • Eclipse 3.7.2 (Indigo) or greater
    Note: Eclipse 3.6 (Helios) is no longer supported with the latest version of ADT.
  • Eclipse JDT plugin (included in most Eclipse IDE packages)
  • JDK 6 (JRE alone is not sufficient) or higher.
  • Not compatible with GNU Compiler for Java (gcj)

I have a working installation with Eclipse Luna 4.4.1, Java 1.8.0_25-b17, Android Development Toolkit Version: 23.0.4.1468518

Installation

To install Genymotion plugin for Eclipse.

  1. In Eclipse, go to Help > Install new software and click Add.
  2. Fill in the fields with Genymotion name and http://plugins.genymotion.com/eclipse location.
  3. Under Genymobile, check Genymotion and Genymotion Eclipse Tools and follow the steps indicated by Eclipse.

ADB

Android Debug Bridge (adb) is a versatile command line tool that lets you communicate with an emulator instance or connected Android-powered device. It is a client-server program that includes three components:

  • A client, which runs on your development machine. You can invoke a client from a shell by issuing an adb command. Other Android tools such as the ADT plugin and DDMS also create adb clients.
  • A server, which runs as a background process on your development machine. The server manages communication between the client and the adb daemon running on an emulator or device.
  • A daemon, which runs as a background process on each emulator or device instance.

See more information:

  1. http://developer.android.com/tools/help/adb.html, Home page of the ADB.

See also

top

  • SlideShare, Slide Show Eclipse and Genymotion, Android Rock by Michael Pan. Gives the user a step by step guide how to install and use the Android plugin in Eclipse.
  • Genymotion, Developers User Guide.

Reference

top

  1. Android Developer, Installing the Android Developer Tool (ADT).
  2. ADT Install SDK Tools
  3. Virtualbox, Oracle Virtual Box download.
  4. Genymotion, Android emulation.