Today I want to log on how to open the Android API Demo in [Dir]\android-sdk-windows\samples\android-8\ApiDemos
And then install into your emulator so that you can test/try everything they provided.
The end result you should see something like this.
![](https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjUCI32vREumMm96F4K0-sjsMJxh5Qu-9TL2ZG3ADcjic2bGyMMn2bOUIxxUUkfYDoAQjXGIsfacrJHlQLV3Bi7vdPMPRcVMuaa7RwDRgW3796pHVoa2yS7IdQM1aOjxAqatk6-dUZjdFQ/s400/apidemomain.jpg)
Go to File>New>Android Project and click it.
![](https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjiHNTvJR3ZkvPP1VsV5r8F2uQOFQtmaEnfBKFGdvzmE7RbTAl7SfSxBwfNY2RGh641OEu0_o9JfgXtr_zlwokZSeU_PoXzB8HsuyVwIlxjw2rysN-2psf1C-NqZu_O-KXLzjBoirKemcU/s400/apidemo2.jpg)
A pop up screen will be prompt for you to add new project.
You have to insert the project name as you like ApiDemos for example.
1. Select Create project from existing source
2. Check Android 2.2 (for api 8, version 2.2 is enough)
3. You must select the folder which contains AndroidManifest.xml build and run purposes
![](https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEh6jLTqzLePOsrukAyZtpimg2atma3b0iuPZqNMGhpVwAw-CRZNLrBQYR4X7aKkgtsfsIr3E-SAyvKK7sWXVRu7Kk6pCejtsx2J6OLI0gM6-y9enP9ux8GX3rM1MSVa8s6jkv5kAVMsXtU/s400/apidemo3.jpg)
So look for the "Browse..." button and for the sample folder in android-sdk-windows, the AndroidManifest.xml for apidemo 8 located at android-8>ApiDemos
![](https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjhBhbhW9P6kDKE3zFWwMAeIxbKrCPT63NUzkWKeJLcHpu_hUHXK9n2TGNt1lSsLsIHUodg5_8feJZgXB58bYyr8Zw-q6MdJkJncQZ_vIfeUJz8LiQFSs2a6-B2vXDxSBKCq76P38Io3WI/s400/apidemo4.jpg)
And then click Finish. Once the file is completely import into Eclipse, now we have to run it.
![](https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEj5gRmtdIIHMS4t3X6Dm6DbCjeICCXDEuRposSniL8bOZbH8_13sNfVl6zFIqjteC23FsjHDS_IjjUwVdxoFD2EE-MST4E4qAXUmoUUPy5qHefGj1rRYBN1NAfiBnrR3WiiDOkOEMqsl70/s400/apidemo5.jpg)
Look for the ApiDemos.java within src>com.example.android.apis
![](https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgvp-XYI3_R60QgkgUFPFG_y2ZSm_I87cteuS8QgIxs-a_4kwx71uSuMkRZGbtNbSYsnZuo03vgiRDja0ps-M7Su6wljM630hjfy-kO5nA3R0l44k3i3fuextGrjY2gXaA0sifoCCLu5H0/s400/apidemo6.jpg)
After Open it, then Run the file using the icon on the top of the application.
![](https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhxd8W-h1s9hFkmprbBPdmfmPL5rOb4JwmKESVBvr6tsLukVZSSwdq2SF-irGAqNE64tUo6a3lNoJtetvmh802POSRKHhoK83C2a1ccwvHhFRUCEvAZdEQhqTSGBY9jiLNwgzhlS1eBZ0Q/s400/Run+icon.jpg)
![](https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgYIWsMyjB5U7pBqL7o6kV8ypYn2ObfQpBDU-4G5Tf670ZdeIvbsBf_m3rRxKWrLaWUdbIGX0uKawRC_xXn8rsOPE8FHJBaX_jdgdv12jEolp_uAVkqFDIdVSpA_9DEGbQWs7mc2ms2_Qg/s400/apidemo7.jpg)
Notes: Once you click OK, Eclipse will auto search for the most suitable AVD - Android Virtual Device (track by api Level and android version) that you created to install this application.
If the system found that no match in the list, a pop up screen will ask you to create a new AVD with suitable api.
![](https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEivzim0XupSdRyNJnHVJxxmJGB_5iSg0YeAAxXZmuUzplVv4-3VKKYHHXburhK8twnpuWbuMLnS5xbiwwoGFowy9NTr4Jpmi87KxvlQoXs8qQZ3NYsU9qjXPhiX2zedgJGdr51IyYPDTxk/s400/apidemo8.jpg)
In this case, we use level 8 api. Please click yes to link in to the avd manager or you can find in the toolbar on the top (same row with the Run icon, the icon with a white arrow pointing downwards)
To create AVD, please follow this link - Create AVD
After AVD creation, kindly close the window, a another screen will ask you to choose a suitable AVD, click the refresh button and choose the AVD you have just created.
(You may facing some unknown problem if your computer is out of memory, so please go to the avd manager, start and launch the emulator yourself, close it and open the second time if the Not Responding problem still happening, Cause recently i'm facing this problem)
Yes, unlock the screen, and tap the application icon, now mostly you may get to the page..
No comments:
Post a Comment