Where can the android samples be found?

别等时光非礼了梦想. 提交于 2019-12-06 00:51:10

问题


I checked google developers website for some exercises and examples in Android Development and I found this webpage: http://developer.android.com/tools/samples/index.html which says

When the download is complete, you can find the source code for all samples at this location: /samples/android-

I didn't find that location! What should I do? And if you know a better practicing way for a beginner to learn,let me know please!


回答1:


You will need to make sure the SDK samples are installed:

This image is from the SDK Manager. Once you check off the samples for the APIs you want, and everything is installed, you can easily make an Eclipse project:

File -> New -> Other -> Android Sample Project

Or you can navigate directly to the path. You can see from my screenshot, that for me it is in Program Files\Android\android-sdk with the samples being in the samples subdirectory.




回答2:


The latest (and most convenient way) to do it is:

  1. open android studio
  2. if a project is currently opened, close it (file -> close project)
  3. on the following screen choose "Import an Android code sample".

Also see http://developer.android.com/samples/index.html




回答3:


It's in the directory where you've installed the Android SDK. If you're running on Windows, it probably looks like C:\android-sdk. Inside it there's a subdirectory called samples. That's where they are. Note however, that they don't come pre-installed with the SDK, you need to actually download samples via the Android SDK first. Just launch it, check the "samples" for the android platform you want and start the download.




回答4:


On Win8: you import samples using Android SDK Manager and they are going to be in this folder (this is the folder with android-sdk):

C:\Users\YourUserName\AppData\Local\Android\sdk\samples

This worked for me



来源:https://stackoverflow.com/questions/15235997/where-can-the-android-samples-be-found

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!