Basic Android learning-Build a development environment and HelloWord (1)
Before building an Android development environment, let's take a brief look at Android.
Android is a free and open source operating system based on linux developed in java and mainly used on mobile devices.
The following four tools are required to build an Android development environment:
Jre: java runtime enviroment java runtime Environment.
Sdk: Software Develop Kit, which provides APIs of different Android versions.
Adt: android develop tool android development tool, is a plug-in of eclipse.
Avd: android virtual device android simulator, a virtual android system.
Four main components of Android development are:
Activity: Used to present functions.
Service: the Service is running in the background. The interface is not displayed.
BroadcastReceiver: used to receive broadcasts.
Content Provider: supports data storage and reading in multiple applications, which is equivalent to a database.
To build an Android environment, follow these steps:
1. Configure java environment variables.
My computer-properties-Advanced System Configuration-environment variables-system variables, add the following environment variables:
JAVA_HOME: D: \ Java \ jdk1.6.0 _ 14.
CLASSPAT:.; % JAVA_HOME % \ lib \ tools. jar; % JAVA_HOME % \ lib \ dt. jar; % JAVA_HOME % \ bin;
Path: append % JAVA_HOME % \ bin before the path value;
Run the echo & JAVA_HOME % and java-version commands in the cmd window to verify whether the environment variable is configured successfully.
2. Configure the android environment variable.
My computer-properties-Advanced System Configuration-environment variables-system variables, add the following environment variables:
SDK_HOME: D: \ Android \ android-sdk-windows.
Path: append % SDK_HOME % \ platform-tools; % SDK_HOME % \ tools before the path value;
Run the echo % SDK_HOME % and adb commands in the cmd window to verify whether the environment variable is configured successfully.
3. Install the atd plug-in on myeclipse.
Decompress adt-15.0.0.zip and copy the files in the decompressed features directory and plugins directory to the myeclipse installation directory.
C: \ software \ myeclipse \ MyEclipse 10 \ dropins directory under the features directory and plugins directory.
4. Install avd.
Open myeclipse and add several icons in the menu bar, including Opens the Android SDK Manager and Opens the Android Virtual Device Manager.
And Opens a wizard to help create a new Android project. Click Opens the Android Virtual Device Manager to create an avd.
5. Integrate the SDK to myeclipse.
Click Windows-Preferences-Android to introduce the SDK In SDK Location.
6. Create an Android project.
Right-click new-Andorid Project (enter the Project name)-next (select the SDK version)-next (enter the application name, package name, and Activity name)-finish.
7. Run the Android project.
Right-click the project Run As-Run deployments...
If an android simulated interface is displayed, the operation is successful.