02 Android+Eclipse

Embed Size (px)

Citation preview

  • 7/28/2019 02 Android+Eclipse

    1/22

    02.Android + eclipse

  • 7/28/2019 02 Android+Eclipse

    2/22

    Outline

    1.Installation of the Android development tools

    2.Standalone ADT installation

    3.Installing Android API version and the source

    code

    4.Updating an existing Eclipse installation

    5.Android installation verification

    6.Tutorial: Create and run Android Virtual Device

    7.Accessing the Android source code in Eclipse

  • 7/28/2019 02 Android+Eclipse

    3/22

    1.Installation of the Android

    development tools

    Android provides a standalone customized

    Eclipse download for Android development or

    the possibility to update an existing Eclipse

    installation with additional plug-ins.

  • 7/28/2019 02 Android+Eclipse

    4/22

    2.Standalone ADT installation

    Google provides a pre-packaged and

    configured Eclipse based Android

    development environment.

    The following link allows to download a

    archive file which includes all required tools

    for Android development.

    http://developer.android.com/sdk/index.html

  • 7/28/2019 02 Android+Eclipse

    5/22

    3.Installing Android API version and

    the source code

    TheAndroid SDK Managerallows you to install

    specific versions of Android.

    Select WindowAndroid SDK Managerfrom

    the Eclipse menu.

  • 7/28/2019 02 Android+Eclipse

    6/22

    3.Installing Android API version and

    the source code

    SelectAvailable packages and open the Third

    Party Add-ons. Select the latest Google

    API(highest number) of the SDK and press

    the Installbutton. The following screenshot

    shows theAPI 16 but if there is a never

    version available install this version.

  • 7/28/2019 02 Android+Eclipse

    7/22

    3.Installing Android API version and

    the source code

  • 7/28/2019 02 Android+Eclipse

    8/22

    4.Updating an existing Eclipse

    installation

    The Android SDK is 32bit, therefore on a 64bit

    Linux system you need to have the

    package ia32-libs installed. For Ubuntu you

    can do this via the following command.

    apt-get install ia32-libs

  • 7/28/2019 02 Android+Eclipse

    9/22

    4.Updating an existing Eclipse

    installation

    Use the Eclipse update manager

    via HelpInstall new software to install all

    available components for the Android

    Development Tools (ADT) from the following

    URL:

    https://dl-ssl.google.com/android/eclipse/

  • 7/28/2019 02 Android+Eclipse

    10/22

    4.Updating an existing Eclipse

    installation

    After the new Android development comp-

    onents are installed, you will be prompted to

    install the Android SDK.

    You can use the following wizard or go to the

    next section to learn how to do it manually.

  • 7/28/2019 02 Android+Eclipse

    11/22

    4.Updating an existing Eclipse

    installation

  • 7/28/2019 02 Android+Eclipse

    12/22

    4.Updating an existing Eclipse

    installation

    After the installation of the ADT the Eclipse

    tooling allows to download the Android SDK

    automatically. Alternatively you can also

    manually download the Android SDK from the

    Android SDK download page.

    http://developer.android.com/sdk/index.html

  • 7/28/2019 02 Android+Eclipse

    13/22

    4.Updating an existing Eclipse

    installation

    The download contains a zip file, which you can extractto any place in your file system, e.g. on my Linuxsystem I placed it into the /home/vogella/android-sdks folder. Avoid using spaces in the path name,

    otherwise you may experience problems with theusage of the Android SDK.

    You also have to define the location of the Android SDKin the Eclipse Preferences. In Eclipse open the

    Preferences dialog via themenu WindowPreferences. Select Android andenter the installation path of the Android SDK.

  • 7/28/2019 02 Android+Eclipse

    14/22

    4.Updating an existing Eclipse

    installation

  • 7/28/2019 02 Android+Eclipse

    15/22

    5. Android installation verification

    The best way to verify that your installation

    did work correctly is to create an Android

    Virtual device.

    Please follow the instructions below and make

    sure that the device actually can start

    otherwise you will face issues during the

    training.

  • 7/28/2019 02 Android+Eclipse

    16/22

    6.Tutorial: Create and run Android

    Virtual Device

    Create AVD

    To define an Android Virtual Device (ADV) open

    theAVD Managerdialog via WindowAndroid

    Virtual Device Managerand press the Newbutton.

  • 7/28/2019 02 Android+Eclipse

    17/22

    6.Tutorial: Create and run Android

    Virtual Device

    Enter the values similar to the following

    screenshot.

  • 7/28/2019 02 Android+Eclipse

    18/22

    6.Tutorial: Create and run Android

    Virtual Device

    Run AVD

  • 7/28/2019 02 Android+Eclipse

    19/22

    7.Accessing the Android source code in

    Eclipse

    During Android development it is useful to

    have access to the Android source code.

    You can download the Android source code

    via theAndroid SDK Managerby selecting

    the Sources for Android SDK.

  • 7/28/2019 02 Android+Eclipse

    20/22

    7.Accessing the Android source code in

    Eclipse

  • 7/28/2019 02 Android+Eclipse

    21/22

    7.Accessing the Android source code in

    Eclipse

    The sources are stored inthe path_to_android_sdk/sources/android-xx directory. . xx is the API level of Android, e.g. 17 forthe Android 4.2 version.

    To connect the sources with the your android.jar file inyour Android project, right-click on your android.jar inthePackage Explorerviewand select PropertiesJavaSource Attachment. Select External location and press

    theExternal Folderbutton. Browser tothe path_to_android_sdk/sources/android-xx locationand press the OKbutton.

  • 7/28/2019 02 Android+Eclipse

    22/22

    7.Accessing the Android source code in

    Eclipse