Beginner Android Programming, the sample code provided in the Android SDK is naturally the best learning material.
The sample code is under the SDK installation directory (X:\Android\android-sdk\samples). But I got into some trouble when I was importing with the Eclipse development environment. See someone on the internet was resolved by "file-> Import ..." or "File-> new->project-> Create Project from Existing Code", but I tried, and there was a problem. The latter method can be imported successfully, but the project is not copied to Eclipse's working directory (X:\Eclipse\workspace), which, as the practice changes, affects the original sample code, may lose reference, Also, the original SDK's sample directory attribute is changed from read-only to writable.
After a while, I found that Eclipse has provided a convenient way to import. That's "File-> new->project-> Android simple Project." Below is the operation screenshot, a look is clear, very simple.
----------------------------
---------------------
Select the version of sample you want.
Choose the type of sample you need to study, Apidemos is the most basic, very suitable for beginners. Press "Finish" to finish it.
If you've already installed it, you don't have to worry about doing it incorrectly.
When compiling the runtime, note that the emulator already contains the Apidemos application, which causes the following error message. Need to execute prompt under SDK installation directory (X:\Android\android-sdk\platform-tools) to command "ADB uninstall Com.example.android.apis" To uninstall the original Apidemos application first.
Our changes are then successfully displayed in the newly compiled application, such as adding your own ID to the timer.