Installing java, eclipse, and android sdks to setup an android development environment



Download 28.25 Kb.
Date19.06.2017
Size28.25 Kb.
#21039
INSTALLING JAVA, ECLIPSE, AND ANDROID SDKs TO SETUP AN ANDROID DEVELOPMENT ENVIRONMENT


ABSTRACT


This document describe a process to install Eclipse, the necessary Android SDKs, and plug-ins that will allow you to develop, debug, and test Android applications. There are many different articles that have been written describing the installation process. I have culled these articles to produce the following process derived from the following sources primary sources among others:

  • The following document is one of the better documents that I have found. It assumes that you have already installed Java. It also refers to an older version of Eclipse than the one I am using. http://www.instructables.com/id/How-To-Setup-Eclipse-for-Android-App-Development/.


  • The following article talks about how to install the Android SDK http://www.androidauthority.com/how-to-install-android-sdk-software-development-kit-21137/. It’s a little bit dated and incomplete.


  • Some of the instructions from https://developer.google.com are useful. However, they are geared for development in Android Studio. However, they do explain how to install the Android SDKs and the SDK versions.

Key Terms


  • The Android Software Development Kit (SDK) is the set of Android libraries needed to create Android applications.


  • The Android SDK Manager is the tool used to install different Android SDK versions on your computer. There are several SDK versions.


  • An Android Virtual Device (AVD) is an emulator with which you can run Android applications on Windows and other computers.


  • Eclipse is an integrated development environment with which you create Java, Android, and other applications. Mars is the current version of Eclipse.


  • Java is a programming language originally developed by Sun Microsystems. Android applications are written in Java.

Installation Overview


The installation protocol described in this document involves performing the following steps, in sequential order:

  • Install Java SE Development Kit 8uXX. Note that these builds are updated constantly. Substitute the current version number for XX.

  • Install Eclipse MARS. This is the current version of Eclipse

  • Download and install the Android SDK Manager and AVD Manager.

  • Install the necessary SDK packages (versions)

  • Connect the Android SDK Manager and AVD Manger to Eclipse.

  • Configure an emulator.

  • Test the development environment by creating a Hello World application.

Development Environment Options


As you develop Android applications, there a few options from which you can choose for the development environment.

  • You can run Eclipse, and install the required Android Software Development Kit (SDK), and the Android Development Tools (ADT). This is the option discussed in this document.




  • You can run Android Studio. This is Google’s preferred way of developing Android Apps. We do not use Android Studio in the COBA labs because some conflicts between the development environment and user profiles make it difficult to move workspaces from one machine to another. However, you can use Android Studio in this course if you like. However, be advised that it’s tricky to move projects from Android Studio to Eclipse, and back.


  • You can develop Android (and IOS) applications in C# using 3rd party development tools such as Xamarin. But Xamarin is not free beyond a trial period. There are other 3rd party tools too. Xamerin provides an interesting option because you develop applications in .NET using .NET languages such as C#.

Installing Java


First, Java must be installed in your computer. In addition, you must have the Java SE Development Kit. The JRE (runtime) edition will not work. Download it from the following URL:

http://www.oracle.com/technetwork/java/javase/downloads/jdk8-downloads-2133151.html

The version numbers are constantly changing. Download the 8uXX version. Any of the current versions should work. It’s here that you should also decide whether you want to run the 32 bit or 64 bit version of Java, and the subsequent Android tools. I have been using the 64 bit versions for my development but either should work fine.



  1. Note that you must accept the license agreement before downloading the installer.


  2. The installer is straight forward. You can accept all of the default installation options upon running the .exe file.

HANDS-ON ACTIVITY – Determining the Java version

There is a very simple test to determine whether Java is working or not.



  1. Open a Command window and enter java –version. You should see version information similar to the following. The examples in this document are all configured for JRE 1.8.*. They should run on 1.7.* too.


Installing Eclipse (MARS)


This step describes how to install Eclipse. Eclipse is the development platform with which you will develop Java and Android applications in this course. In this regard, Eclipse fulfills the same role as Visual Studio. Note the following about the Eclipse installation:

  • Unlike most applications, prior versions of Eclipse were distributed as .zip files. You can just extract the .zip file to get a working version of Eclipse. You can continue to use this option for the MARS version if you choose.


  • The latest version of Eclipse has an installer. This installation document assumes that you are using the Eclipse installer.


  • To install many of the add-ins, you must run the program as the administrator.


  • This document also assumes that you install Eclipse in the default directory. I suggest that you do not change the path name. This will maximize portability from one computer to the next.


  • The following steps assume that you are downloading the MARS edition.

HANDS-ON ACTIVITY – Installing Eclipse

  1. Download and run the installer from http://www.eclipse.org/downloads if you have not already done so. The following installation screen should appear.



  1. Select the option Eclipse IDE for Java Developers.


  2. In the steps that follow, I suggest you create a Start menu entry and a desktop shortcut.


  3. When the installer finishes, Eclipse should start.


  4. Exit Eclipse. If you are asked for a default workspace, select the default workspace, and then exit Eclipse.

Installing the Android SDK Manager


The Eclipse distribution that you just installed is now ready to develop Java applications. However, it does not contain the (Software Development Kits) SDKs needed to develop Android applications. The Android SDK is a collection of Java libraries that allow you to develop Android applications.

HANDS-ON ACTIVITY – Installing the Android SDK Manager

  1. Visit http://developer.android.com/sdk/index.html. Note that this page contains options to install the Android Studio development platform, or just the SDKs designed for use with Eclipse, or other applications.


  2. Scroll down until you see the following section. I downloaded and executed the Windows installer. (Installer_r24.4.1-windows.exe). Again, these version numbers change frequently.




  3. Note that the installer will check that the necessary version of the Java Development environment is installed. If Java is not, the installer will fail.


  4. Note that the SDK is stored in the folder C:\Program Files (x86)\Android\android-sdk, by default. Again, I selected all of the default options. You will need this folder name in a moment.

    I also suggest that you use this folder name for your installation. As you move from computer to computer, certain installation differences will cause problems with the workspaces (programs).


  5. The SDK manager should start. If it does not, run the program using the Start menu and run SDK Manager.exe. If the program does not appear on the Start menu, navigate to the above android-SDK directory and run the program.

Adding SDK Versions


Android operates in such a way that every SDK version is unique. That is, every Android device run a unique version of the software. When you build an Android application, you tell the compiler which android versions you want to support. This configuration makes it easy to use the development environment to build different software versions. And there are plenty of them.

The following link describes selected Android build numbers: https://source.android.com/source/build-numbers.html



Code Name

Version

API Level

Marshmallow

6.0

API level 23

Lollipop

5.1

API level 22

Lollipop

5.0

API level 21

KitKat

4.4 – 4.4.4

API level 19

There are older versions but you will not need them.

HANDS-ON ACTIVITY – Installing the Android SDK Manager

  1. The Android SDK Manager should be running as shown in the following figure. The left column shows the Android packages. The right column shows which packages are installed.


  2. Select the check boxes associated with the installed packages, and click the Install xx package… at the bottom of the screen. Note that this process can take quite a while. Note also that the SDK Manager must be run as Administrator.



  • In the Tools section, you need to install versions 24 back to version 21. Make sure to install the latest Android SDK Platform-tools.


  • For each of the API versions, install the SDK documentation, the SDK Platform, and the ARM EABI system images at a minimum. I installed the Intel x86 Atom System images. These system images provide alternate emulators that may perform faster than the ARM EABI system image depending on the graphics card you have installed.


  • I installed all of the above packages for all version 5.0.1 and greater.

Don’t worry, if you want to install additional versions and images later, you can. In addition, run the SDK manager occasionally to get updates.

  1. Close the SDK manager and close Eclipse one more time.


Adding the ADT Plugin Repository


In this step, you are telling Eclipse about the Android SDKs that you just installed.

HANDS-ON ACTIVITY – Adding the ADT Plugin to Eclipse

  1. Start Eclipse. Be sure to run Eclipse as an Administrator.


  2. Select the default value for the workspace, if necessary.


  3. Click Help / Install New Software from the menu bar. The following dialog box will appear:




  4. Click the Add button to display the following dialog box:



  1. In the Location text box enter  http://dl-ssl.google.com/android/eclipse/


  2. Click OK to close the dialog box. The following software packages should be located. You will need to expand the Developer Tools page. Your list might vary slightly from the one shown in the following figure:



  1. I have included all of the developer tools. However, you should only need the Android DDMS and the Android Development Tools.


  2. Click Next to begin the installation.


  3. Accept the licenses, if necessary. Accept the warnings about non-trusted software. The process takes a few minutes.




  4. You must restart Eclipse for the changes to take effect.

Next, you need to configure Eclipse so that it recognizes the plug-ins that you just installed.

  1. On the menu, click Window / Preferences.


  2. Click and expand the Android folder.


  3. The SDK Location might already appear. If it does not, click Browse, and select the folder C:\Program Files (x86)\Android\android-sdk. Again, I assume that you installed the Android SDK in the default folder.




  4. Click the Apply button. Your screen should look something like the following. The installed products might differ. As you can see, I have installed both the Google and Android Open Source versions of the APIs. I have also installed all of the APIs from versions 5.0.1 to 6.0.




  5. Click the OK button and then restart Eclipse one more time.

Installing and Configuring the Emulator


There are two ways to debug and test an Android application.

  • You can use an emulator. Note that the emulator is very slow and a bit picky. There are several different emulators. Some seem to work better than others. Performance varies on the hardware and GPU configuration.


  • You can enable debugging and use your phone to test those applications you are developing. If you have an Android phone or tablet, this is the best and fastest solution. The steps to enable a phone or tablet vary from one manufacturer to the next. They also vary based on the Android version. Thus, the topic of configuring a phone or other device for development is not discussed in this document. The following Stack Overflow link is helpful. http://stackoverflow.com/questions/2714400/how-to-debug-on-a-real-device-using-eclipse-adt

Here, you will see how to configure the emulator.

Android manages a set of virtual devices (emulators) that can be used to test applications. Each emulator is designed to run a specific Android version. Each configured emulator also mimics a specific Android device, which has a size and screen resolution.



HANDS-ON ACTIVITY – Configuring an Emulator

  1. On the Eclipse menu, click Window, Android Virtual Device Manager. The following dialog box appears:




  2. As shown, there are no virtual devices configured. You can create as many virtual devices as you need for testing. Click the Create button to display the following dialog box:

As you can see, there are several options to create the emulator. For now, I suggest that you use the options shown in the preceding figure. They are known to work fairly well. Significant values are described in the following list:



  • The AVD Name is the descriptive name by which the emulator is known. You can create and run several emulators.


  • The Device indicates the type of device being emulated. There are several Nexus and generic devices of different sizes and resolutions. They are trying to mimic the corresponding real-world devices.


  • The possible options for the Target vary based on the device being emulated and the SDKs installed on your computer. Note that there are both Android and Google versions. I’ll be using Android 5.1.1 – API Level 22 for most applications in this course.


  • The CPU/ABI varies based on the selected target and the ARMs installed on your computer. I’ll use the most generic ARM(armeabi-v7a). In some cases, the Intel emulators are faster because they use virtualization hardware and the graphics accelerator.


  • On Windows computers, set the RAM to 512 MB. Larger amounts of memory will not work in the Windows emulator.



  1. Click OK to create the device. The process takes a minute. The AVD should be created as shown in the following figure:




  2. In the above dialog box, select the AVD that you just created, and click the Start button. The following figure has multiple AVDS. You will likely see only 1.


  3. The following dialog box appears:




  4. Check the box titled Scale display to real size, and then click Launch. The dialog box closes and another dialog appears while the AVD starts.



  5. The emulator will start as shown in the following figure. Note that while the Android message appears, the device has not been fully started. Again. Don’t be alarmed. The process can take a few minutes.



At this point, you should be able to create and debug both Java and Android applications.

Page of


Directory: faculty -> ekedahl -> IS389
faculty -> Curriculum vitae wei chen professor
faculty -> Digital image warping
faculty -> Samples of Elements Exam Question III contains All Prior Exam Qs III except
faculty -> 【Education&Working Experience】
faculty -> References Abe, M., A. Kitoh and T. Yasunari, 2003: An evolution of the Asian summer monsoon associated with mountain uplift —Simulation with the mri atmosphere-ocean coupled gcm. J. Meteor. Soc. Japan, 81
faculty -> Ralph R. Ferraro Chief, Satellite Climate Studies Branch, noaa/nesdis
faculty -> Unit IV text: Types of Oil, Types of Prices Grammar: that/those of, with revision
IS389 -> Lab creating a First Android Project
IS389 -> Is 389 android fragment lab ekedahl
IS389 -> Please download a current copy. I have modified it since the initial upload

Download 28.25 Kb.

Share with your friends:




The database is protected by copyright ©ininet.org 2024
send message

    Main page