blob: eaa96d3d337627bad1434c67ba2a8fe62d92f1fa [file] [log] [blame]
smain@google.comcf18fa62014-12-09 16:39:47 -08001page.title=Android Studio Overview
Rich Slogare3fe9382014-11-20 13:49:05 -08002@jd:body
3
4<div id="qv-wrapper">
5<div id="qv">
6
7 <h2>In this document</h2>
8 <ol>
9 <li><a href="#project-structure">Project and File Structure</a></li>
10 <li><a href="#build-system">Android Build System</a></li>
11 <li><a href="#debug-perf">Debug and Performance</a></li>
12 <li><a href="#install-updates">Installation, Setup, and Update Management</a></li>
Rich Slogar0726a312015-01-26 11:08:55 -080013 <li><a href="#proxy">HTTP Proxy Settings</a></li>
Rich Slogare3fe9382014-11-20 13:49:05 -080014 <li><a href="#other">Other Highlights</a></li>
15
16
17 </ol>
18
19 <h2>See also</h2>
20 <ol>
Rich Slogare3fe9382014-11-20 13:49:05 -080021 <li><a href="http://confluence.jetbrains.com/display/IntelliJIDEA/FAQ+on+Migrating+to+IntelliJ+IDEA">IntelliJ FAQ on migrating to IntelliJ IDEA</a></li>
Rich Slogare3fe9382014-11-20 13:49:05 -080022 </ol>
23
24</div>
25</div>
26
27
smain@google.com35ee3012014-12-08 00:41:17 -080028<p>Android Studio is the official IDE for Android application development,
29based on <a href="https://www.jetbrains.com/idea/" class="external-link"
30target="_blank">IntelliJ IDEA</a>.
31On top of the capabilities you expect from IntelliJ,
32Android Studio offers:</p>
Rich Slogare3fe9382014-11-20 13:49:05 -080033
34<ul>
35 <li>Flexible Gradle-based build system</li>
36 <li>Build variants and multiple <code>apk</code> file generation</li>
smain@google.com35ee3012014-12-08 00:41:17 -080037 <li>Code templates to help you build common app features</li>
Rich Slogare3fe9382014-11-20 13:49:05 -080038 <li>Rich layout editor with support for drag and drop theme editing</li>
Rich Slogar56375d92015-01-07 13:52:12 -080039 <li>{@code lint} tools to catch performance, usability, version compatibility, and other problems</li>
Rich Slogare3fe9382014-11-20 13:49:05 -080040 <li>ProGuard and app-signing capabilities</li>
41 <li>Built-in support for <a
42 href="http://developers.google.com/cloud/devtools/android_studio_templates/"
43 class="external-link">Google Cloud Platform</a>, making it easy to integrate Google Cloud
44 Messaging and App Engine</li>
smain@google.com35ee3012014-12-08 00:41:17 -080045 <li>And much more</li>
Rich Slogare3fe9382014-11-20 13:49:05 -080046</ul>
47
smain@google.com2023bec2014-12-08 19:18:27 -080048<p><b><a href="{@docRoot}sdk/index.html">Download Android Studio now</a></b>. </p>
Rich Slogare3fe9382014-11-20 13:49:05 -080049
smain@google.com35ee3012014-12-08 00:41:17 -080050<p>If you're new to Android Studio or the IntelliJ IDEA interface, this
51page provides an introduction to some key Android
52Studio features.</p>
Rich Slogare3fe9382014-11-20 13:49:05 -080053
smain@google.com35ee3012014-12-08 00:41:17 -080054<p>For specific Android Studio how-to documentation, see the pages in the <a href=
55"{@docRoot}tools/workflow/index.html">Workflow</a> section, such as <a href=
56"{@docRoot}tools/projects/projects-studio.html">Managing Projects from Android Studio</a> and
57<a href="{@docRoot}tools/building/building-studio.html">Building and Running from Android
58Studio</a>.</p>
59
Rich Slogare3fe9382014-11-20 13:49:05 -080060
61
62
63<h2 id="project-structure">Project and File Structure</h2>
64
65<h3 id="project-view"><em>Android</em> Project View</h3>
66<p>By default, Android Studio displays your profile files in the <em>Android</em> project view. This
67view shows a flattened version of your project's structure that provides quick access to the key
Rich Slogar38f22422015-01-30 15:25:21 -080068source files of Android projects and helps you work with the
Rich Slogare3fe9382014-11-20 13:49:05 -080069<a href="{@docRoot}sdk/installing/studio-build.html">Gradle-based build system</a>.
70The Android project view:</p>
71
72<ul>
73 <li>Groups the build files for all modules at the top level of the project hierarchy.</li>
74 <li>Shows the most important source directories at the top level of the module hierarchy.</li>
75 <li>Groups all the manifest files for each module.</li>
76 <li>Shows resource files from all Gradle source sets.</li>
77 <li>Groups resource files for different locales, orientations, and screen types in a single
78 group per resource type.</li>
79</ul>
80
81 <img src="{@docRoot}images/tools/projectview01.png" />
smain@google.com35ee3012014-12-08 00:41:17 -080082 <p class="img-caption"><strong>Figure 1.</strong> Show the Android project view.</p>
Rich Slogare3fe9382014-11-20 13:49:05 -080083 <img src="{@docRoot}images/tools/studio-projectview_scripts.png" />
smain@google.com35ee3012014-12-08 00:41:17 -080084 <p class="img-caption"><strong>Figure 2.</strong> Project Build Files.</p>
Rich Slogare3fe9382014-11-20 13:49:05 -080085
86<p>The <em>Android</em> project view shows all the build files at the top level of the project
87hierarchy under <strong>Gradle Scripts</strong>. Each project module appears as a folder at the
88top level of the project hierarchy and contains these three elements at the top level:</p>
89
90<ul>
91 <li><code>java/</code> - Source files for the module.</li>
92 <li><code>manifests/</code> - Manifest files for the module.</li>
93 <li><code>res/</code> - Resource files for the module.</li>
94</ul>
95
96<p>For example, <em>Android</em> project view groups all the instances of the
97<code>ic_launcher.png</code> resource for different screen densities under the same element.</p>
98
99<p class="note"><strong>Note:</strong> The project structure on disk differs from this flattened
David Friedman7cdd6672015-02-20 09:40:06 -0800100representation. To switch to back to the segregated project view, select <strong>Project</strong> from
101the <strong>Project</strong> drop-down. </p>
Rich Slogare3fe9382014-11-20 13:49:05 -0800102
103
104
Rich Slogar38f22422015-01-30 15:25:21 -0800105<h3>Android Studio Project and Directory Structure</h3>
smain@google.com6ae492e2014-12-08 11:28:16 -0800106<p>When you use the <em>Project</em> view of a new project in Android Studio, you
107should notice that the project structure appears different than you may be used to in Eclipse. Each
Rich Slogare3fe9382014-11-20 13:49:05 -0800108instance of Android Studio contains a project with one or more application modules. Each
109application module folder contains the complete source sets for that module, including
110{@code src/main} and {@code src/androidTest} directories, resources, build
111file and the Android manifest. For the most part, you will need to modify the files under each
112module's {@code src/main} directory for source code updates, the gradle.build file for build
113specification and the files under {@code src/androidTest} directory for test case creation.
114
115 <p> <img src="{@docRoot}images/tools/studio-project-layout.png" alt="" /></p>
116 <p> <class="img-caption"><strong>Figure 3.</strong> Android Studio project structure</p>
117
Rich Slogar88669752014-12-10 10:04:26 -0800118<p>For more information, see
119<a href="http://confluence.jetbrains.com/display/IntelliJIDEA/Project+Organization"class="external-link">IntelliJ project organization</a> and
120<a href="{@docRoot}tools/projects/index.html">Managing Projects</a>.</p>
Rich Slogare3fe9382014-11-20 13:49:05 -0800121
122
Rich Slogar38f22422015-01-30 15:25:21 -0800123
Rich Slogare3fe9382014-11-20 13:49:05 -0800124<h3>Creating new files</h3>
125<p>You can quickly add new code and resource files by clicking the appropriate directory in the
126<strong>Project</strong> pane and pressing <code>ALT + INSERT</code> on Windows and Linux or
127<code>COMMAND + N</code> on Mac. Based on the type of directory selected, Android Studio
128offers to create the appropriate file type.</p>
129
130<p>For example, if you select a layout directory, press <code>ALT + INSERT</code> on Windows,
131and select <strong>Layout resource file</strong>, a dialog opens so you can name the file
132(you can exclude the {@code .xml} suffix) and choose a root view element. The editor then
133switches to the layout design editor so you can begin designing your layout.</p>
134
135
136
137<h2 id="build-system">Android Build System</h2>
138
139<h3>Android Build System</h3>
140<p>The Android build system is the toolkit you use to build, test, run and package
141your apps. This build system replaces the Ant system used with Eclipse ADT. It can run as an
142integrated tool from the Android Studio menu and independently from the command line. You can use
143the features of the build system to:</p>
144
145<ul>
146 <li>Customize, configure, and extend the build process.</li>
147 <li>Create multiple APKs for your app with different features using the same project and
148 modules.</li>
149 <li>Reuse code and resources across source sets.</li>
150</ul>
151
152<p>The flexibility of the Android build system enables you to achieve all of this without
153modifying your app's core source files. To build an Android Studio project, see
154<a href="{@docRoot}tools/building/building-studio.html">Building and Running from Android Studio</a>.
155To configure custom build settings in an Android Studio project, see
Joe Fernandez3ec76e02014-12-07 21:48:05 -0800156<a href="{@docRoot}tools/building/configuring-gradle.html">Configuring Gradle Builds</a>.</p>
Rich Slogare3fe9382014-11-20 13:49:05 -0800157
158
159<h3>Application ID for Package Identification </h3>
160<p>With the Android build system, the <em>applicationId</em> attribute is used to
161uniquely identify application packages for publishing. The application ID is set in the
162<em>android</em> section of the <code>build.gradle</code> file.
163</p>
164
165 <pre>
166 apply plugin: 'com.android.application'
167
168 android {
169 compileSdkVersion 19
170 buildToolsVersion "19.1"
171
172 defaultConfig {
173 <strong>applicationId "com.example.my.app"</strong>
174 minSdkVersion 15
175 targetSdkVersion 19
176 versionCode 1
177 versionName "1.0"
178 }
179 ...
180 </pre>
181
182<p class="note"><strong>Note:</strong> The <em>applicationId</em> is specified only in your
183build.gradle file, and not in the AndroidManifest.xml file.</p>
184
David Friedman7cdd6672015-02-20 09:40:06 -0800185<p>When using build variants, the build system enables you to uniquely identify different
Rich Slogare3fe9382014-11-20 13:49:05 -0800186packages for each product flavors and build types. The application ID in the build type is added as
187a suffix to those specified for the product flavors. </p>
188
189 <pre>
190 productFlavors {
191 pro {
192 applicationId = "com.example.my.pkg.pro"
193 }
194 free {
195 applicationId = "com.example.my.pkg.free"
196 }
197 }
198
199 buildTypes {
200 debug {
201 applicationIdSuffix ".debug"
202 }
203 }
204 ....
205 </pre>
206
207<p>The package name must still be specified in the manifest file. It is used in your source code
208to refer to your R class and to resolve any relative activity/service registrations. </p>
209
210 <pre>
211 <?xml version="1.0" encoding="utf-8"?>
212 <manifest xmlns:android="http://schemas.android.com/apk/res/android"
213 <strong>package="com.example.app"</strong>>
214 </pre>
215
Rich Slogaree371072015-01-05 14:47:19 -0800216<p class="note"><strong>Note:</strong> If you have multiple manifests (for example, a product
Rich Slogare3fe9382014-11-20 13:49:05 -0800217flavor specific manifest and a build type manifest), the package name is optional in those manifests.
218If it is specified in those manifests, the package name must be identical to the package name
219specified in the manifest in the <code>src/main/</code> folder. </p>
220
221<p>For more information about the build files and process, see
222<a href="{@docRoot}sdk/installing/studio-build.html">Build System Overview</a>.</p>
223
224
225
226
227<h2 id="debug-perf">Debug and Performance</h2>
228
229
230<h3>Android Virtual Device (AVD) Manager</h3>
231<p>AVD Manager has updated screens with links to help you select the most popular device
232configurations, screen sizes and resolutions for your app previews.</p>
233Click the <strong>Android Virtual Device Manager</strong>
234<img src="{@docRoot}images/tools/avd-manager-studio.png"
235style="vertical-align:bottom;margin:0;height:19px" /> in the toolbar to open it and create
236new virtual devices for running your app in the emulator.</p>
237
238<p>The AVD Manager comes with emulators for Nexus 6 and Nexus 9 devices and also supports
239creating custom Android device skins based on specific emulator properties and assigning those
Rich Slogard282ba72014-12-11 10:03:19 -0800240skins to hardware profiles. Android Studio installs the Intel&#174; x86 Hardware Accelerated Execution
241Manager (HAXM) emulator accelerator and creates a default emulator for quick app prototyping.</p>
Rich Slogare3fe9382014-11-20 13:49:05 -0800242
243<p>For more information, see <a href="{@docRoot}tools/devices/managing-avds.html">Managing AVDs</a>.</p>
244
245
246
Rich Slogar56375d92015-01-07 13:52:12 -0800247<h3>Memory Monitor</h3>
Rich Slogare3fe9382014-11-20 13:49:05 -0800248<p>Android Studio provides a memory monitor view so you can more easily monitor your
249app's memory usage to find deallocated objects, locate memory leaks and track the amount of
250memory the connected device is using. With your app running on a device or emulator, click the
251<strong>Memory Monitor</strong> tab in the lower right corner to launch the memory monitor. </p>
252
253 <img src="{@docRoot}images/tools/studio-memory-monitor.png" />
Rich Slogar38f22422015-01-30 15:25:21 -0800254 <p class="img-caption"><strong>Figure 5.</strong> Memory Monitor</p>
Rich Slogare3fe9382014-11-20 13:49:05 -0800255
256
257
Rich Slogar56375d92015-01-07 13:52:12 -0800258<h3>Code Inspections</h3>
259<p>In Android Studio, the configured <a href="{@docRoot}tools/help/lint.html"><code>lint</code></a> and
260other IDE inspections run automatically whenever you compile your program. In addition to the
261configured {@code lint} checks, additional
262<a href="https://www.jetbrains.com/idea/help/inspection-basics.html?search=inspection" class="external-link"
263target="_blank">IntelliJ code inspections</a>
264run to streamline code review.</p>
Rich Slogare3fe9382014-11-20 13:49:05 -0800265
Rich Slogar56375d92015-01-07 13:52:12 -0800266
267<p>Android Studio enables several <code>lint</code> checks
268to ensure:
269<ul>
270 <li><code> Cipher.getInstance()</code> is used with safe values</li>
271 <li>In custom Views, the associated declare-styleable for the custom view uses the same
272 base name as the class name.</li>
273 <li>Security check for fragment injection.</li>
274 <li>Where ever property assignment no longer works as expected.</li>
275 <li>Gradle plugin version is compatible with the SDK.</li>
276 <li>Right to left validation </li>
277 <li>Required API version</li>
278 <li>many others</li>
279</ul>
280
281
282<p>Hovering over an inspection error displays the full issue explanation inline for easy error
Rich Slogare3fe9382014-11-20 13:49:05 -0800283resolution. There is also a helpful hyperlink at the end of the error message for additional
284error information.</p>
285
Rich Slogar56375d92015-01-07 13:52:12 -0800286<p>With Android Studio, you can also run {@code lint} inspections for a specific build variant, or
287for all build variants. You can configure the {@code lint} inspections that run by adding a
288<code>lintOptions</code> property to the Android settings in the <code>build.gradle</code>
289file. </p>
Rich Slogare3fe9382014-11-20 13:49:05 -0800290
Rich Slogar56375d92015-01-07 13:52:12 -0800291<pre>
292android {
293 lintOptions {
294 // set to true to turn off analysis progress reporting by lint
295 quiet true
296 // if true, stop the gradle build if errors are found
297 abortOnError false
298 // if true, only report errors
299 ignoreWarnings true
300 }
301</pre>
302
303
304<p>You can also manage inspection profiles and configure inspections within Android Studio.
305Choose <strong>File &gt; Settings &gt; Project Settings</strong>. The
306<em>Inspection Configuration</em> page appears with the supported inspections.</p>
307<p><img src="{@docRoot}images/tools/studio-inspections-config.png" alt="" /> </p>
308<p class="img-caption"><strong>Figure 5.</strong> Inspection Configuration</p>
309
310<p class="note"><strong>Note:</strong> If you wish to change the behavior of specific
311inspection notifications, you can change the inspection severity, for example from <em>warning</em>
312to <em>error</em>. </p>
313
314
315<p>To manually run inspections in Android Studio, choose <strong>Analyze &gt; Inspect Code</strong>.
316The <em>Inspections Scope</em> dialog appears so you can specify the desired inspection profile and scope.</p>
317
318
319
320<h4>Running Inspections from the command line</h4>
321<p>You can also run {@code lint} inspections from the command line in your SDK directory. </p>
322<pre>
323sdk$ lint [flags] <project directories>
324</pre>
325
326<p class="note"><strong>Note:</strong> The {@code lint} <strong>--show</strong> and <strong>--list</strong>
327flags can be used to display the available issues and explanations. </p>
328
Rich Slogare3fe9382014-11-20 13:49:05 -0800329
330<p>For more information, see
Rich Slogar56375d92015-01-07 13:52:12 -0800331<a href="{@docRoot}tools/debugging/improving-w-lint.html">Improving Your Code with {@code lint}</a> and
332<a href="{@docRoot}tools/help/lint.html">lint tool</a>.</p>
Rich Slogare3fe9382014-11-20 13:49:05 -0800333
334
335<h3>Dynamic layout preview</h3>
336<p>Android Studio allows you to work with layouts in both a <em>Design View</em> </p>
337<p><img src="{@docRoot}images/tools/studio-helloworld-design.png" alt="" />
338</p>
Rich Slogar38f22422015-01-30 15:25:21 -0800339 <p class="img-caption"><strong>Figure 6.</strong> Hello World App with Design View</p>
Rich Slogare3fe9382014-11-20 13:49:05 -0800340
341<p>and a <em>Text View</em>. </p>
342
343 <p><img src="{@docRoot}images/tools/studio-helloworld-text.png" alt="" />
Rich Slogar38f22422015-01-30 15:25:21 -0800344 <pclass="img-caption"><strong>Figure 7.</strong> Hello World App with Text View</p>
Rich Slogare3fe9382014-11-20 13:49:05 -0800345
346<p>Easily select and preview layout changes for different device images, display
347densities, UI modes, locales, and Android versions (multi-API version rendering).
348 <p><img src="{@docRoot}images/tools/studio-api-version-rendering.png" /></p>
Rich Slogar38f22422015-01-30 15:25:21 -0800349 <p class="img-caption"><strong>Figure 8.</strong> API Version Rendering</p>
Rich Slogare3fe9382014-11-20 13:49:05 -0800350
351
352<p>From the Design View, you can drag and drop elements from the Palette to the Preview or
353Component Tree. The Text View allows you to directly edit the XML settings, while previewing
354the device display. </p>
355
356
357<h3>Log messages</h3>
358<p>When you build and run your app with Android Studio, you can view adb and device log messages
359(logcat) in the DDMS pane by clicking <strong>Android</strong> at the bottom of the window.</p>
360
361<p>If you want to debug your app with the
Rich Slogaree371072015-01-05 14:47:19 -0800362<a href="{@docRoot}tools/help/monitor.html">Android Debug Monitor</a>, you can launch it by
Rich Slogare3fe9382014-11-20 13:49:05 -0800363clicking <strong>Monitor</strong>
364<img src="{@docRoot}images/tools/monitor-studio.png" style="vertical-align:bottom;margin:0;height:19px"/>
365in the toolbar. The Debug Monitor is where you can find the complete set of
366<a href="{@docRoot}tools/debugging/ddms.html">DDMS</a> tools for profiling your app,
367controlling device behaviors, and more. It also includes the Hierarchy Viewer tools to help
368<a href="{@docRoot}tools/debugging/debugging-ui.html"> optimize your layouts</a>.</p>
369
370
371
372
373<h2 id="install-updates">Installation, Setup, and Update Management</h2>
374
375<h3>Android Studio installation and setup wizards</h3>
376<p>An updated installation and setup wizards walk you through a step-by-step installation
377and setup process as the wizard checks for system requirements, such as the Java Development
378Kit (JDK) and available RAM, and then prompts for optional installation options, such as the
Rich Slogard282ba72014-12-11 10:03:19 -0800379Intel&#174; HAXM emulator accelerator.</p>
Rich Slogare3fe9382014-11-20 13:49:05 -0800380
381<p>An updated setup wizard walks you through the setup processes as
382the wizard updates your system image and emulation requirements, such GPU, and then creates
Rich Slogar7789f4d2014-12-11 16:25:17 -0800383an optimized default Android Virtual Device (AVD) based on Android 5 (Lollipop) for speedy and
Rich Slogare3fe9382014-11-20 13:49:05 -0800384reliable emulation. </p>
385<p><img src="{@docRoot}images/tools/studio-setup-wizard.png" /></p>
Rich Slogar38f22422015-01-30 15:25:21 -0800386<p class="img-caption"><strong>Figure 9.</strong> Setup Wizard</p>
Rich Slogare3fe9382014-11-20 13:49:05 -0800387
388
389<h3>Expanded template and form factor support</h3>
Rich Slogar38f22422015-01-30 15:25:21 -0800390<p>Android Studio supports templates for Google Services and expands the available device
Rich Slogare3fe9382014-11-20 13:49:05 -0800391types. </p>
392
393 <h4> Android Wear and TV support</h4>
394 <p>For easy cross-platform development, the Project Wizard provides new templates for
395 creating your apps for Android Wear and TV. </p>
396 <p><img src="{@docRoot}images/tools/studio-tvwearsupport.png" />
Rich Slogar56375d92015-01-07 13:52:12 -0800397
Rich Slogar38f22422015-01-30 15:25:21 -0800398 <p class="img-caption"><strong>Figure 10.</strong> Supported Form Factors</p>
Rich Slogare3fe9382014-11-20 13:49:05 -0800399 <p>During app creation, the Project Wizard also displays an API Level dialog to help you choose
400 the best <em>minSdkVersion</em> for your project.</p>
401
402
403 <h4> Google App Engine integration (Google Cloud Platform/Messaging)</h4>
404 <p>Quick cloud integration. Using Google App Engine to connect to the Google cloud
405 and create a cloud end-point is as easy as selecting <em>File > New Module > App Engine Java
406 Servlet Module</em> and specifying the module, package, and client names. </p>
407 <p><img src="{@docRoot}images/tools/studio-cloudmodule.png" /></p>
Rich Slogar38f22422015-01-30 15:25:21 -0800408 <p class="img-caption"><strong>Figure 11.</strong> Setup Wizard</p>
Rich Slogare3fe9382014-11-20 13:49:05 -0800409
410
411
412<h3>Update channels</h3>
413<p>Android Studio provides four update channels to keep Android Studio up-to-date based on your
414code-level preference:
415<ul>
416 <li><strong>Canary channel</strong>: Canary builds provide bleeding edge releases, updated
417 about weekly. While these builds do get tested, they are still subject to bugs, as we want
418 people to see what's new as soon as possible. This is not recommended for production.</li>
419 <li><strong>Dev channel</strong>: Dev builds are hand-picked older canary builds that survived
420 the test of time. They are updated roughly bi-weekly or monthly.</li>
421 <li><strong>Beta channel</strong>: Beta builds are used for beta-quality releases before a
422 production release.</li>
Rich Slogar7789f4d2014-12-11 16:25:17 -0800423 <li><strong>Stable channel</strong>: Used for stable, production-ready versions.</li>
Rich Slogare3fe9382014-11-20 13:49:05 -0800424</ul>
425</p>
426
427<p>By default, Android Studio uses the <em>Stable</em> channel. Use
428<strong>File > Settings > Updates</strong> to change your channel setting. </p>
429
430
431
Rich Slogar0726a312015-01-26 11:08:55 -0800432<h2 id="proxy">Proxy Settings</h2>
433<p>Proxies serve as intermediary connection points between HTTP clients and web servers that add
434security and privacy to internet connections.</p>
435
436<p>To support running Android Studio behind a firewall, set the proxy settings for the
437Android Studio IDE and the SDK Manager. Use the Android Studio IDE HTTP Proxy settings page to set
438the HTTP proxy settings for Android Studio. The SDK Manager has a separate HTTP Proxy settings
439page.</p>
440
441<p>When running the Android Plugin for Gradle from the command line or on machines where
442Android Studio is not installed, such as continuous integration servers, set the proxy settings
443in the Gradle build file.</p>
444
445<p class="note"><strong>Note:</strong> After the initial installation of the Android Studio bundle,
446Android Studio can run with internet access or off-line. However, Android Studio requires an
447internet connection for Setup Wizard synchronization, 3rd-party library access, access to remote
448repositories, Gradle initialization and synchronization, and Android Studio version updates.</p>
449
450
451<h3>Setting up the Android Studio Proxy</h3>
452<p>Android Studio supports HTTP proxy settings so you can run Android Studio behind a firewall or
453secure network. To set the HTTP proxy settings in Android Studio:</p>
454<ol>
455 <li>From the main menu choose <strong>File &gt; Settings &gt; IDE Setting -- HTTP Proxy</strong>.
456
457<li>In Android Studio, open the IDE Settings dialog.
458 <ul>
459 <li>On Windows and Linux, choose
460 <strong>File &gt; Settings &gt; IDE Setting -- HTTP Proxy</strong>. </li>
461 <li>On Mac, choose
462 <strong>Android Studio &gt; Preferences &gt; IDE Setting -- HTTP Proxy</strong>. </li>
463 </ul>
464 The HTTP Proxy page appears.</li>
465 <li>Select <strong>auto-detection</strong> to use an auto-configuration URL to configure the
466 proxy settings or <strong>manual</strong> to enter each of the settings. For a detailed explanation
467 of these settings, see
468 <a href="https://www.jetbrains.com/idea/help/http-proxy.html">HTTP Proxy</a>. </li>
469 <li>Click <strong>Apply</strong> to enable the proxy settings. </li>
470</ol>
471
472<h3>Android Plugin for Gradle HTTP proxy settings</h3>
473When running the Android Plugin from the command line or on machines where Android Studio is not
474installed, set the Android Plugin for Gradle proxy settings in the Gradle build file.</p>
475
476<p>For application-specific HTTP proxy settings, set the proxy settings in the
477<strong>build.gradle</strong> file as required for each application module.</p>
478<pre>
479apply plugin: 'com.android.application'
480
481android {
482 ...
483
484 defaultConfig {
485 ...
486 systemProp.http.proxyHost=proxy.company.com
487 systemProp.http.proxyPort=443
488 systemProp.http.proxyUser=userid
489 systemProp.http.proxyPassword=password
490 systemProp.http.auth.ntlm.domain=domain
491 }
492 ...
493}
494</pre>
495
496
497
498<p>For project-wide HTTP proxy settings, set the proxy settings in the
499<code>gradle/gradle.properties</code> file. </p>
500
501<pre>
502# Project-wide Gradle settings.
503...
504
505systemProp.http.proxyHost=proxy.company.com
506systemProp.http.proxyPort=443
507systemProp.http.proxyUser=username
508systemProp.http.proxyPassword=password
509systemProp.http.auth.ntlm.domain=domain
510
511systemProp.https.proxyHost=proxy.company.com
512systemProp.https.proxyPort=443
513systemProp.https.proxyUser=username
514systemProp.https.proxyPassword=password
515systemProp.https.auth.ntlm.domain=domain
516
517...
518</pre>
519
520
521<p>For information about using Gradle properties for proxy settings, see the
522 <a href="http://www.gradle.org/docs/current/userguide/build_environment.html">Gradle User Guide</a>.</p>
523
524<p class="note"><strong>Note:</strong> When using Android Studio, the settings in the Android
525Studio IDE HTTP proxy settings page override the HTTP proxy settings in the
526<strong>gradle.properties</strong> file.</p>
527
528
529
530<h3>SDK Manager HTTP Proxy Settings </h3>
531<p>SDK Manager proxy settings enable proxy internet access for Android package and library
532updates from SDK Manager packages. </p>
533
534<p>To set the SDK Manager settings for proxy internet access, start the SDK Manager and open the
535SDK Manager page. </p>
536
537<ul>
538 <li>On Windows, select <strong>Tools &gt; Options</strong> from the menu bar. </li>
539 <li>On Mac and Linux, choose <strong>Tools &gt; Options</strong> from the system menu bar. </li>
540 </ul>
541
542<p>The Android SDK Manager page appears. Enter the settings and click <strong>Apply</strong>. </p>
543
544
545
Rich Slogard282ba72014-12-11 10:03:19 -0800546<h2 id="other">Other Highlights</h2>
Rich Slogare3fe9382014-11-20 13:49:05 -0800547
548<h3> Translation Editor</h3>
549<p>Multi-language support is enhanced with the Translation Editor plugin so you can easily add
550locales to the app's translation file. Color codes indicate whether a locale is complete or
551still missing string translations. Also, you can use the plugin to export your strings to the
552Google Play Developer Console for translation, then download and import your translations back
553into your project. </p>
554
555<p>To access the Translation Editor, open a <code>strings.xml</code> file and click the
556<strong>Open Editor</strong> link. </p>
557
558 <img src="{@docRoot}images/tools/studio-translationeditoropen.png" />
Rich Slogar38f22422015-01-30 15:25:21 -0800559 <p class="img-caption"><strong>Figure 12.</strong> Translation Editor</p>
Rich Slogare3fe9382014-11-20 13:49:05 -0800560
561
562<h3> Editor support for the latest Android APIs</h3>
Rich Slogar38f22422015-01-30 15:25:21 -0800563<p>Android Studio supports the
Rich Slogare3fe9382014-11-20 13:49:05 -0800564<a href="{@docRoot}design/material/index.html">Material Design</a></li> themes, widgets, and
565graphics, such as shadow layers and API version rendering (showing the layout across different
Rich Slogar38f22422015-01-30 15:25:21 -0800566UI versions). Also, the drawable XML tags and attributes, such as &lt;ripple&gt;
Rich Slogare3fe9382014-11-20 13:49:05 -0800567and &lt;animated-selector&gt;, are supported.</p>
568
569
Rich Slogar7cc83982014-12-15 15:51:28 -0800570<h3 id="git-samples"> Easy access to Android code samples on GitHub</h3>
Rich Slogar56375d92015-01-07 13:52:12 -0800571<p>Clicking <strong>Import Samples</strong> from the <strong>File</strong> menu or <em>Welcome</em> page
572
Rich Slogare3fe9382014-11-20 13:49:05 -0800573provides seamless access to Google code samples on GitHub.</p>
574 <p><img src="{@docRoot}images/tools/studio-samples-githubaccess.png" /></p>
Rich Slogar38f22422015-01-30 15:25:21 -0800575 <p class="img-caption"><strong>Figure 13.</strong> Code Sample Access</p>
Rich Slogare3fe9382014-11-20 13:49:05 -0800576
Rich Slogar7cc83982014-12-15 15:51:28 -0800577
578 <p><img src="{@docRoot}images/tools/studio-sample-in-editor.png" /></p>
Rich Slogar38f22422015-01-30 15:25:21 -0800579 <p class="img-caption"><strong>Figure 14.</strong> Imported Code Sample</p>
Rich Slogar7cc83982014-12-15 15:51:28 -0800580
581