From 7cc83988d373911357d11f78e7f2f053b48a6199 Mon Sep 17 00:00:00 2001
From: Rich Slogar Welcome to code samples for Android developers. Here you can browse sample code
- and learn how to build different components for your applications. Use the categories on the left
- to browse the available samples. Welcome to code samples for Android developers. Here you can browse sample code and learn how to
+build different components for your applications. Use the categories on the left to browse the
+available samples. Each sample is a fully functioning Android app. You can browse the resources, source files and
- see the overall project structure. You can copy and paste the code you need, and if you want to
- share a link to a specific line you can double-click it to the get the url.
Android Studio provides easy access to import Android code samples from GitHub and is the +recommended method to retrieve Android code samples.
+ +To import a code sample into Android Studio:
+ +
The sample project opens in a new Android Studio project.
+ Note: When starting Android Studio, you can also select Import an + Android code sample in the Welcome to Android Studio wizard to import a sample project + from GitHub as a new project. +
+ +For more information about importing samples, see +Easy access to Android code samples on +GitHub.
+ +Although importing samples from Android Studio is the recommended method, you can also use the +categories on the left to browse the available samples and learn how to build different components +for your applications.
If you want to download a complete project, just click on any source file in the project and - click the link in the upper right of the source page.
+ click the Download link in the upper right of the source page.To import a downloaded project:
-
Android Studio may ask you to choose the type of project you are importing. If this is the case, make sure to choose Import project from external model and select the Gradle option. @@ -35,11 +61,15 @@ page.tags="examples","code"
+ Note: When starting Android Studio, you can also select Import + Non-Android Studio project in the Welcome to Android Studio wizard to import a + downloaded sample project. +
+Note: At this time, the downloadable projects are designed for use with Gradle - and Android Studio. Project downloads for Eclipse will be available soon! + and Android Studio.
diff --git a/docs/html/tools/studio/index.jd b/docs/html/tools/studio/index.jd index 5b36d5dccdbe9..2297be4011fda 100644 --- a/docs/html/tools/studio/index.jd +++ b/docs/html/tools/studio/index.jd @@ -410,9 +410,14 @@ UI versions). Also, the new drawable XML tags and attributes, such as <ripple and <animated-selector>, are supported. -Clicking Import Samples from the File menu or Welcome page provides seamless access to Google code samples on GitHub.

Figure 12. Code Sample Access
+ +
Figure 13. Imported Code Sample
+ +