Where can the android samples be found?

混江龙づ霸主 提交于 2019-12-04 06:41:32

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.

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

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.

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

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