Google, a network giant, recently released its Linux-based mobile phone operating system, Android. The latest SDK can now be downloaded, and its App development environment turns out to be Java! At present, Google has launched an Eclipse plug-in Android Development Tools (ADT) to simplify Development. According to official site documents, it is very easy to develop an Android Application under Eclipse.
Download the Android SDK for Windows, decompress the package, Install the plug-in directly in Eclipse, and select Help-> Software Update-> Find and Install ..., Select Search for new features to install and enter the address https://dlssl.google.com/android/eclipse/. then, you can use nextalong the way:
After the installation is complete, restart Eclipse and make some settings for the SDK. Choose Window> Preferences> Android:
Enter the SDK root directory in the SDK Location to complete the settings.
To create our first Android Application, you only need to File in Eclipse> New> Project ..., Select Android-> Android Project, and enter:
Project name: HelloWorld
Package name: com. javaeedev. android. hello
Activity name: Hello
Application name: Hello
The project structure after creation is as follows:
Hello. java is the main class. Open it and you can see that the ADT has automatically generated the runable code:
The compiler prompts a syntax error. It doesn't matter. Do not comment it out. Directly compile the project and an R. Java is automatically generated. This is the resource file constant automatically generated by the ADT Preprocessing Program. We don't need to worry about it. You can modify the layout and displayed text in RES/layout/Main. xml.
The next step is run. Open Run-> open run dialog ..., Select Android Application and create a new configuration:
After setting the project and activity, you can directly run it. You can select different simulators. The following are the running effects of several simulators:
Android simulators do a great job, far exceeding wtk and the Simulators of some mobile phone manufacturers. However, because the SDK is still in the RC version, there are still some bugs. The first bug I encountered was that if the simulator was forced to be shut down during startup, some processes would not be able to exit. The next operation would fail and the computer would be normal after it was restarted. As a new mobile development platform, the prospect of Android cannot be underestimated.