Android基础(2)--Meet Android Studio

本文介绍了 Android Studio 的基本功能和使用方法,包括项目结构、用户界面、代码补全、导航技巧以及样式和格式设置等内容。

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: Screenshot

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

Screenshot2

The User Interface

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

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

Screenshot4

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.

Screenshot5

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.

评论
成就一亿技术人!
拼手气红包6.0元
还能输入1000个字符
 
红包 添加红包
表情包 插入表情
 条评论被折叠 查看
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值