Import the source code from the sample of the android sdk to the Eclipse Development Environment

Source: Internet
Author: User

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.

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.