lập trình android cho người mới bắt đầu
[...]... Figure 2–2 Android SDK and AVD Manager available packages Open the Android Repository branch of the tree After a short pause, you will see a screen similar to Figure 2–3 Figure 2–3 Android SDK and AVD Manager available Android packages Check the boxes for the following items: “SDK Platform” for all Android SDK releases you want to test against “Documentation for Android SDK” for the latest Android SDK... to read Learn Java for Android Development by Jeff Friesen (Apress, 2010) CHAPTER 2: How to Get Started Step 2: Install the Android SDK The Android SDK gives you all the tools you need to create and test Android applications It comes in two parts: the base tools, and version-specific SDKs and related add-ons Install the Base Tools You can find the Android developer tools on the Android Developers web... trivial) Android application The process differs depending on whether you are using an IDE like Eclipse or the command line Eclipse From the Eclipse main menu, choose File ➤ New ➤➤ Project to open the New Project dialog box, which gives you a list of project type wizards to choose from Expand the Android option and click Android Project, as shown in Figure 3–1 23 24 CHAPTER 3: Your First Android Project... Eclipse knows what you want to do First, in the Run As dialog box, choose Android Application, as shown in Figure 3–4 27 28 CHAPTER 3: Your First Android Project Figure 3–4 Choosing to run as an Android application in the Eclipse Run As dialog box Click OK If you have more than one emulator AVD or device available, you will then get an option to choose which you wish to run the application on Otherwise, if... Set Up the Emulator The Android tools include an emulator, a piece of software that pretends to be an Android device This is very useful for development because it not only enables you to get started on your Android development without a device, but also enables you to test device configurations for devices that you do not own The Android emulator can emulate one or several Android devices Each configuration... Chapter 3 Your First Android Project Now that you have the Android SDK, it is time to make your first Android project The good news is that this requires zero lines of code Android s tools create a “Hello, world!” application for you as part of creating a new project All you need to do is build it, install it, and watch it open on your emulator or device Step 1: Create the New Project Android s tools can... inside of this project, so you understand what Android gives you at the outset and what the roles are for the various directories and files Project Structure The Android build system is organized around a specific directory tree structure for your Android project, much like any other Java project The specifics, though, are fairly unique to Android the Android build tools do a few extra things to prepare... application (e.g., upload it to the Android Market) But perhaps you already have a device—maybe that is what is spurring your interest in developing for Android The first step to make your device ready for use with development is to go into the Settings application on the device From there, choose Applications, then Development That should give you a set of check boxes for choosing development-related options,... may not work with Android Learn Java This book, like most books and documentation on Android, assumes that you have basic Java programming experience If you lack this, you really should consider spending a bit of time on Java fundamentals before you dive into Android Otherwise, you may find the experience to be frustrating If you are in need of a crash course in Java to get involved in Android development,... shell script If you run that, you will be presented with the Android SDK and AVD Manager, shown in Figure 2–1 Figure 2–1 Android SDK and AVD Manager At this point, you have some of the build tools, but you lack the Java files necessary to compile an Android application You also lack a few additional build tools, and the files necessary to run an Android emulator To address this, click the Available packages . for Android Development by Jeff Friesen (Apress, 2010). CHAPTER 2: How to Get Started 9 Step 2: Install the Android SDK The Android SDK gives you all the tools you need to create and test Android. “SDK Platform” for all Android SDK releases you want to test against “Documentation for Android SDK” for the latest Android SDK release “Samples for SDK” for the latest Android SDK release,. that you do not own. The Android emulator can emulate one or several Android devices. Each configuration you want is stored in an Android Virtual Device (AVD). The Android SDK and AVD Manager,