First, the development environment to build
Since Android applications are written in the Java language, developing Android applications requires the computer to have the conditions to develop and run Java applications. Java language-developed applications require: JDK (Java development Kit), typically, the JDK contains the JRE (Java Runtime envrioment).
The JDK is the Java SDK, and if you need to develop a program for the Java language, you must install and configure the JDK on your computer.
The JRE is a support for the Java Runtime System, which is a program that runs the Java language development.
The JDK is free software and can be downloaded directly from the website.
After the JDK is installed on the computer, it needs to be configured. The purpose of the configuration is to ensure that any location can execute the application in the Jdk/bin directory, the configuration method:
1) Open the installation directory of the JDK and open the bin directory under the JDK to copy the path (folder address)
2) Right-click on the "My Computer/Computer" button on the desktop, select "Properties", select "Advanced system Settings" on the left side of the pop-up dialog, then select "Advanced" tab in the new Open dialog and click "Environment variables"
3) In the Environment Variables dialog box, select "Path" in the "system variables" below, and paste the results of the previous copy, you need to note: The pasted path needs to be separated from the original path using the English semicolon.
4) Press the win+r of the keyboard, enter cmd, open "Command Prompt", enter java-version can view the configuration of the JDK version information, if it can be displayed properly, it means that the above configuration has been successful!
Java Development Tools--eclipse
-----------------------------------------
Eclipse is free software
Noun:
1) Workspace: Workspace, Eclipse will store the relevant files for each application created in workspace.
2) Project: Project/Project, a collection of all files that can be understood as a software
3) src: Indicates source, that is, Java source code
4) Class: "Class", in the early learning of Java, can be understood as "every Java source code file must be class"
5) public static void main (string[] args): Program entry, at the beginning of the learning Java, the above section as a fixed syntax is not modifiable, all the code you write should be in the statement corresponding to the curly braces inside
6) Show line numbers: Show row number
7) Console: Console, panel showing the effect of Java program operation
Adjust the text display size of your code in eclipse
-----------------------------------------
Click the Window menu, select the Preferences menu item, in the Open Preferences dialog box, in the Search input box in the upper-left corner, enter "Font", select "Colors and Fonts" in the filtered results, and then expand the basic on the right Text Font, and double click or click the Edit button
Display a panel that is not displayed by default in eclipse
-----------------------------------------
Click the Window menu, select the Show View menu item, select the panel you want to display in the submenu, select the Others Open dialog box if the panel you want to display is not in the option.
Replace Workspace in Eclipse
-----------------------------------------
Click the File menu, select Switch Workspace, select a different Workspace that you have already created, or select other to create not in the list or new Workspace
If the switch uses a new workspace, the original personalization is lost and needs to be reconfigured
Configuring the development environment for Android
-----------------------------------------
Necessary software: In addition to the Java Development environment, ADT, SDK
ADT (Android Development tools): andriod development tool, which needs to be installed on Eclipse, an action item on Android appears on the various menu/toolbar buttons in eclipse
SDK (software Development Kit): Software Development Kit for Android version platforms, simulators, debugging tools, and more.
To install ADT: Click on the eclipse's Help menu, select the Install NEW software menu item, click the Add button in the top right corner of the Install dialog box, and select the archive button for the location column in the New Popup dialog box. , browse to ADT's compressed package file, and OK, then select all the installation items in the list, remove the check box at the bottom of the contact all update ... option, you can start the installation.
Configure SDK: Click on the Eclipse's Window menu to select the Preferences menu item, select Android on the left, and browse to the Android SDK folder on the right.
Run the Android app on the real machine
-----------------------------------------
1. Install the driver for the real machine on the PC side
2. Turn on the "debug mode" on the real machine
3. Connect PC to real machine with data cable
AVD Simulator
-----------------------------------------
AVD (Android virtual device): Android VM/simulator
Genymotion Simulator
-----------------------------------------
You need to register your account on the Genymotion website, and you can use the system files to download the emulator online.
troubleshooting adb
-----------------------------------------
ADB (Android Debugging Bridge): Android Debug Bridge, used to connect Android devices (including virtual) and run software on the PC side of the management Android device.
1) Check the usage of Port 5037 via Netstat-ano at the command prompt
2) End the 5037-port application through Windows Explorer, and all Adb.exe processes
3) at the command prompt, locate the Platform-tools folder under the Android SDK, execute ADB start-server to open adb, and if the successfully is displayed, it will start successfully, otherwise you can execute ADB first Start again after Kill-server
4) Execute ADB devices viewing device at the command prompt
Android Development Java Foundation Development Environment Building