• No results found

Android Setup Phase 2

N/A
N/A
Protected

Academic year: 2021

Share "Android Setup Phase 2"

Copied!
11
0
0

Loading.... (view fulltext now)

Full text

(1)

Android Setup Phase 2

Instructor: Trish Cornez

CS260 Fall 2012

Phase 2: Install the Android Components

In this phase you will add the Android components to the existing Java setup. This phase must be completed by week 5.

Task List:

Task 1: Download the Android SDK.

Task 2: Add Android’s Build Targets to install with the SDK.

Task 3: Install the Android Development Toolkit (ADT) plug-in for Eclipse. Task 4: Create an Android Virtual Device (AVD).

Task 5: Take a test drive of the setup by creating and running the “Hello World” Android app.

Task 1: Download the Android SDK

Step 1: Download the core Android SDK tools.

The Android SDK allows us to install packages that will support multiple versions of the Android OS and multiple API levels. The Android SDK is a collection of libraries, tools, scripts, documentation, and such. Before developing an Android application we must be able to specify an Android version build target. The Android SDK provides programmers with API libraries and developer tools necessary to build, test, and debug apps for Android.

In this step you will download only the core SDK tools. In step 3 you will download the complete SDK environment. Download the core SDK package that corresponds to your system from the following address:

NOTE: To install the core SDK, you can run an installation file or download a zip and extract it to your root directory. I chose to download the android-sdk zip, and extract it to C:\.

(2)

Step 2: Set a path to the Android SDK Tools and Platform Tools

Once you've downloaded the Android SDK you will need to set up your development environment. As mentioned in Step 1, the SDK you just downloaded includes only the core SDK tools, which you can use to download the rest of the SDK packages (such as the latest system

image).The Android SDK archive initially contains only the basic SDK tools. It does not contain an Android platform or any third-party libraries. In fact, it doesn't even have all the tools you need to develop an application. In order to start developing applications, you must install the Platform-tools and at least one version of the Android platform, using the SDK Manager.

Platform-tools contains build tools that are periodically updated to support new features in the Android platform (which is why they are separate from basic SDK tools), including adb, dexdump, and others.

The SDK contains folders for tools and platform-tools. These folders need to be on your path to be invoked from the command line.

On windows click Start. Right-click Computer. Choose properties - >Advanced System Settings.

(3)

Step 3: Verify the new path settings by typing PATH into the command prompt.

Add the paths to android-sdk-windows\tools and

android-sdk-windows\platform-tools to the existing paths. Do NOT remove existing paths!

Remember to separate paths with a semicolon. I added the following paths:

;C:\android-sdk-windows\tools;C:\android-sdk-windows\platform -tools

(4)

Task 2: Add Android’s Build Targets to install with the SDK

Step 1: Run the Android SDK Manager to install Android packages.

The Android SDK allows us to install packages that will support multiple versions of the Android OS and multiple API levels. To run the SDK Manager you can simply double-click SDK Manager from the android-sdk-windows.

You may also invoke the SDK Manager from the command line by issuing the command: android

NOTES:

1. The packages labeled "Android" support building applications compatible with different Android API levels.

2. You should install, at a minimum, the most recent (highest number) version. It is a good idea to install all available API levels. This is a smart choice since you may want to build applications that run on older Android versions.

(5)

The packages containing check marks must be installed.

(6)

Step 2: Verify the Android installation.

(7)

Task 3: Install the Android Development Toolkit (ADT) plug-in for Eclipse.

Step 1: Linking the ADT to Eclipse

Now that the SDK files have been installed, functionality must be added to Eclipse. 1. Load Eclipse.

2. Choose Windows -> Preferences 3. Click Android

Specify the location of your Android SDK. Click Apply.

(8)

Step 2: Install the Android Development Toolkit

To install the ADT plug-in for the first time you will need to use the "Install New Software" mechanism from within Eclipse. To update the ADT plug-in you will use the Update mechanism from within Eclipse.

1. Load Eclipse if it is not already loaded. 2. Choose Help-> Install New Software ...

3. Enter the following URL into the field named “Work with”.

4. Click the Add button. The following window will appear. Complete this first-time installation.

Step 3: Restart Eclipse to complete the installation of the ADT plug-in.

Verify that Android SDK manager and AVD Manager are listed in Window menu of Eclipse.

(9)

Task 4: Create an Android Virtual Device (AVD).

To run the android Emulator, we need to create an Android Virtual Device, which defines the characteristics of the device on which you want to test. This includes not only the system image and screen size, but the hardware, data storage, etc.. If you want to test your app for multiple Android devices, you will need to create separate AVD's to emulate each unique device. In this task, you will create an Android Virtual Device to emulate the Nexus 5 (Google’s smart phone).

Step 1: Load Eclipse.

Once the ADT plug-in has been installed in Eclipse, the SDK and AVD manager can be invoked from within Eclipse. This is the easiest way to create an AVD.

Step 2: Load the AVD Manager from Eclipse. • Select Window -> AVD Manager

• Click the New button.

Step 3: Specify the attributes of the new AVD.

Use a name that is descriptive. This AVD contains the settings that simulate the Samsung Nexus S Android phone.

AVD performance can be slow. This may improve AVD load time.

The target identifies the system image that will be used in the AVD emulator.

Keep in mind that several versions of Android are still widely used on phones. If you want to reach the largest number of users, target an earlier version. If your app requires functionality that older platforms can’t support, then target the new platform.

Some applications require an SD card to extend storage. Unless you plan to use a lot of media files, 250MB is a good size.

The skin is mainly the screen size of your device. Here the default has been selected

This parameter is used to specify additional hardware.

(10)

Task 5: Take a test drive by creating the Hello World Android app.

By creating and executing the “Hello World” Android Project, we can confirm the installation of all the Android

plug-ins (SDK and ADT) and verify they were operational.

Step 1: Create an Android Project in Eclipse 1. Load Eclipse.

2. Create a new application: File -> New -> Project. 3. Select the android Application Project wizard. - > Android Project

Step 2: Complete the specifications of a new Android project

Application Name is the project name that will appear in Eclipse.

The package name is a namespace that uniquely identifies packages in your applications, but also among all other installed applications. A package is a name for a group of related classes. Android uses a collection of packages for predefined classes. Some of these packages are specific to Android, while others are solely related to Java and Google.

Choose the lowest version of Android that you application will support.

It is typical to choose the most recent version of Android. A custom launcher icon will not

(11)

Step 3: Run the project as an Android application.

You will next be asked to identify the Android activity. Select a BlankActivity. Activities will be discussed in class.

Finally, you will specify the name for your main activity, layout, and application title. These will be discussed in class.

For simplicity sake, these entries are left with the default values.

References

Related documents

We will include any study design that measured any of the following outcomes in relation to treatment uptake and completion for DR and/or DMO: (1) proportion of patients

Applicants must have documentation of a minimum of 1,600 clock hours prior to the date of application to the Department for approval, delivering such service to children under

make java documentation android app building game android development nexus 7 2013 android sdk ndk ubuntu android apps development tools how to make calculator app in android

In Android Studio, on the top of the screen, select the Tools menu, then Android, and then SDK Manager (Tools -> Android -> SDK Manager), as shown in Figure 3.. Then we can

Now it’s time to configure the Android SDK for Development Tools and the Google APIs.. Configure the Android SDK for Development Tools and

Luca Bedogni, Marco Di Felice - Programming with Android – SDK install and initial setup 3 SDK and initial setup: 3 step setup..  Download Android SDK for

Luca Bedogni, Marco Di Felice - Programming with Android – SDK install and initial

Go to http://developer.android.com/sdk and download the Android ADT Bundle, it includes Eclipse with built-in Android development tools and Android SDK components.. Accept