Android基础(2)--Meet Android Studio

    xiaoxiao2025-07-18  5

    Meet Android Studio

    this part is fron the official Google Android API:

    Android 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.

    https://developer.android.com/studio/intro/index.html

    Project Structure

    Each project in Android Studio contains one or more modules with source code files and resource files.

    Types of modules include:

    Android app modules

    Library modules

    Google App Engine modules

    By default, AS displays your project files in the Android project view, as shown in figure 1. The 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:

    manifests : Contains the AndroidManifest.xml file

    java: Contains the Java source code files, including JUnit test code.what’s this?

    res : Contains all non-code resources, such as XML layouts, UI string, and bitmap images.

    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. what’s this

    The User Interface

    The Android Studio main window is made up of several logical areas identified in figure 3.

    The toolbar lets you carry out a wide range of actions, including running your app and launching Android tools.

    The navigation bar helps you navigate through your project and open files for editing. It provides a more compact view of the structure visible in the Project tool window.

    The editor window is where you create and modify code. Depending on the current file type, this window can change. For example, when viewing a layout file, the editor window displays the layout editor and offers the option to view the corresponding XML file.

    Tool windows give you access to specific tasks like project management, search, version control, and more. You can expand them and collapse them.

    The status bar displays the status of your project and the IDE itself, as well as any warnings or messages.

    Tool Windows

    More use of tool windows can refer to the introduction of Android Studio.

    Code Completion

    AS has three types of code completion, which you can access using keyboard shortcuts.

    Here are some tips to help you move around AS.

    Switch between your recently accessed files using the Recent Files action. Press Control+E(Command+E on a Mac) to bring up the Recent Files action. By default, the last accessed file is selected. You can also access any tool window through the left column in this action.

    View the structure of the current file using the File Structure action. Bring up the File Structure action by pressing Control+F12 (Command+F12 on a Mac). Using this action, you can quickly navigate to any part of your current file.

    Search for and navigate to a specific class in your project using the Navigate to Class action. Bring up the action by pressing Control+N (Command+O on a Mac). Navigate to Class supports sophisticated expressions, including camel humps, paths, line navigate to, middle name matching, and many more. If you call it twice in a row, it shows you the results out of the project classes.

    Navigate to a file or folder using the Navigate to File action. Bring up the Navigate to File action by pressing Control+Shift+N (Command+Shift+O on a Mac). To search for folders rather than files, add a / at the end of your expression.

    Navigate to a method or field by name using the Navigate to Symbol action. Bring up the Navigate to Symbol action by pressing Control+Shift+Alt+N (Command+Shift+Alt+O on a Mac).

    Find all the pieces of code referencing the class, method, field, parameter, or statement at the current cursor position by pressing Alt+F7.

    Style and Formatting

    this part needs practice to hance it.

    转载请注明原文地址: https://ju.6miu.com/read-1300808.html
    最新回复(0)