Documents on the Chinese android

What is Android?
Android is a specialized set of software for mobile devices, which includes an operating system, middleware and some important applications. Beta version of the Android SDK provides the Android platform using the Java language for Android application development tools and API interfaces to be.
Features application framework to support component reuse and replacement
Dalvik virtual machine optimized for mobile devices Integrated browser based on open-source WebKit engine Optimized 2D graphics library, including custom graphics library, 3D graphics library based on OpenGL ES 1.0 (hardware acceleration optional)
SQLite for structured data storage of multimedia support including common audio, video and still image formats (such as MPEG4, H.264, MP3, AAC, AMR, JPG, PNG, GIF)
GSM Telephony (hardware dependent)
Bluetooth Bluetooth, EDGE, 3G, and WiFi (hardware dependent)
Camera, GPS, compass, and accelerometer (accelerometer) (depends on hardware)
Rich development environment including a device emulator, debugger, memory and performance analysis charts, and the Eclipse integrated development environment plug-ins
Android Architecture The following diagram shows the main components of the operating system Android. Each part will be detailed in the following description.

Applications
Android application package together with a series of core release, the application package, including email client, SMS short messaging program, calendar, maps, browser, contact management procedures. All applications are written using the JAVA language.
Application Framework Developers have full access to the core application framework used by the API. The application architecture design simplifies the reuse of components; any application can publish its functional blocks and any other applications can use the function block its release (but must follow the framework of security restrictions). Similarly, the application reuse mechanism allows the user to easily replace the component.
Hidden behind each application is a series of services and systems, including;
Rich and scalable view (Views), can be used to build applications, which includes a list (lists), grid (grids), text boxes (text boxes), Button (buttons), or even embedded in the web browser .
Content provider (Content Providers) allows applications to access data from another application (such as the contact database), or to share their own data resource manager (Resource Manager) to provide access to non-code resources, such as local string graphics, and layout files (layout files).
Notify the Manager (Notification Manager) makes application to the status bar to display custom message.
Activities Manager (Activity Manager) to manage the application life cycle and provides common navigation rollback feature.
For more details and how to write an application from scratch, see how to write an Android application.
Library
Android contains some C / C + + libraries, these libraries can be Android system in different components. Them through the Android application framework for developers to provide services. Here are some of the core library:
System C library - a BSD inherited from the standard C system library (libc), which is designed for devices based on embedded linux custom.
Media Library - based on PacketVideo OpenCORE; the library supports a variety of popular audio, video format playback and recording, while supporting a static image file. Encoding formats including MPEG4, H.264, MP3, AAC, AMR, JPG, PNG.
Surface Manager - the management of the display subsystem, and for multiple applications of 2D and 3D layers to provide seamless integration.
LibWebCore - a new web browser engine used to support the Android browser and an embeddable web view.
SGL - the underlying 2D graphics engine
3D libraries - implementation based on OpenGL ES 1.0 APIs; the library can use the hardware 3D acceleration (if available) or use the highly optimized 3D software to accelerate.
FreeType - bitmap (bitmap) and vector (vector) font.
SQLite - a free for all applications, features strong lightweight relational database engine.
Android Runtime
Android includes a core library, the core library provides the JAVA programming language, most of the core library functions.
Each Android application process in its own run, have a separate instance of Dalvik virtual machine. Dalvik is designed as a device can also efficiently run multiple virtual systems. Dalvik virtual machine implementation (. Dex) of Dalvik executable file, the format for the small memory usage is optimized. At the same time the virtual machine is based on the register, all the classes by the JAVA compiler, then SDK in the "dx" tool into. Dex format by the virtual machine execution.
Dalvik virtual machine depends on the linux kernel features, such as memory management, threading mechanism and the underlying mechanism.
Linux kernel
Android's core system services rely on the Linux 2.6 kernel, such as security, memory management, process management, network protocol stack and driver model. Linux kernel at the same time as the hardware and software abstraction layer between the stacks.
First, start the installation SDK
This page describes how to install the Android SDK and how to set up your development environment. If you have not downloaded the SDK, you can click the link below to download and then read the follow-up documentation to learn how to install, configure, and use the SDK to create Android applications.
Download SDK
Upgrade?
If you already use an earlier version of the development process, you can skip this page and read the SDK documentation upgrade.
System and software requirements to use Android sdk code and tool development Android applications, you need for the development of computers and development environment, described as follows:
Operating system requirements:
Windows XP or Vista
Mac OS X 10.4.8 or later (only support x86)
Linux (Linux Ubuntu Dapper Drake version of test)
The required development environment:
Eclipse IDE
Eclipse 3.3 (Europa), 3.4 (Ganymede)
Eclipse JDT plug-in (most of the Eclipse IDE package included)
WST (optional, but Android features editor needs, it is included in most Eclipse IDE packages in)
JDK 5 or JDK 6 (only the JRE is not enough)
Android Development Tools plugin (optional)
Not compatible with GNU Java compiler (gcj)
Other development environment or IDE
JDK 5 or JDK 6 (not just JRE)
Apache Ant 1.6.5 or later (Linux and Mac environments), 1.7 or later (Windows environment)
Not compatible with GNU Java compiler (gcj)
Note: If your computer has installed the jdk, make sure it is the version number listed above. Also to note that some linux versions may contain jdk 1.4 or the gnu java compiler, Adroid development is not supported in both versions installed SDK
After downloading the SDK, the. Zip files to the appropriate location on your computer. By default, SDK files are extracted to android_sdk_ <platform> _ <release> _ <build> folder. This folder contains tools /, samples / and so on.
Please note that the system in SDK folder after extracting the name and location - when you install the Android plug-in and use the SDK tools, you will need to refer to this folder.
You can add the SDK tools folder to your path environment variable. As noted above, tools / folder in the SDK folder.
Linux environment, modify the ~ /. Bash_profile or ~ /. Bashrc file. To find a place to set environment variables, adding tools / the absolute path. If you can not find the settings, you need to add new line:
export PATH = $ (PATH): <your_sdk_dir> / tools
Mac environment, in your home folder, look inside. Bash_profile, then and linux the same treatment. If you have not previously had. Bash_profile file, you can create a new one.
Windows, right-click My Computer and select Properties. In the tab Advanced and click Environment Variables, when dialog box appears, double-click the System Variables section in Path (Path). And Tian Jia tools / folder full path.
Add tools to your environment variables in, so you can run Android Debug Bridge (adb) and other tools under the command without the need to enter the full path name. Need to note is that if you upgrade your SDK, need to update your environment variables accordingly to the new location.
Install Eclipse plug-in (ADT)
If you want to use the Eclipse IDE as a development environment for Android applications, you can install support for Android projects and tools of universal plug-Android Development Tools (ADT). ADT plugin includes a powerful expansion that make creating, running and debugging Android faster, easier .
If you do not use the Eclipse IDE, you do not have to download and install the ADT plug-ins to download and install the ADT plugin, follow these steps to install your respective versions of Eclipse.
Eclipse 3.3 (Europa)
Eclipse 3.4 (Ganymede)
1. Start Eclipse, then select Help> Software Updates> Find and Install ....
2. Dialog box appears, select Search for new features to install click Next.
3. Click the New Remote Site.
4. In the dialog box, enter the name of the remote site (eg Android Plugin), enter the site as follows:
https: / / dl-ssl.google.com/android/eclipse /
Click OK.
5. You can see the new sites added to the search list (and checking), click Finish.
6. In the following search results dialog box, select the check box for Android Plugin> Developer Tools. It will examine the characteristics: "Android Developer Tools", and "Android Editors". Android editor feature is optional, but we recommended to install it, if you choose to install, requires the previously mentioned WST plug-in. Click Next.
7. Read the license agreement, and then choose to accept the license agreement, click Next.
8. Click Finish.
9.ADT plug-in is not signed, you can click "Install All" to install everything.
10. Restart Eclipse.
1. Start Eclipse, select Help> Software Updates ....
2. In the resulting dialog, click the tab Available Software.
3. Click Add Site ...
4. Enter the following address:
https: / / dl-ssl.google.com/android/eclipse /
Click OK.
5. Back to the view available software, you will see the plug-in. Select next to the Developer Tools and click on Install ...
6. In the next installation window, select the "Android Developer Tools" and "Android Editors". Android editor feature is optional, but we recommend to install it, if you choose to install, requires the previously mentioned WST plug-in. Click Finish.
7. Restart Eclipse.
After restart, update your Eclipse preferences to point SDK folder:
1. Select Window> Preferences ... to open the Properties panel. (Mac OS X: Eclipse> Preferences)
2. From the left panel select the Android.
3. In the main interface, click on Browse ... to locate SDK SDK and then locate the folder.
4. Click Apply, then click OK.
ADT Installation Troubleshooting
I follow the above steps if you download the ADT plugin in doubt, here are some suggestions:
In the fourth step, try changing the URL address of a remote update to http, not https.
If you are under the protection of the firewall (Enterprise Firewall) Please make sure your Eclipse proxy settings right. In Eclipse 3.3/3.4, you can configure from the main Eclipse menu: Window (in the Mac, Eclipse)> Preferences> General> Network Connections
If you can not download the ADT plug-in installed to Eclipse, according to the following steps to download from your computer and install the plug-in:
1. Download ADT compressed files (not extract).
2. In accordance with the default installation of the first and second step (above).
3. In Eclipse 3.3, click New Archive Site ....
In Eclipse 3.4, click Add Site ..., then click the Archive ...
4. Browse and select the downloaded zip file.
5. From the beginning the fifth step above the rest of the process to complete.
Update your plug-ins, you must follow these steps to replace the default line description more.
Update ADT plug-in some cases, your machine may SDK and ADT plugin is compatible, you can use the following steps to update the ADT plug-in from Eclipse.
Eclipse 3.3 (Europa)
Eclipse 3.4 (Ganymede)
1. Select Help> Software Updates> Find and Install ....
2. Select Search for updates of the currently installed features and click Finish.
3. If ADT can update, select and install the update.
Or:
1. Select Help> Software Updates> Manage Configuration.
2. Expand the navigation tree and select Android Development Tools <version>
3.Available Tasks, select Scan for Updates.
1. Select Help> Software Updates ...
2. Select the tab Installed Software.
3. Click the Update ...
4. If the ADT allows update, select it and click Finish.
Installation Notes
Ubuntu Linux Note If you need help to install and configure java on your ubuntu machine, the following resources may help you:
https: / / help.ubuntu.com / community / Java
https: / / help.ubuntu.com / community / JavaInstallation
Here are java and Eclipsed the installation steps to install the Android SDK and ADT plugin.
1. If you use your development machine 64-bit version, you need to use apt-get install ia32-libs package
apt-get install ia32-libs
2. Next, install Java:
apt-get install sun-java6-bin
3.Ubuntu Package Manager Eclipse 3.3 version is not available to download, so we recommend you from eclipse.org (http://www.eclipse.org/ downloads /) to download. Recommend the use of Java or RCP versions of Eclipse.
4. In accordance with the preceding section provides steps to install the SDK and the ADT plug-ins.
Note other versions of Linux if you install the ADT plug-in Eclipse encounter this error:
An error occurred during provisioning.
Cannot connect to keystore.
JKS
Your lack of suitable development environment virtual machine, install the Sun Java 6 can solve this problem, then you re-install the ADT plug-in.
If JDK is already installed on your development computer, make sure the version on this page are listed in the top of the list has some Linux contains jdk1.4 or the gnu java compiler, Android does not support either of the above.

Updated SDK
This guide will help you upgrade your development environment and application to the SDK, the latest version of Xi if you have applied the previous version of the Android SDK, also need to use this guide.
To ensure that your application is compatible with android1.0 system, you need to install the new SDK and API with new transplant existing android application, the following sections guide you through the process.
Install a new SDK
Download the SDK and extract to a safe location.
After extracting the new SDK, you should complete the following operation.
Erase data from your simulator SDK version as the new release, some of the data format has changed. Therefore, any data previously saved simulator must be removed. Open a console / terminal and the operation of SDK in the / to ols directory. Start simulator gall wipe-data option
Windows: emulator-wipe-data
Mac / Linux:. / Emulator-wipe-data
Update your PATH variable (Mac / Linux; optional)
If you have set the PATH variable to point to the SDK tools directory, then you must update to point to the new SDK's. Eg,. Bashrc or. Bash_profile file: export PATH = $ PATH: <your_new_sdk_dir> / tools
Update ADT Eclipse Eclipse plug-If you use the ADT plug-in development, follow these steps to install the new plug-in match the new SDK.
Eclipse 3.3 (Europa)
Eclipse 3.4 (Ganymede)
1. Select Help> Software Updates> Find and Install ....
2. Select Search for updates of the currently installed features and click Finish.
3. If any ADT effective, select and install
4. Restart Eclipse.
1. Select Help> Software Updates ...
2. Select the Installed Software tab.
3. Click the Update ...
4. If any ADT effective, select and click Finish
5. Restart Eclipse.
Restart, update your Eclipse SDK directory set point.
1. Select Window> Preferences ... to open the Preferences panel. (Mac OSX: Eclipse> Preferences)
2. Select Android from the left panel.
3. For the SDK in the main panel location, click Browse ... and locate the SDK directory.
4. Click Apply, then OK.
Signed to establish the application to install all applications must be signed before them. ADT plug-and ant-based development tools support this requirement, they are through with a debugger KEY gall apk file to the issue of compilation. To do this, compile the tools included in the JDK's Keytool to create a keystore and with a known alias and password of a key with a known alias and password. For more information, please refer to sign your application.
In order to support signed signature, you should first make sure Keytool for SDK build tools to be effective. In most cases, you can tell the SDK build tools to find Keytool, J AVA_HOME by setting your environment variable settings, and an appropriate JDK. Alternatively, you can add the JDK keytool version to your PATH variable if you are developing a version of Linux that was originally using GNU's JAVA compiler sound of many people eating, make sure the system is using the Keytool the JDK version, rather than gcj, if keyt ool already in your path, it may point to a symbolic link is / usr / bin / keytool. In this case, check the symbolic link target to ensure that it points to the correct Keytool.
If you are using ant compile your. Apk file ض instead of ADT, you must re-create your build.xml file. To do this, follow these steps:
1. Android application in your project directory, locate and delete the current build.xml file
2.2. Run activitycreator, direct output to your application project that contains the folder
3 .- exec activitycreator
- Out your.activity.YourActivity
ض activityCreator run this way will not work either, or create a new Java file (or manifest file ض , for those already existing activity and the package. Is important, package and the activity is real. The tool creates a new build. xml file, and a new directory called libs ", this directory will be placed on third-party jar file, which is you can use ant script automatically.
Transplantation updated your application after your SDK, you may experience broken code, because the framework and API changes. You need to update your code to match the changing Andriod the API.
One way is to use Eclipse to open your project and view your application ADT tag error. From here, you can find the corresponding changes in potential changes in the report preview and API changes.
Update your code if you have other problems, please visit android group discussion to seek help or turn to other android developers.
If you have modified a ApiDemos application, and want to migrate to the new SDK, please note that you will need to uninstall pre-installed ApiDemos version of the simulator. For more information, or (run or install A piDemos) encountered a re-installation "error, see Troubleshooting on Zi because the wrong signature, I can not install on my IDE ApiDemos application to get information to solve this problem.
Development and debugging This section describes the android on the development and debugging applications. It will teach us how to create, compile, run and debug android code. Or, you can also Hello Android tutorial. Start

Main content
1. The eclipse on the development of android applications
2. Use other IDE and tool development android application
3. To sign the application
4.ApiDemo sample application usage
5. Debug
6. Device debug and test set
7. Top debugging skills
8. Compile the application to install a android
9. Remove android procedures
10.Eclipse skills developed in eclipse Android application development in the android with eclipse IDE application before you first create an Android project and create a launch configuration, after which you can start writing, running, and debugging your application.
The following section assumes you have installed in the eclipse environment ADT plug-in, if you do not, please use the following instructions after installation. Reference to install the eclipse plugin (ADT)
Create an android project
ADT offers a new project wizard, you can quickly create a new project or to create works in the existing code. Create the project as follows:
Select File> New> Project
1. Select Android> Android Project, and then press Next
2. Select the Project Content:
Select Create new project in workspace, the code to create a new project.
Enter project name (project name), based on the package name (the base package name), and the Activity class name. To create a stub. Java file name and other documents and procedures.
Select Create project from existing source, create a project for the existing code. If you want to compile and run the SDK sample programs provided, you can use this option. SDK sample programs stored in the samples / directory.
Browse the directory that contains existing code, click ok, if the directory containing the available android manifest file, ADT will you fill out the appropriate package, activity, and application names.
3. Click Finish.
ADT plug-in based on your project type to create the appropriate files and folders, as follows:
src / include stub. java Activity file folder.
res / resources folder.
AndroidManifest.xml project list.
Create a startup item to run in eclipse to debug the application before, you must create a boot entry for it. Startup Items specify which projects will be started, which activity to work, and the use of which simulator options.
Follow these steps for the Eclipse version of the application to create a suitable startup items:
1. Open the Start key management tool.
In Eclipse 3.3 (Europa) version, as appropriate, select Run> Open Run Dialog ... or Run> Open Debug Dialog ....
In Eclipse 3.4 (Ganymede) version, as appropriate, select Run> Run Configurations ... or Run> Debug Configurations ....
2. In the left list select the Android Application project type selection, double-click (or right click select new), create a new startup entry.
3. Enter the name of startup items.
4. In Android tab, browse to the beginning of the project and Activity.
5. In the Target tab, set the desired display screen and network properties, and any other emulator startup options.
6. You can set the Common tab for more options.
7. Click Apply save the startup configuration, or press Run or Debug ().

Run and debug the application once you start setting up projects and project configuration, you can follow the instructions to run and debug application.
Main menu from the eclipse, according to choose Run> Run or Run> Debug, launch start running or debugging activity items.
Note that activity started running configuration management item is the most recently selected one. It is not necessarily in the Eclipse Navigation panel, select the program (if any)
Activities start to set and modify items, you can use the start key management tool. How to get startup item management tools can refer to create a startup item to run or debug your application will trigger the following actions:
Start the emulator, if he has not yet begun to run.
Compilation works, if in the last compiled on the basis of the modified code will be recompiled. Install the application in the simulator.
Run option, and start running the program.
Debug in "Wait for debugger" mode, start the program and then open the Debug window and Eclipse Java debugger, and associated procedures.
Using other IDEs and tools for developing Android applications are commonly used to install the ADT plug-ins eclipse Eclipse with the ADT plugin. To develop Android program, the plugin will edit, build and debug features into the IDE.
However, if you want the IDE to develop in other procedures, such as IntelliJ, or use without ADT plugin eclipse can be. SDK provides the installation, compilation, debugging tools required for application.
Create an android project
Android SDK contains a activityCreator program, it will produce multiple stub files for the project and a build file. You can use this program to create a new Android project or in the existing code to create projects such as the SDK contains examples. For Linux and Mac systems, SDK provides activityCreator.py, a Python script, Windows on a batch script is activityCreator.bat. No matter what kind of platform, use the same.
Follow these steps to run activityCreator create Android works:
1. In the command line, switch to the SDK under the tools / directory for your project file to create a new directory. If you create a project in the existing code, switch to the program's root directory.
2. Run activityCreator. In the command line, you must specify the fully qualified class name as a parameter. If you are creating a new project, the class represented by the same name with its stub class and script file. If created in the existing code works, you must specify the package name of one of the Activity class. The script command options include:
- Out <folder> set the output directory. By default the output directory is current directory. If you want to file for the project to create a new directory, you can use this option to point to it.
- Ide intellij, a new project in IntelliJ IDEA project file to generate.
Here is an example:
~ / Android_linux_sdk / tools $. / ActivityCreator.py - out myproject your.package.name.ActivityName
package: your.package.name
out_dir: myproject
activity_name: ActivityName
~ / Android_linux_sdk / tools $
activityCreator script generates the following files and directories (but not rewrite the existing file):
AndroidManifest.xml program list file, while for the project specified Activity class.
an Ant build.xml file to compile / package the application.
src / your / package / name / ActivityName.java you to specify input Activity class.
your_activity.iml, your_activity.ipr, your_activity.iws [only with the-ide intelliJ flag] intelliJ project file
res / resources directory.
src / source code directory.
bin / build script output directory.
Now you can move the folder will be developed anywhere, but remember, you must use the tool / folder, the adb program under send files to the simulator. So you need in your work environment and tools / folders between the activities.
Of course, you need to avoid moving SDK directory, because it will interrupt the build script. (Re-build before the need to manually update the SDK to map the path)
Compile android application uses activityCreator generated Ant file build.xml to compile the program
1. If you do not, you can be Ant Apache Ant home page file. Install it, and make sure it's executable file in your path.
2. Call Ant before, you need to declare JAVA_HOME environment variable and set it to JDK installation path.
Note: The windows on, JDK default installation path "Program Files", this path will lead to Ant failed because the path to the middle of a space. Solve this problem, you can specify the environment variables like JAVA_HOME: JAVA_HOME = c: \ Prora ~ 1 \ Java \ However, the simplest solution is to install the JDK directory without spaces. For example: c: \ java \ jdk1.6.0_02.
3. If you have not so ready, in accordance with the above project to create a new description of a project.
4. Now you can run your project Ant build file, just the same folder in the build.xml can import ant. Each modification of the original documents or resources, we need to re-run ant, it will be the latest version of the application package to deploy.
Run Android running a compiled program, you need to use adb tool. Apk file loaded into the simulator / data / app / directory, use as described below.
1. Start the emulator (run the command line sdk directory / tools / emulator).
2. Emulator to switch to the main screen (best not to run when the installation program to the simulator, you can press home key to exit application).
3. Run adb, install myproject / bin. / <appname>. Apk file. For example, the installation of Lunar Lander example, the command line, switch to the SDK directory / sample / LunarLander subdirectory, type .. / .. / tools / adb install bin / LunarLander.apk
4. In the simulator, open the executable list, scroll the screen, select and start your application.
Note: When you first install an Activity, you may need to start before the item display, or other program calls it before the re-start the emulator. Because the package management tools usually only start in the simulator to complete the review of manifests.

Attach the debugger to programs in this section we introduce how to display debug information on the screen (such as CPU utilization), and how to run the IDE and simulator program associate.
Using the eclipse plugin can automatically generate debugger. But you can also configure the debug port by IDES to monitor debug information.
1. Start Dalvik Debug Monitor Server (DDMS) tool, it is played between the IDE and simulator port translation service role. ?
2. Set simulator debugging configuration options. For example, debugging information is loaded until after the start the application. Note that a lot of debugging options without DDMS can also use, for example, the simulator shows the efficient use of CPU, or the screen refresh rate.
3. Configuring IDE, IDE makes debugging associated with the 8700 port. How to set up Eclipse to debug your project. Contains the following information.
Additional debug port configuration IDE
DDMS for each virtual machine is assigned a special debug port, the port can be found in the simulator. You have your IDE with this port (virtual machine information on these ports is listed in column) associated with the default port 8700 or. This keeps the IDE to connect to the emulator program in the list of either program.
IDE need to associate your running programs on the simulator, showing its threads, and allows you to hang it, check its status, set a breakpoint. If you set the panel options in the development of a "wait debugging", the application will wait until after the run Eclipse connection, so you need to set a breakpoint before the connection.
Changes are debugging the program, or select the program is running in the current "wait for the debug" will cause the system to kill the application. If your program is in a bad state, you can use the method to kill it, very simple, just set and the hook off the check box.
Application Signature
Android system requires all of the procedures to install digitally signed, if the digital signature is not available, the system will not allow installation to run this program. Either simulator or real equipment, as long as android system, which is applicable to all. For this reason, the device or emulator before running the debugger, you must set your application digital signature.
Understand the procedures for signature of the important points android::
All procedures must be signed, the procedure has not been signed, the system can not be installed.
You can use self-signed certificate to sign your application must be no certificate authority is.
System only when the test will be to install signed certificate is valid, if an application's signature is not due until after installation, then an application can still be activated properly.
You can use standard tools-Keytool and Jarsigner-generated key to sign the application. Apk file.
Android SDK tools can help you debug the application when to sign. ADT plug-ins and Ant build tool are available two signature model-debug mode and release mode
debug mode, compile using the JDK tools in the general program Keytool and password created by the known methods of secret lock and key. Each compile time, tools, key signatures using the debug application. Apk file. Because the password is known, tools do not need to compile every time when prompt you to enter the password lock and key.
When your application has been prepared to release, you can compile in release mode. release mode, the tool does not compile time. apk file signature. You need to generate key and secret Keytool lock, then the Jarsigner JDK tools to. Apk file signature.

In order to support the basic set signature generated under lock and key, you must first determine Keytool in the SDK compile tools to be effective. In many cases, you can set the JAVA_HOME environment variable to tell SDK how to find Keytool, or you can add in the PATH variable Keytool the JDK version.
If you are a linux version in development, was originally from Java Gnu compiler, make sure that systems are Keytool version of the JDK, rather than the gcj version. If Keytool have PATH, it will point to symbolic link / usr / bin / keytool. This case, the goal is to verify the symbolic link points to JDK under the Keytool
Eclipse / ADT sign in if you are under the Eclipse development, and has been described above in accordance with the installation of the Keytool, by default, can be signed in debug mode. When you run the debugger when the ADK will. Apk file signature, and install the simulator. This part does not require special action, ADT has entered Keytool
Compiler in release mode, press the Package project right panel, select Android Tools> Export Application Package. Or you can click on the Manifest Editor, overview page "Exporting the unsigned. Apk" connection, export unsigned apk file. Save. Apk file, with Jarsigner and your own key to the apk file signature, if not the key, you can create a key and secret Keystore lock. If you already have a key, and as public key, you can give. Apk files signed.
If you compile with Ant Ant signature. Apk file, assuming you use the latest version of the SDK contains activitycreator tool to generate build.xml file, by default, you can use the debug signature scheme. When you run Ant on the build.xml compiler, build scripts to generate secret lock and key and signature. Apk file. This part does not need to do other special moves.
release mode compiler, you need to do is specify the build command in the Ant target "release". For example, if the directory in bulid.xml run ant, enter the following command:
ant release
build script to compile a program and not signed. Compilation finished. Apk file, you need Jarsigner and your own key to. Apk file signature. If there is no key, you can create a key and secret Keystore lock. If you already have a key, and if the public key, you can give. Apk files signed.
Commissioning period of self-signed certificate for the certificate program in debug mode (default is Eclipse / ADT and Ant builds), since its creation one year from the time period.
When the certificate expires, there will be a compilation error. And the error shown below:
debug:
[Echo] Packaging bin / samples-debug.apk, and signing it with a debug key ...
[Exec] Debug Certificate expired on 8/4/08 3:43 PM
In Eclipse / ADT, you can see a similar error.
A simple way to solve this problem is to remove debug.keystore file. Linux / Mac OSX save this file under ~ /. Android under, windows XP, the file is saved in C: \ Documents and Settings \ <user> \ Local Settings \ Application Data \ Android. windows Vista the file saved in the C: \ Users \ <user> \ AppData \ Local \ Android.
Next compilation, the compiler tool will generate a new secret lock and key.
Note: If your development device using a non-Gregorian locale, often the wrong compiler tools to generate a debug expired certificate, so you will get compile time error. For solution, see the Troubleshooting topic I can't compile my app because the build tools generated an expired debug certificate.
Sample application using ApiDemo
Android SDK contains a set of sample programs, they verify a number of functions and API usage. ApiDemos package is installed in the simulator in advance, so you can start the emulator, an application in the main screen to open it in a drawer.
You can also <SDK> / samples / ApiDemos find the source, can see it, the realization method of learning Demo.
If you prefer, you can also ApiDemo sample program as a project loaded in, modify and run the simulator. However, before that you first uninstall before installing the ApiDemos. If you do not remove the previously installed version of the development environment directly in run or modify ApiDemos, will be installed incorrectly.
On how to uninstall and reinstall ApiDemo, can refer to the I can't install ApiDemos apps in my IDE because of a signing error. So you can in your development environment to work.
Debugging
Android has a wide set of tools to help you debug your application:
DDMS - A lively program that supports port translation (so you can IDE code you under in the endpoint), support the crawling simulator screen, thread and stack information, and many other features. You also can run logcat regain Log information. Click this link for more information.
logcat-dump system information, such information includes, emulator throws an error when the stack is running and log message. Run logcat, click the link.
...
I / MemoryDealer (763): MemoryDealer (this = 0x54bda0): Creating 2621440 bytes heap at 0x438db000
I / Logger (1858): getView () requesting item number 0
I / Logger (1858): getView () requesting item number 1
I / Logger (1858): getView () requesting item number 2
D / ActivityManager (763): Stopping: HistoryRecord (409dbb20 com.android.home.AllApps)
...
Android Log - output log file information simulator Log class. DDMS If you run a logcat, you can read these real-time information. Add your code logging method call. Using the log class, you can get the information you want the important level of call Log.v (verbose), Log.d () (debug), Log.i () (information), Log.w () (warning) or Log.e (error). to distribute log messages Log.i ("MyActivity", "MyClass.getView () - Requesting item number" + position)
You can use logcat read this information.
Traceview - Android can call the function as well as call time saved to a log file, you can use graphics reader Traceview view details. For more information see this link under the subject
Eclipse plugin-Eclipse plug-in integration of a considerable number of tools (ADB, DDMS, logcat output, and other functions), click on this link for more information.
Debug and Test Device Settings-Android reveals a number of useful settings, such as CPU usage and frame rate, see the following Debug and Test Settings on the Emulator
Also, see the Troubleshooting section of the doc to figure out why your application isn't appearing on the emulator, or why it's not starting.
In addition, see the Troubleshooting section of this document to find out why did not your application appear in the simulator, or why not start.

Device debug and test set
Android allows you to set multiple settings so you can test and debug procedures. Development for simulator set, you can choose Dev Tools> Development Settings. Development in accordance with the following options will open the Settings page (or one of them):
Debug app selection process to be debugged, you do not set this to associated debugger, but this variable has two effects:
Android breakpoints in debugging to prevent the Commissioner of time to throw error to stay.
Wait for Debugger allows you to select the option to suspend the proceedings until the debugger to be associated with the (as introduced)
Wait for debugger to load until the associated block on the debugger. So you can onCreate () to set the endpoint, which start the process of debugging when the Activity is important. When you change this option, any currently running instance will be killed. To check this box, you must, as described above to select a debugger. This is the code to add waitForDebugger () is the same.
Immediately destroy activities tell the system as long as the activity stopped on the destruction of it. (Like Android have recovered memory). The test onSaveInstanceState (Bundle) / onCreate (android.os.Bundle) code path is useful when, otherwise, would be difficult to effect. Selecting this option may bring a lot of problems because they do not save the program state.
Show screen updates when this option is selected, the screen redraw any rectangular area will flash pink. This was found unnecessary screen drawing useful.
Show CPU usage at the top of the screen shows the progress of a CPU, display CPU usage. Above the red bar shows the total CPU usage, below the green bar shows the current CPU usage time frame. Note: Once the open time function can not be turned off, unless you start the emulator. ? ? ?
Show background screen displayed when no background activity panel, this usually only occurs when debugging.
Simulator after restart still remember these settings.
Top of the stack dump debugging skills quickly get heap dump from the emulator, you can log adb shell, use the "ps" command to find the process you want, then use "kill-3", the stack using the track will appear in the log file in.
Displayed on the screen in the simulator device can display some useful information useful information, such as CPU utilization, as well as highlight the redraw area. Can set the window in the development of open and close these features. Setting debug and test configurations on the emulator. In detail.
You can Dalvik Debug Monitor Service tool to get the dump state information. Please refer to adb described dumpsys and dumpstate
Get the emulator application state information (dumpsys)
You can Dalvik Debug Monitor Service tools were dumpsys information. Reference adb described dumpsys and dumpstate.
Access to the wireless connection information you can Dalvik Debug Monitor Service tool to get the wireless connection information. In the Device menu, select "Dump radio state"
You can record tracking data activity by calling android.os.Debug.startMethodTracing () to record the function calls and other tracking data. Detailed reference Running the Traceview Debugging Program.
Wireless data recording

By default, the system does not record wireless data (data are many). However, you can use the following command record wireless data:
adb shell
logcat-b radio
Run adb
Android have adb tool, he provides many functions, including mobile and synchronize files to the simulator, change the port the emulator to run UNIX shell. See Using adb.
Screenshots for simulator
Dalvik Debug Monitor Server (DDMS) can crawl simulator screenshots.

Help using the debug class
Android to offer easy to use debugging helper class, such as util.Log and Debug
Compile application installation Anroid
Android build tools specifically required to correctly compile the resource file and other parts of the application, so you must build your application a specific build environment.
Android compiler specific steps, including, XML and other resources to compile the file and create the appropriate output format. Compiled Android application is a. Apk compressed file, it contains. Dex files, resource files, the original data files, and other documents. You can scratch, or construct a suitable source Android works.
Android currently does not support development in the local code on third-party applications.
Comparison of recommended Andriod application development is to use Eclipse with the Android plugin, it supports compile, run, debug Android applications.
If you have any other IDE, Android provides tools for other IDEs can compile and run Android applications, but they are not complete.
Out of an Android application out of an installed application in the emulator, you need to perform adbrun adb deleted. Apk file. . Apk file is installed on when to send to a simulator. Adb shell into the device using the shell, switch to the data / app directory, delete the apk file with the rm command: rm your_app.apk. Usage is described in the connection.
Eclipse Eclipse skills in the execution of arbitrary java code in Eclipse, when the program stopped at the breakpoint when you can execute arbitrary code. For example, in one with "zip" function of the parameter string, you get package information, call the class method. You can also execute arbitrary static methods: such as, input android.os.Debug.startMethodTracing (), start dmTrace.
Open source implementation of the window, the main menu, select Window> Show View> Display, open display window, a simple text editor. Enter your code, highlight the text, click the 'J' icon (or CTRL + SHIFT + D) to run the code. Code in the context of the thread selected to run, and this thread must be stopped at the breakpoint or single-step stopping point. (If you manually link to the thread, you must single step. Thread stopped in Object.wait () is of no use).
If you are currently stopped at a breakpoint, you can simply press the (CTRL + SHIFT + D) highlight and implement a code.
You can highlight text in one selected area, by pressing ALT + SHIFT + up / down arrows to change the size of selected area Here are some examples of input and response messages eclipse display window.
Input
Response
zip
(Java.lang.String) / work/device/out/linux-x86-debug/android/app/android_sdk.zip
zip.endsWith (". zip")
(Boolean) true
zip.endsWith (". jar")
(Boolean) false
You can also use the clipboard to insert the code without debugging. Find the document in the eclipse "scrapbook" related.
Manually run DDMS
Although recommended for ADT plug-in debugger, but you can also manually run the DDMS, configure Eclipse to the debugger on port 8700 (Note: Make sure you start the DDMS).
Increase the JUnit test class in Eclipse / ADT, you can add a JUnit test class program, however, the normal test run before you need to set specific JUnit configuration
JUnit configuration on how to set up more details, see, see the Troubleshooting topic I can't run a Junit test class in Eclipse.
Hello, Android!
As a developer, your first feeling is that you get this development framework to write "Hello, World!" Program level of difficulty you left. Of course, Android, the this very easy, I'll give you the following presentation:
Create a project to create UI
Run the code: Hello, Android
The following sections describe in detail UI using XML Construction
Debugging works do not use Eclipse to create a project we started to create works to create a project as simple as possible, Eclipse Android plug-ins can make the development easier.
You need a computer with Eclipse IDE (reference system and software requirements), you also need to install the Android Eclipse Plugin (ADT). If you are ready to continue to see here.
First, you need to create a "Hello, World!" Have a rough idea:
1. In the menu File> New> Project to create a new Android project.
2. Android project dialog to create complete project details.
3. Edit templates automatically generate code to display some of the output.
That's it, the next step, we will explain in detail each step.
1. Create a new Android project to open Eclipse, select File> New> Project, if the Eclipse Android plug-ins installed correctly, the pop-up dialog will have an "Android", this one has a unique sub-item " Android Project ".

Select the "Android Project", click Next.
2. Fill in the detailed information you need to complete the project next more information, here is an example:

A specific meaning of each:
Project name you want to save your work machine which directory package name
> Package name space (java programming language to follow the naming rules), all your code will be in this namespace. This will generate package names to events automatically. You use the name of this package must be installed on your machine other package names do not conflict, so using a standard rule of the package name is very important. As patients, we used the package name as "com.android", but you need to use a different type.
"Activities" Name This is the plug-in for you automatically generate class names. It also is the Android activity class of a subclass. An activity is just a function and can contain the implementation of the class. If it is selected, you can create user interfaces, but it is not necessary.
Program name is the name of the last generation applications.
Optional box "Use default location" allows you to select a directory to save the other files generated by the project.
3. Editor plugin automatically generates code to run, it will automatically generate a class "HelloAndroid" (available in the program package HelloAndroid> src> com.android.hello found.) Like this:
public class HelloAndroid extends Activity (
/ ** Activity is first created after the call. ** /
@ Override
public void onCreate (Bundle savedInstanceState) (
super.onCreate (savedInstanceState);
setContentView (R.layout.main);
)
)
Now, you can execute a program. But we can also further studies, so that we can better understand the procedures were. So, the next step we can build UI to change some code
We see the following revised code, you can file your HelloAndroid.java do the same changes, we come to line by line analysis:
package com.android.hello;

import android.app.Activity;
import android.os.Bundle;
import android.widget.TextView;

public class HelloAndroid extends Activity (
/ ** Event is created after the first call * /
@ Override
public void onCreate (Bundle savedInstanceState) (
super.onCreate (savedInstanceState);
TextView tv = new TextView (this);
tv.setText ("Hello, Android");
setContentView (tv);
)
)
Tip: If you forget to introduce TextView the packet, you can try Ctrl-Shift-O (If the Mac system Cmd-Shift-O). This is a shortcut to Eclipse management applications - it will show not find the package and then automatically as you add.
In Android, the user interface, called the view by a number of different levels of classes. A view is a simple object. Such as radio button, animation controls, a text box (our example), we said the deal with a child views the text called TextView. Here to teach you how to create a TextView.
Here to teach you how to create a TextView:
TextView tv = new TextView (this);
Android TextView constructor is an instance of the context, this context is just a handle pointing to the system, which provides resources to deal with the class as the service. Contains a number into the database and the parameters of the entrance. The event is also inherited context. HelloAndroid class is a subclass of activities, it is also a context, we operate through this TextView.
Create TextView, add to display the content:
tv.setText ("Hello, Android");
Here is normal.
We create a TextView, and then tell it to display the content. The final step is to make TextView displayed on the screen, like this:
setContentView (tv);
Activities in setContentView () method that view which needs to be operated on the current UI. If an activity can not call this method, then there is no current interface system appears as a blank screen. We just want to display some text, so we will just create the TextView connection Android platform, which is in the "Hello, World", of course, we can see next operation.
Implementation of the code: Hello, Android
Eclipse plug-ins makes it easy to run your program. Select Run> -> Open Run Dialog menu. (Eclipse3.4 version, the menu for the Run-> Run Configurations) can see that the dialog box

Next, select "Android Application", click in the upper left corner (the button like a piece of paper with a "+" sign) or double-click the "Android Application". Have a new option "New_configuration".

Changed its name to the image of a little more like "Hello, Android", and then press the Browse button to select your items, (if you have multiple Android projects in Eclipse need to open, sure to select the right) plug-in will automatically scan your items where activities of sub-class, and then in the "activity" drop down menu loaded. If your "Hello, Android" is only one project, it will be set as the default item, then you can continue.
Click "Apply" button, here is an example:

This can, and click the "Run" button, Android emulator starts. One to start your program will appear, when all OK, you can see:

This is the Android's "Hello, World", is not very simple? The next section we will provide more detailed information. When you reach more of the Android, you will find it very valuable.
Use XML UI construction
You just completed the "Hello, World" example of using what we call a "programmable" in the UI layer, meaning that by writing code to set up your UI layer. When you develop enough of the UI program, you will find some very bad things: some small changes you have to do a lot of code changes. You often forget the View link, which will result in some errors, waste a lot of time to debug your code.
That is why the Android change the UI to provide a development module: XML-based documents. The simplest interpretation of this concept is the demonstration example. Here is a XML file, it can achieve, and you have just finished the code the same effect:
<? Xml version = "1. 0" encoding = "utf-8"?>
<TextView xmlns: android = "http://schemas.android.com/apk/res/android"
android: layout_width = "fill_parent"
android: layout_height = "fill_parent"
android: text = "Hello, Android" />
Android is usually in XML file structure is very simple. Just a collection of some of the tree tag, each tag is a view class. In this case, it is a simple De TextView element of the tree, you can use the XML file's name extension classes Any as your marker, this Yebao Kuo you in your own Daima in the definition of the name. This structure allows you to use a simple structure and syntax of rapid formation of UI, this model as the site development model, you can separate the UI and program logic, to obtain or fill data alone.
In this example, there are four XML attributes, the following are attributes of the general meaning:
Property Description
xmlns: android
This is an XML namespace, told the Android development tools are you going to use Android in some of the common namespace attribute. Android XML design files in all the most outer tag must use the tree.
android: layout_width
This attribute defines the width of the view need to occupy the screen. In this example, we can take only one view of the entire screen, that is, "fill_parent" means.
android: layout_height
This and "layout_width" is similar to that occupied by the screen height.
android: text
This set the text display, in this example, we use "Hello, Android".
This is the XML layout, you need to put this file located? On your project / res / layout can be under. "Res" is a "resource" for short, this catalog contains all the application needs of the non-code section. Such images, strings, XML documents.
Eclipse plug-ins for you to create these XML files in a. In our example above, we do not used it. In the package manager, the start directory / res / layout, editing main.xml file, replace the above text and then save the changes.
Code directory from Open R.java file, you can see them like this:
public final class R (
public static final class attr (
);
public static final class drawable (
public static final int icon = 0x7f020000;
);
public static final class layout (
public static final int main = 0x7f030000;
);
public static final class string (
public static final int app_name = 0x7f040000;
);
);
R.java is the document defining the value of the index of all the resources defined. You use this class in the code, as in your project using a simple method that your resources. In the Eclipse IDE tools such as where, in this way for the code completion feature is very effective because it lets you quickly have to locate what you're looking for.
One important point to note is that there is an internal class "main", a "layout" of the members of the class. Eclipse plug-in to remind you add a new XML file, then generate R.java file, when you add other resources to your project, you can see R.java change in sync.
The last to do is use the latest version of XML you modify your code to replace the previous HelloAndroid coding. This has re-written example of the class of models, you can see, the code becomes very simple:
package com.android.hello;

import android.app.Activity;
import android.os.Bundle;

public class HelloAndroid extends Activity (
/ ** Called when the activity is first created * /
@ Override
public void onCreate (Bundle savedInstanceState) (
super.onCreate (savedInstanceState);
setContentView (R.layout.main);
)
)
When you make these changes, you only need to copy, copy. R in the class that you can use the code in the AutoComplete feature, you'll find that really helpful.
Now you have completed these changes, continue your program - you need to do is press the green "Run" button, or select Run-> Run History-> Hello, Android. You can see ... wow, and as seen before! This shows that the construction of two different ways to achieve the same result.
There are many ways to create the XML file, you want to do before. Read more information available to achieve the user interface.
Commissioning works
Android plug-ins on the Eclipse development and debugging tools for Eclipse integrates very well. In order to show you, we have added a code bug. You can modify the same code like the following to your code:
package com.android.hello;

import android.app.Activity;
import android.os.Bundle;

public class HelloAndroid extends Activity (
/ ** Event is created after the first call * /
@ Override
public void onCreate (Bundle savedInstanceState) (
super.onCreate (savedInstanceState);
Object o = null;
o.toString ();
setContentView (R.layout.main);
)
)
This change just introduced a NullPointerException to your code. If you run the program again, and finally you will see:

According to "Force Quit" to terminate program and turn off the simulator windows.
To search for the wrong reasons, set a breakpoint in the Object o = null; (in the bar code tag next to double-click); and then from the menu select Run-> Debug History-> Hello, Android to enter debug mode. Your application will restart in the simulator, but this will stop you set the breakpoint. You could Eclipse's Debug Perspective in single-step code, the same as you debug other programs.

Do not use Eclipse to create works if you do not use Eclipse (for example, you like other IDE tools, or just use a text editor or command line tool), then the Eclipse plugin does not work for you. Do not worry - it will not because you do not use Eclipse to use to lose any functionality.
Android Eclipse plug-ins on the Android SDK is only a tool outside. (These tools such as: simulator, aapt, adb, ddms in other documents, etc.) Therefore, these tools and other tools such as "ant" build file combination is possible.
Android SDK contains a Python script in "activitycreator.py", it can create for your project all the code and the directory. Like the ant in the "build.xml" file. This allows you to use the command line to compile your project or use your own IDE tool integration.
For example, as we have just created HelloAndroid project using Eclipse, you use the command:
activitycreator.py - out HelloAndroid com.android.hello.HelloAndroid
Compile the project, you run the "ant" command, when the command successfully executed, will be "bin" directory create a "HelloAndroid.apk" file, "apk" file is a package Android, you can use "adb "tool to install or execute.
If you would like more information, please read the website provided for him the document.
Android Applications Android application form is generally of four components by the following structure made of:
Activities of radio receiver services provider to note that not every Andorid applications must reconstruct the four components, some may be caused by a combination of these components.
Once you have determined your application components required, then you should be listed in AndroidManifest.xml them. This is an XML configuration file, which is used to define the components required in the application, components, functions and necessary conditions. This file is necessary. For details, see Android manifest file documentation

The four components as follows:
Activities Activities are the most basic Andorid application components, application program, an activity usually is a single screen. Each activity is implemented as a separate class, and from the activities inherited base class, activity class will be displayed by the view of the composition of user interface controls, and respond to events. Most of the application is composed by the multi-screen display. For example, a text messaging application may have a display screen, the contact list to send a message, the second screen is used to write text messages and select recipients, again a screen view message history or information set manipulation. Each screen here is an activity that is very easy to implement from one screen to a new screen and complete the new activities. In some cases, the current screen may need to move up a screen to provide the return value - for example, allow users to select a photo from the phone address book as a telephone dial back to those picture.
When you open a new screen, a screen will be set prior to suspension of state and pressure into the history stack. Users can rewind back to before the parade opened the screen. We can not selectively remove the need to retain some of the screen, because Android will open the program from the desktop of each remain in the stack.
Intent and Intent Filters
Android proprietary class of Intent calls for agencies to switch between screens. Intent is to describe the application you want to do. Intent data structure is the most important part of the two movements and actions correspond to the data. The typical action types: MAIN (event gateway), VIEW, PICK, EDIT, etc.. The action corresponding to the URI of the form data Zeyi said. For example: To view an individual contact, you need to create an action type VIEW of intent, and one that the person's URI.
Has a relationship with a class called IntentFilter. When the intent to do something when asked, intent filter used to describe an activity (or BroadcastReceiver, see below) to operate what intent. An activity if you want to display a contact person, you need to declare a IntentFilter, this IntentFilter to know how to deal VIEW action and that a person's URI. IntentFilter need AndroidManifest.xml defined.
By analyzing a variety of intent, to switch from one screen to another screen is very simple. When the forward navigation, the event will be called startActivity (myIntent) method. Then, the system will be installed in all applications defined IntentFilter find, find the best match myIntent of Intent corresponding activities. New activities received myIntent the notice, began to run. When the start method is called activity analysis myIntent will trigger the action, this mechanism provides two key benefits:
Activities can re-use from other components in the form of Intent activities can produce of a request at any time by a same IntentFilter new activities to replace radio receiver you can use BroadcastReceiver to make your application on an external event to do the response. For example: When the incoming call, the data network is available, or at night time. BroadcastReceivers not show UI, it is only through NotificationManager to notify the user of these interesting things happened. BroadcastReceivers both registered in AndroidManifest.xml can also be used in the code Context.registerReceiver () to register. But these interesting things happen, your applications do not need to request call BroadcastReceivers, the system will need time to start your application, and where necessary, trigger BroadcastReceivers. Applications also can be used Context.sendBroadcast () will broadcast their own intent broadcasts to other applications.
Services with a service is not for a longer life cycle and user interface procedures. An example is a good play list are songs from media player. In a media player application, should have more activities, so that users can select songs and play songs. However, the music playback function does not correspond to this activity, because users will of course think that the navigation screen to the other music should still play. In this example, the media player of this activity will use Context.startService () to start a service, so you can keep the music in the background. Meanwhile, the system will maintain this service has been implemented to run until the end of this service. (You can read the Life Cycle of an Android Application for more information on services, introduction). In addition, we can also use the Context.bindService () method to connect to a service (if this service has not run to start it) . When connected to a service, we can also provide the interface through the service to communicate with it. Take this example of media players, we also can pause, replay and other operations.
Content Provider
Applications to save their data to a file, SQLite database, or even any valid device. When you want your application to share data with other applications, the content of their would be useful. A content provider class implements a standard set of methods that will allow other applications to save or read the content provider handling the various data types. More detailed information on the content provider, can refer to the attached document Accessing Content Providers.
Tutorial: a notepad application examples of this tutorial taught you the way through, explain how to use the Android framework and various tools to build their own mobile applications. A pre-configured from the start the project file, the tutorial with a simple notepad application complete development process, supported by detailed examples that runs through the guide you how to set up projects, organizations, application logic and UI, and even then the compiler and run the executable procedures.
The tutorial will be the Notepad application development process as a set of exercises (see below), each composed of a number of steps by the exercise. You can closely followed the steps to complete each exercise, gradually establish and improve their own applications. These exercises provided in this application you need to achieve - down to each step - the specific example of the code.
When you complete this tutorial, a practical function of Android applications born from your hands and your Android application development in some of the most important concepts will have a more profound understanding. If you want to you this simple Notepad application to add more complex functionality, you can use Notepad another way to achieve your exercise program cf code specific documents can be found in Sample Code section.
Target audience of this tutorial This tutorial is mainly for a certain experience, especially those with some knowledge of Java programming language developers. If you had never written a Java application, then you can still use this tutorial, but pace slightly slower opinion only.
This tutorial assumes you are familiar with the Android application of some basic concepts and terminology. If you are familiar with these words is not enough, you have to Overview of an Android Application carefully ponder about, to continue following the study.
It is necessary to note, the tutorial Android integrated development environment is a pre-installed plug-in Eclipse. If you do not have Eclipse, can still do these exercises and the establishment of the following applications, but you will be forced to face some of the steps involved in Eclipse Eclipse IDE, how to achieve non-issue.
Practice before the preparation of this tutorial build Android applications involved in the project-related information in Installing the SDK and Hello Android to do the two documents in detail. These two documents explain in detail to establish Android applications, build their own development environment necessary for knowledge. Before you start the tutorial before the two documents, SDK installed and set up the development environment you have to have everything ready to ensure that only wind up.
Training required for this section of the preparatory work: project exercises archive (. Zip) 2. Unzip to a directory on your local 3. Open the folder NotepadCodeLab
1. Download project exercises archive (. Zip)
2. Unzip to a directory on your local
3. Open the folder NotepadCodeLab
NotepadCodeLab this folder are six project files, the specific are: Notepadv1, Notepadv2, Notepadv3, Notepadv1Solution, Notepadv2Solution and Notepadv3Solution. One such Notepadv # project directory is the starting point of each exercise, and Notepadv # Solution is a corresponding answer. If you encounter problems in a practice, you can code your local project compare with the corresponding answers from my answer.
Exercises The following table lists some of the tutorial exercises, and describes the development of each exercise covered in the training content. Each practice is based on before you have completed the premise that any exercise to commence.
Exercise 1
A simple notepad application development process starting this. You can add notes to build a new, simple notes but not edit the list. Demonstrate the basic aspects of ListActivity and how to create and control a menu item, and how to use a SQLite database to store the contents note.
Exercise 2
Notepad application to add a second Activity. Demonstrates how to construct a new Activity to the Android operating system to transfer data between different Activity, using the more advanced screen layout, and demonstrates how to call startActivityForResult () the API to activate another window and returns a result.
Exercise 3
Add to the Event for the application life cycle control, in order to get the application throughout the life cycle state.
Additional study demonstrates how to use the Eclipse debugger and view the Event generated by the debugger after the entire life cycle. This section of non-required reading, but still highly recommended reading.
Other resources and extension of learning not covered in this tutorial, some minor, but more extensive concept, please refer to the Common An
  • del.icio.us
  • StumbleUpon
  • Digg
  • TwitThis
  • Mixx
  • Technorati
  • Facebook
  • NewsVine
  • Reddit
  • Google
  • LinkedIn
  • YahooMyWeb

Related Posts of Documents on the Chinese android

  • Eclipse to run using the specified JVM m2eclipse plugin can not find tools.jar

    Used the m2eclipse plug-ins using struts2 when com.sun necessary to rely on the default-tools.jar, specifically because at the struts-annotations bag designated default-tools.jar <profile> <id> default-tools.jar </ id> <activatio ...

  • Design Pattern in EJB Applications

    What is a Design Pattern Design patterns are a set of re-use, most people know, after cataloging, code design experience. For the use of design patterns are reusable code, so that the code more easily understood by others, and ensure the reliability code.

  • J2EEer Learn Ruby

    Ruby has long heard of the development of efficient and accurate is to use Ruby on Rails to develop WEB applications very convenient. While J2EE has a lot of very good Opensource framework, automatic code generation tools, can greatly enhance the developm

  • Struts + Spring + Hibernate practice

    Tools: Eclipse3.1, MyEclipse4.03, Tomcat5.5.9, Properties Editor plug-ins, MySql4.1.13 New construction: the name for the login Create Struts framework Create index.jsp, add a link to login.jsp Press Ctrl + N, to create login.jsp, LoginAction, the use of

  • The real design and coding

    Software development process at the design and coding, both organizations (as well as other details of the project controllability requirements) engineering method is XP ah, UPS ah what the design phase is to cover the entire software development pro ...

  • Strength of live practice teaching materials, suitable for each person team look - UFIDA Hua Table CTO talk about "out of the software factory"

    A few months ago, on reading "Going the software factory," one book, not yet published at that time, it can be considered the reference of the watch. Although the language rather uneventful, but the contents of people really can not but carry on

  • Software Performance

    1.1 Software Performance In general, the performance is an indicator that the software system or component to its timeliness requirements in line with the level; followed by software performance, are an indicator can be used to measure time. Performa ...

  • jBPM Development Getting Started Guide

    Although the workflow is still immature stage of development, not even a recognized standard. But its application has already been launched in the Express, indicating the market's demand for job-flow framework are urgent and enormous. Backgrounds of o

  • Openfire Plugin Developer's Guide

    Introduction Openfire features plug-ins are enhanced. This document is a guide to developers to create plug-ins. The structure of a plug-in Plug-ins Plug-ins openfireHome stored in the directory. When deploying a plug-in jar or war file, it will automatic

  • In the servlet use Bean

    According to Sun's definition, JavaBean is a reusable software components. In fact JavaBean is a Java class, through the package into a property and methods of treatment of a function or a business object, referred to as bean. Because JavaBean is ...

blog comments powered by Disqus
Recent
Recent Entries
Tag Cloud
Random Entries