blob: 635f49eb82c4d64358c27a9bdf0ae136b9d80d26 [file] [log] [blame]
Robert Lyd82b45c2014-06-16 14:02:04 -07001page.title=Samples
2
3@jd:body
4
Andrew Solovayfb7a2872014-06-24 15:35:09 -07005<p>The following code samples are provided for the L Developer Preview. You can
6download them with the Android SDK Manager.</p>
7
8<p>To import a downloaded project:<p>
9
10<div class="toggle-content closed">
11<p style="margin-top:5px"><a href="#" onclick="return toggleContent(this)">
12 <img src="{@docRoot}assets/images/triangle-closed.png" class="toggle-content-img" alt=""
13 />Using Android Studio</a></p>
14
15 <div class="toggle-content-toggleme">
16
17 <ol>
18 <li>Unpack the downloaded project package.</li>
19 <li>In <a href="{@docRoot}sdk/installing/studio.html">Android Studio</a>, chose
20 <strong>File > Import Project</strong> and select the root folder of
21 the unpacked project.
22 <p>Android Studio may ask you to choose the type of project you are
23 importing. If it does, make sure to choose <strong>Import project from
24 external model</strong> and select the <strong>Gradle</strong> option.
25 </p>
26 </li>
27 </ol>
28
29 </div>
30</div>
31
32<p class="note">
33 <strong>Note:</strong> At this time, the downloadable projects are designed
34 for use with Gradle and Android Studio.
35</p>
36
37
38
39
40<h3 id="BasicManagedProfile">BasicManagedProfile</h3>
41<div class="figure" style="width:220px">
42 <img src="{@docRoot}preview/images/BasicManagedProfile.png"
43 srcset="{@docRoot}preview/images/hun-BasicManagedProfile@2x.png 2x"
44 alt="" height="375" />
45 <p class="img-caption">
46 <strong>Figure 1.</strong> The BasicManagedProfile sample app.
47 </p>
48</div>
49
50<p>This sample demonstrates how to create a managed profile. You can also:</p>
51<ul>
52 <li>Enable or disable other apps, and set restrictions on them.</li>
53 <li>Configure intents to be forwarded between the primary account and the
54 managed profile.</li>
55 <li>Wipe all the data associated with the managed profile.</li>
56</ul>
57
58<p class="note"><strong>Note:</strong> There can be only one managed profile on
59 a device at a time.</p>
60
61<h3 id="Camera2Basic">Camera2Basic</h3>
62
63<!--
64<div class="figure" style="width:220px">
65 <img src="" srcset="@2x.png 2x" alt="" height="375" />
66 <p class="img-caption">
67 <strong>Figure n.</strong> Single sentence summarizing the figure.
68 </p>
69</div>
70-->
71
72<p>This sample demonstrates the basic use of the Camera2 API. The sample code
73demonstrates how you can display camera preview and take pictures.</p>
74
75
76
77<h3 id="Camera2Video">Camera2Video</h3>
78<!--
79<div class="figure" style="width:220px">
80<img src="" srcset="@2x.png 2x" alt="" height="375" />
81 <p class="img-caption">
82 <strong>Figure n.</strong> Single sentence summarizing the figure.
83 </p>
84</div>
85-->
86<p>This sample demonstrates how to record video using the Camera2 API.</p>
87
88
89<h3 id="ActivitySceneTransitionBasic">ActivitySceneTransitionBasic</h3>
90<div class="figure" style="width:220px">
91 <img src="{@docRoot}preview/images/ActivitySceneTransitionBasic.png"
92 srcset="{@docRoot}preview/images/ActivitySceneTransitionBasic@2x.png 2x"
93 alt="" height="375" />
94 <p class="img-caption">
95 <strong>Figure 2.</strong> The ActivitySceneTransitionBasic sample app.
96 </p>
97 </div>
98
99<p> This sample demonstrates how to the use {@link android.app.Activity} scene
100transitions when transitioning from one activity to another. Uses a combination
101of <code>moveImage</code> and <code>changeBounds</code> to nicely transition
102from a grid of images to an activity with a large image and detail text. </p>
103
104
105<h3 id="ElevationBasic">ElevationBasic</h3>
106<!--
107<div class="figure" style="width:220px">
108<img src="" srcset="@2x.png 2x" alt="" height="375" />
109 <p class="img-caption">
110 <strong>Figure n.</strong> Single sentence summarizing the figure.
111 </p>
112</div>
113-->
114<p>
115This sample demonstrates two alternative ways to move a view in the z-axis:</p>
116
117<ul>
118 <li>With a fixed elevation, using XML.</li>
119 <li>Raising the elevation when the user taps on it, using
120 <code>setTranslationZ()</code>.</li>
121</ul>
122
123
124
125<h3 id="ElevationDrag">ElevationDrag</h3>
126<!--
127<div class="figure" style="width:220px">
128 <img src="" srcset="@2x.png 2x" alt="" height="375" />
129 <p class="img-caption">
130 <strong>Figure n.</strong> Single sentence summarizing the figure.
131 </p>
132</div>
133-->
134
135<p>This sample demonstrates a drag and drop action on different shapes.
136Elevation and z-translation are used to render the shadows. The views are
137clipped using different outlines.</p>
138
139
140
141<h3 id="ClippingBasic">ClippingBasic</h3>
142<!--
143<div class="figure" style="width:220px">
144 <img src="" srcset="@2x.png 2x" alt="" height="375" />
145 <p class="img-caption">
146 <strong>Figure n.</strong> Single sentence summarizing the figure.
147 </p>
148</div>
149-->
150<p>
151This sample demonstrates clipping on a {@link android.view.View}.
152</p>
153
154
155
156<h3 id="GameControllerSample">GameControllerSample</h3>
157<!--
158<div class="figure" style="width:220px">
159 <img src="" srcset="@2x.png 2x" alt="" height="375" />
160 <p class="img-caption">
161 <strong>Figure n.</strong> Single sentence summarizing the figure.
162 </p>
163</div>
164-->
165<p>
166This sample implements a multi-player game, demonstrating game controller input
167handling.
168</p>
169
170
171
172<h3 id="Visual-Game-Controller">Visual-Game-Controller</h3>
173<!--
174<div class="figure" style="width:220px">
175 <img src="" srcset="@2x.png 2x" alt="" height="375" />
176 <p class="img-caption">
177 <strong>Figure n.</strong> Single sentence summarizing the figure.
178 </p>
179</div>
180-->
181<p>
182This sample displays events received from a game controller shown on the screen.
183</p>
184
185
186
187<h3 id="AndroidTVLeanbackSample">AndroidTVLeanbackSample</h3>
188<!--
189<div class="figure" style="width:220px">
190 <img src="" srcset="@2x.png 2x" alt="" height="375" />
191 <p class="img-caption">
192 <strong>Figure n.</strong> Single sentence summarizing the figure.
193 </p>
194</div>
195-->
196<p>
197This sample demonstrates use of the Android TV Leanback Support Library.
198</p>
199
200
201
202<h3 id="JobSchedulerSample">JobSchedulerSample</h3>
203
204<div class="figure" style="width:220px">
205 <img src="{@docRoot}preview/images/JobSchedulerSample.png"
206 srcset="{@docRoot}preview/images/JobSchedulerSample@2x.png 2x"
207 alt="" height="375" />
208 <p class="img-caption">
209 <strong>Figure 3.</strong> The JobSchedulerSample sample app.
210 </p>
211</div>
212
213<p>
214This sample app allows the user to schedule jobs through the UI, and shows
215visual cues when the jobs are executed.
216</p>
217
218
219
220<h3 id="NavigationDrawerSample">NavigationDrawerSample</h3>
221<!--
222<div class="figure" style="width:220px">
223 <img src="" srcset="@2x.png 2x" alt="" height="375" />
224 <p class="img-caption">
225 <strong>Figure n.</strong> Single sentence summarizing the figure.
226 </p>
227</div>
228-->
229<p>
230This sample illustrates a common usage of the Android support library's
231{@link android.support.v4.widget.DrawerLayout} widget.
232</p>
233
234
235<!--
236<h3 id="">SampleName</h3>
237
238<div class="figure" style="width:220px">
239 <img src="" srcset="@2x.png 2x" alt="" height="375" />
240 <p class="img-caption">
241 <strong>Figure n.</strong> Single sentence summarizing the figure.
242 </p>
243</div>
244
245<p>
246**description**
247</p>
248-->