sebutkan dan jelaskan fungsi dari ikon-ikon yang terdapat di menu insert brainly
Meet Android StudioAndroid Studio is the official Integrated Development Environment (IDE) for Android app development, based on IntelliJ IDEA . On top of IntelliJ's powerful code editor and developer tools, Android Studio offers even more features that enhance your productivity when building Android apps, such as: Show
This page provides an introduction to basic Android Studio features. For a summary of the latest changes, see Android Studio release notes. Project structureEach project in Android Studio contains one or more modules with source code files and resource files. Types of modules include:
By default, Android Studio displays your project files in the Android project view, as shown in figure 1. This view is organized by modules to provide quick access to your project's key source files. All the build files are visible at the top level under Gradle Scripts and each app module contains the following folders:
The Android project structure on disk differs from this flattened representation. To see the actual file structure of the project, select Project from the Project dropdown (in figure 1, it's showing as Android). You can also customize the view of the project files to focus on specific aspects of your app development. For example, selecting the Problems view of your project displays links to the source files containing any recognized coding and syntax errors, such as a missing XML element closing tag in a layout file. For more information, see Projects overview. The user interfaceThe Android Studio main window is made up of several logical areas identified in figure 3.
You can organize the main window to give yourself more screen space by hiding or moving toolbars and tool windows. You can also use keyboard shortcuts to access most IDE features. At any time, you can search across your source code, databases, actions, elements of the user interface, and so on, by double-pressing the Shift key, or clicking the magnifying glass in the upper right-hand corner of the Android Studio window. This can be very useful if, for example, you are trying to locate a particular IDE action that you have forgotten how to trigger. Tool windowsInstead of using preset perspectives, Android Studio follows your context and automatically brings up relevant tool windows as you work. By default, the most commonly used tool windows are pinned to the tool window bar at the edges of the application window.
You can also use keyboard shortcuts to open tool windows. Table 1 lists the shortcuts for the most common windows. Tool window Windows and Linux Mac Project Alt+1 Command+1 Version Control Alt+9 Command+9 Run Shift+F10 Control+R Debug Shift+F9 Control+D Logcat Alt+6 Command+6 Return to Editor Esc Esc Hide All Tool Windows Control+Shift+F12 Command+Shift+F12If you want to hide all toolbars, tool windows, and editor tabs, click View > Enter Distraction Free Mode. This enables Distraction Free Mode. To exit Distraction Free Mode, click View > Exit Distraction Free Mode. You can use Speed Search to search and filter within most tool windows in Android Studio. To use Speed Search, select the tool window and then type your search query. For more tips, see Keyboard shortcuts. Code completionAndroid Studio has three types of code completion, which you can access using keyboard shortcuts. Type Description Windows and Linux Mac Basic Completion Displays basic suggestions for variables, types, methods, expressions, and so on. If you call basic completion twice in a row, you see more results, including private members and non-imported static members. Control+Space Control+Space Smart Completion Displays relevant options based on the context. Smart completion is aware of the expected type and data flows. If you call Smart Completion twice in a row, you see more results, including chains. Control+Shift+Space Control+Shift+Space Statement Completion Completes the current statement for you, adding missing parentheses, brackets, braces, formatting, etc. Control+Shift+Enter Shift+Command+EnterYou can also perform quick fixes and show intention actions by pressing Alt+Enter. Find sample codeThe Code Sample Browser in Android Studio helps you find high-quality, Google-provided Android code samples based on the currently highlighted symbol in your project. For more information, see Find sample code. NavigationHere are some tips to help you move around Android Studio.
Style and formattingAs you edit, Android Studio automatically applies formatting and styles as specified in your code style settings. You can customize the code style settings by programming language, including specifying conventions for tabs and indents, spaces, wrapping and braces, and blank lines. To customize your code style settings, click File > Settings > Editor > Code Style (Android Studio > Preferences > Editor > Code Style on a Mac.) Although the IDE automatically applies formatting as you work, you can also explicitly call the Reformat Code action by pressing Control+Alt+L (Opt+Command+L on a Mac), or auto-indent all lines by pressing Control+Alt+I (Control+Option+I on a Mac). Version control basicsAndroid Studio supports a variety of version control systems (VCSs), including Git, GitHub, CVS, Mercurial, Subversion, and Google Cloud Source Repositories. After importing your app into Android Studio, use the Android Studio VCS menu options to enable VCS support for the desired version control system, create a repository, import the new files into version control, and perform other version control operations:
The VCS menu now displays a number of version control options based on the system you selected. Note: You can also use the File > Settings > Version Control menu option to set up and modify the version control settings. Gradle build systemAndroid Studio uses Gradle as the foundation of the build system, with more Android-specific capabilities provided by the Android plugin for Gradle. This build system runs as an integrated tool from the Android Studio menu, and independently from the command line. You can use the features of the build system to do the following:
By employing the flexibility of Gradle, you can achieve all of this without modifying your app's core source files. Android Studio build files are named build.gradle. They are plain text files that use Groovy syntax to configure the build with elements provided by the Android plugin for Gradle. Each project has one top-level build file for the entire project and separate module-level build files for each module. When you import an existing project, Android Studio automatically generates the necessary build files. To learn more about the build system and how to configure, see Configure your build. Build variantsThe build system can help you create different versions of the same application from a single project. This is useful when you have both a free version and a paid version of your app, or if you want to distribute multiple APKs for different device configurations on Google Play. For more information about configuring build variants, see Configure build variants. Multiple APK supportMultiple APK support allows you to efficiently create multiple APKs based on screen density or ABI. For example, you can create separate APKs of an app for the hdpi and mdpi screen densities, while still considering them a single variant and allowing them to share test APK, javac, dx, and ProGuard settings. For more information about multiple APK support, read Build multiple APKs. Resource shrinkingResource shrinking in Android Studio automatically removes unused resources from your packaged app and library dependencies. For example, if your application is using Google Play services to access Google Drive functionality, and you are not currently using Google Sign-In, then resource shrinking can remove the various drawable assets for theSignInButton buttons. Note: Resource shrinking works in conjunction with code shrinking tools, such as ProGuard. For more information on shrinking code and resources, see Shrink your code and resources. Managing dependenciesDependencies for your project are specified by name in the build.gradle file. Gradle takes care of finding your dependencies and making them available in your build. You can declare module dependencies, remote binary dependencies, and local binary dependencies in your build.gradle file. Android Studio configures projects to use the Maven Central Repository by default. (This configuration is included in the top-level build file for the project.) For more information about configuring dependencies, read Add build dependencies. Debug and profile toolsAndroid Studio assists you in debugging and improving the performance of your code, including inline debugging and performance analysis tools. Inline debuggingUse inline debugging to enhance your code walk-throughs in the debugger view with inline verification of references, expressions, and variable values. Inline debug information includes:
To enable inline debugging, in the Debug window, click Settings and select the checkbox for Show Values Inline.Performance profilersAndroid Studio provides performance profilers so you can more easily track your apps memory and CPU usage, find deallocated objects, locate memory leaks, optimize graphics performance, and analyze network requests. With your app running on a device or emulator, open the Android Profiler tab. For more information about performance profilers, see Performance profiling tools. Heap dumpWhen youre profiling memory usage in Android Studio, you can simultaneously initiate garbage collection and dump the Java heap to a heap snapshot in an Android-specific HPROF binary format file. The HPROF viewer displays classes, instances of each class, and a reference tree to help you track memory usage and find memory leaks. For more information about working with heap dumps, see Inspect the heap and allocations. Memory ProfilerYou can use Memory Profiler to track memory allocation and watch where objects are being allocated when you perform certain actions. Knowing these allocations enables you to optimize your apps performance and memory use by adjusting the method calls related to those actions. For information about tracking and analyzing allocations, see Inspect the heap and allocations. Data file accessThe Android SDK tools, such as Systrace, and logcat, generate performance and debugging data for detailed app analysis. To view the available generated data files, open the Captures tool window. In the list of the generated files, double-click a file to view the data. Right-click any .hprof files to convert them to the standard Investigate your RAM usage file format. Code inspectionsWhenever you compile your program, Android Studio automatically runs configured Lint and other IDE inspections to help you easily identify and correct problems with the structural quality of your code. The Lint tool checks your Android project source files for potential bugs and optimization improvements for correctness, security, performance, usability, accessibility, and internationalization. In addition to Lint checks, Android Studio also performs IntelliJ code inspections and validates annotations to streamline your coding workflow. For more information, see Improve your code with lint checks. Annotations in Android StudioAndroid Studio supports annotations for variables, parameters, and return values to help you catch bugs, such as null pointer exceptions and resource type conflicts. The Android SDK Manager packages the Support-Annotations library in the Android Support Repository for use with Android Studio. Android Studio validates the configured annotations during code inspection. For more details about Android annotations, see Improve code inspection with annotations. Log messagesWhen you build and run your app with Android Studio, you can view adb output and device log messages in the Logcat window. Performance profilingIf you want to profile your app's CPU, memory, and network performance, open the Android Profiler, by clicking View > Tool Windows > Android Profiler. Sign in to your developer accountYou can sign in to your developer account in Android Studio to access additional tools that requires authentication, such as Cloud Tools for Android Studio and the App Actions test tool. By signing in, you give those tools permission to view and manage your data across Google services. After you open a project in Android Studio, you can sign in to your developer account or switch developer accounts, as follows:
Content and code samples on this page are subject to the licenses described in the Content License. Java is a registered trademark of Oracle and/or its affiliates. Last updated 2021-11-11 UTC.
[{
"type": "thumb-down",
"id": "missingTheInformationINeed",
"label":"Missing the information I need"
},{
"type": "thumb-down",
"id": "tooComplicatedTooManySteps",
"label":"Too complicated / too many steps"
},{
"type": "thumb-down",
"id": "outOfDate",
"label":"Out of date"
},{
"type": "thumb-down",
"id": "samplesCodeIssue",
"label":"Samples / code issue"
},{
"type": "thumb-down",
"id": "otherDown",
"label":"Other"
}]
[{
"type": "thumb-up",
"id": "easyToUnderstand",
"label":"Easy to understand"
},{
"type": "thumb-up",
"id": "solvedMyProblem",
"label":"Solved my problem"
},{
"type": "thumb-up",
"id": "otherUp",
"label":"Other"
}]
|