Beruflich Dokumente
Kultur Dokumente
Android Studio is the official IDE for Android application development, based
on IntelliJ IDEA (https://www.jetbrains.com/idea/) . On top of the capabilities you
expect from IntelliJ, Android Studio offers:
Flexible Gradle-based build system
Build variants and multiple apk file generation
Code templates to help you build common app features
Rich layout editor with support for drag and drop theme editing
lint tools to catch performance, usability, version compatibility, and other
problems
ProGuard and app-signing capabilities
Built-in support for Google Cloud Platform , making it easy to integrate
Google Cloud Messaging and App Engine
And much more
Download Android Studio now (/sdk/index.html).
IN THIS DOCUMENT
Project and File Structure
Android Build System
Debug and Performance
Installation, Setup, and
Update Management
HTTP Proxy Settings
Other Highlights
SEE ALSO
IntelliJ FAQ on migrating to
IntelliJ IDEA
If you're new to Android Studio or the IntelliJ IDEA interface, this page provides
an introduction to some key Android Studio features.
For specific Android Studio how-to documentation, see the pages in the Workflow (/tools/workflow/index.html) section, such as
Managing Projects from Android Studio (/tools/projects/projects-studio.html) and Building and Running from Android Studio
(/tools/building/building-studio.html).
The Android project view shows all the build files at the top level of the project hierarchy under Gradle Scripts. Each project
module appears as a folder at the top level of the project hierarchy and contains these three elements at the top level:
java/ - Source files for the module.
manifests/ - Manifest files for the module.
res/ - Resource files for the module.
For example, Android project view groups all the instances of the ic_launcher.png resource for different screen densities
under the same element.
Note: The project structure on disk differs from this flattened representation. To switch to back to the segregated
project view, select Project from the Project drop-down.
and
Note: The applicationId is specified only in your build.gradle file, and not in the AndroidManifest.xml file.
When using build variants, the build system enables you to uniquely identify different packages for each product flavors
and build types. The application ID in the build type is added as a suffix to those specified for the product flavors.
productFlavors{
pro{
applicationId="com.example.my.pkg.pro"
}
free{
applicationId="com.example.my.pkg.free"
}
}
buildTypes{
debug{
applicationIdSuffix".debug"
}
}
....
The package name must still be specified in the manifest file. It is used in your source code to refer to your R class and to
resolve any relative activity/service registrations.
package="com.example.app">
Note: If you have multiple manifests (for example, a product flavor specific manifest and a build type manifest), the
package name is optional in those manifests. If it is specified in those manifests, the package name must be identical to
the package name specified in the manifest in the src/main/ folder.
For more information about the build files and process, see Build System Overview (/sdk/installing/studio-build.html).
in the toolbar to open it and create new virtual devices for running your app in
The AVD Manager comes with emulators for Nexus 6 and Nexus 9 devices and also supports creating custom Android
device skins based on specific emulator properties and assigning those skins to hardware profiles. Android Studio installs
the Intel x86 Hardware Accelerated Execution Manager (HAXM) emulator accelerator and creates a default emulator for
quick app prototyping.
For more information, see Managing AVDs (/tools/devices/managing-avds.html).
Memory Monitor
Android Studio provides a memory monitor view so you can more easily monitor your app's memory usage to find
deallocated objects, locate memory leaks and track the amount of memory the connected device is using. With your app
running on a device or emulator, click the Memory Monitor tab in the lower right corner to launch the memory monitor.
Code Inspections
In Android Studio, the configured lint (/tools/help/lint.html) and other IDE inspections run automatically whenever you
compile your program. In addition to the configured lint checks, additional IntelliJ code inspections
(https://www.jetbrains.com/idea/help/inspection-basics.html?search=inspection)
run to streamline code review.
Android Studio enables several lint checks to ensure:
Note: If you wish to change the behavior of specific inspection notifications, you can change the inspection severity, for
example from warning to error.
To manually run inspections in Android Studio, choose Analyze > Inspect Code. The Inspections Scope dialog appears so
you can specify the desired inspection profile and scope.
Running Inspections from the command line
You can also run lint inspections from the command line in your SDK directory.
sdk$lint[flags]
Note: The lint --show and --list flags can be used to display the available issues and explanations.
For more information, see Improving Your Code with lint (/tools/debugging/improving-w-lint.html) and lint tool (/tools/help/lint.html).
From the Design View, you can drag and drop elements from the Palette to the Preview or Component Tree. The Text View
allows you to directly edit the XML settings, while previewing the device display.
Log messages
When you build and run your app with Android Studio, you can view adb and device log messages (logcat) in the DDMS
pane by clicking Android at the bottom of the window.
If you want to debug your app with the Android Debug Monitor (/tools/help/monitor.html), you can launch it by clicking Monitor
in the toolbar. The Debug Monitor is where you can find the complete set of DDMS (/tools/debugging/ddms.html) tools for
profiling your app, controlling device behaviors, and more. It also includes the Hierarchy Viewer tools to help optimize your
layouts (/tools/debugging/debugging-ui.html).
During app creation, the Project Wizard also displays an API Level dialog to help you choose the best minSdkVersion for
your project.
Google App Engine integration (Google Cloud Platform/Messaging)
Quick cloud integration. Using Google App Engine to connect to the Google cloud and create a cloud end-point is as easy
as selecting File > New Module > App Engine Java Servlet Module and specifying the module, package, and client names.
Update channels
Android Studio provides four update channels to keep Android Studio up-to-date based on your code-level preference:
Canary channel: Canary builds provide bleeding edge releases, updated about weekly. While these builds do get tested,
they are still subject to bugs, as we want people to see what's new as soon as possible. This is not recommended for
production.
Dev channel: Dev builds are hand-picked older canary builds that survived the test of time. They are updated roughly biweekly or monthly.
Beta channel: Beta builds are used for beta-quality releases before a production release.
Stable channel: Used for stable, production-ready versions.
By default, Android Studio uses the Stable channel. Use File > Settings > Updates to change your channel setting.
Proxy Settings
Proxies serve as intermediary connection points between HTTP clients and web servers that add security and privacy to
internet connections.
To support running Android Studio behind a firewall, set the proxy settings for the Android Studio IDE and the SDK
Manager. Use the Android Studio IDE HTTP Proxy settings page to set the HTTP proxy settings for Android Studio. The
SDK Manager has a separate HTTP Proxy settings page.
When running the Android Plugin for Gradle from the command line or on machines where Android Studio is not installed,
such as continuous integration servers, set the proxy settings in the Gradle build file.
Note: After the initial installation of the Android Studio bundle, Android Studio can run with internet access or off-line.
However, Android Studio requires an internet connection for Setup Wizard synchronization, 3rd-party library access,
access to remote repositories, Gradle initialization and synchronization, and Android Studio version updates.
the settings. For a detailed explanation of these settings, see HTTP Proxy.
4. Click Apply to enable the proxy settings.
Other Highlights
Translation Editor
Multi-language support is enhanced with the Translation Editor plugin so you can easily add locales to the app's
translation file. Color codes indicate whether a locale is complete or still missing string translations. Also, you can use the
plugin to export your strings to the Google Play Developer Console for translation, then download and import your
translations back into your project.
To access the Translation Editor, open a strings.xml file and click the Open Editor link.