For Android Programming beginners, the Sample code provided by the Android SDK is naturally the best learning material.
The Sample code is in the SDK installation directory (X: \ Android \ android-sdk \ samples. However, I encountered some problems when importing data using the Eclipse development environment. On the Internet, we can see that someone is using "File-> Import... "or" File-> New-> Project-> Create Project From Existing Code ", but I have tried it and there are some problems. The latter method can be imported successfully, but the project is not copied to the Eclipse working directory (X: \ Eclipse \ workspace). After being modified as an exercise, the original Sample code is affected, the reference may be lost, and the Sample Directory attribute of the original SDK must be changed from read-only to writable.
After some time, I found that Eclipse has provided a very convenient import method. That is, "File-> New-> Project-> Android Simple Project ". The following is an operation.
----------------------------
---------------------
Select the Sample version you need.
Select the Sample type you need to study. ApiDemos is the most basic and suitable for beginners. Click "Finish.
If it has already been installed, you don't have to worry about misoperations.
Note that the simulator contains the ApiDemos application during compilation and running, which leads to the following error information. Run the "adb uninstall com." command in the SDK installation directory (X: \ Android \ android-sdk \ platform-tools. example. android. to uninstall the original ApiDemos application.
Then our modifications are successfully displayed in the newly compiled application, for example, adding your id to the timer.