Android Studio常用小技巧

简介: 1. Debug 模式查看变量的值;     To quickly evaluate the value of any expression while debugging the program, hold Alt and click this expression to see its val...

1. Debug 模式查看变量的值;

    To quickly evaluate the value of any expression while debugging the program, hold Alt and click this expression to see its value and calculate it, call a            method, etc.

   

 

2. 自动补全快捷键,默认,自己设置过快捷键以自己的为准:

   Use Basic Completion (Ctrl+空格) for completing words in text and comments in files of many different types.
   All the words from the current file that start with the typed prefix will appear in the lookup list.

 

  

 

3. 快捷键,查看参数信息,文档:

 

 The shortcuts such as Ctrl+Shift+空格 (View | Quick Documentation), Ctrl+P in default keymap (View | Parameter Info), F3 (Navigate | Declaration) and others can be used not only in the editor but in the code completion popup list as well.

 

 

When using Code Completion, you can accept the currently highlighted selection in the popup list with the period character (.), comma (,), semicolon (;), space and other characters.
The selected name is automatically entered in the editor followed by the entered character.

 

4。 查看最近的修改:

Use Alt+Shift+C in default keymap to quickly review your recent changes to the project.

 

 

5. 补全if , do while ,try catch 语句:

 

Use Ctrl+Shift+Enter to complete a current statement such as if, do-while, try-catch, return (or a method call) into a syntactically correct construct (e.g. add curly braces).

 

 

6.Run / Debug快捷键:

 

By pressing Alt+Shift+F10 you can access the Run/Debug dropdown on the main toolbar, without the need to use your mouse.

 

7. 关于提交代码:

 

 If you don't want to commit some of your changes to the repository, you can set them aside for a while, by moving to a separate changelist, or by putting them to a shelf. Select such file in the Local tab of the Changes tool window, and on the context menu choose Move to Another Changelist, or Shelve Changes.

 

8. 查看全局方法:

 

You can view all methods of the implemented interfaces in a class, if you place the caret at the implements keyword in the class declaration, press Alt+Shift+O, and select the desired interface from the list:

 

9。 查看一个方法的所以出口:

 

To view all exit points of a method, place the caret at one of them, e.g. the return statement, and press Alt+Shift+O:

 

10. 查看每一行代码最近的改变情况:

 

Version control annotations show the latest changes of each line in one click.
Just right-click an annotation and use the Show Diff command in the context menu.

 

 

 

11. 关于编辑正则表达式:

 

You can avoid escaping backslashes in your regular expressions. Start typing a regular expression, then press Alt+Enter and choose Edit RegExp. The regular expression opens in a separate tab in the editor, where you can type backslashes as is.
All changes are synchronized with the original regular expression, and escapes are presented automatically. When ready, just press Esc to close the regular expression editor.

 

 

 12. 使用shell脚本:

 

You don't need to leave Android Studio to work with your favorite shell. Just click the Terminal tool window button, and enjoy using the embedded local terminal.

 

目录
相关文章
|
10月前
|
SQL 人工智能 Dart
Android Studio的插件生态非常丰富
Android Studio的插件生态非常丰富
605 1
|
10月前
|
Ubuntu Linux Android开发
Android Studio支持多种操作系统
Android Studio支持多种操作系统
488 1
|
5月前
|
开发工具 Android开发 iOS开发
如何在Android Studio中配置Flutter环境?
如何在Android Studio中配置Flutter环境?
1299 61
|
4月前
|
Android开发 Windows
Android studio 报错Connect to 127.0.0.1:8888 [/127.0.0.1] failed: Connection refused: connect(已解决)
这是一篇关于解决Android Studio报错“Connect to 127.0.0.1:8888 failed: Connection refused”的文章。问题通常因系统代理设置被Android Studio自动保存导致。解决方法是找到系统中Android Studio使用的gradle.properties文件(位于Windows的C:\Users\你的电脑用户名\.gradle或Mac的/Users/.{你的用户目录}/.gradle),删除或注释掉多余的代理配置后保存并重新Sync项目。希望此经验能帮助快速解决同类问题!
595 36
|
4月前
|
Java Android开发
Android studio中build.gradle文件简单介绍
本文解析了Android项目中build.gradle文件的作用,包括jcenter仓库配置、模块类型定义、包名设置及依赖管理,涵盖本地、库和远程依赖的区别。
390 19
|
7月前
|
前端开发 Java 编译器
当flutter react native 等混开框架-并且用vscode-idea等编译器无法打包apk,打包安卓不成功怎么办-直接用android studio如何打包安卓apk -重要-优雅草卓伊凡
当flutter react native 等混开框架-并且用vscode-idea等编译器无法打包apk,打包安卓不成功怎么办-直接用android studio如何打包安卓apk -重要-优雅草卓伊凡
199 36
当flutter react native 等混开框架-并且用vscode-idea等编译器无法打包apk,打包安卓不成功怎么办-直接用android studio如何打包安卓apk -重要-优雅草卓伊凡
|
Java Android开发 C++
Android Studio JNI 使用模板:c/cpp源文件的集成编译,快速上手
本文提供了一个Android Studio中JNI使用的模板,包括创建C/C++源文件、编辑CMakeLists.txt、编写JNI接口代码、配置build.gradle以及编译生成.so库的详细步骤,以帮助开发者快速上手Android平台的JNI开发和编译过程。
907 1
|
7月前
|
Dart 前端开发 Android开发
【09】flutter首页进行了完善-采用android studio 进行真机调试开发-增加了直播间列表和短视频人物列表-增加了用户中心-卓伊凡换人优雅草Alex-开发完整的社交APP-前端客户端开发+数据联调|以优雅草商业项目为例做开发-flutter开发-全流程-商业应用级实战开发-优雅草Alex
【09】flutter首页进行了完善-采用android studio 进行真机调试开发-增加了直播间列表和短视频人物列表-增加了用户中心-卓伊凡换人优雅草Alex-开发完整的社交APP-前端客户端开发+数据联调|以优雅草商业项目为例做开发-flutter开发-全流程-商业应用级实战开发-优雅草Alex
166 4
【09】flutter首页进行了完善-采用android studio 进行真机调试开发-增加了直播间列表和短视频人物列表-增加了用户中心-卓伊凡换人优雅草Alex-开发完整的社交APP-前端客户端开发+数据联调|以优雅草商业项目为例做开发-flutter开发-全流程-商业应用级实战开发-优雅草Alex
|
10月前
|
前端开发 数据处理 Android开发
Flutter前端开发中的调试技巧与工具使用方法,涵盖调试的重要性、基本技巧如打印日志与断点调试、常用调试工具如Android Studio/VS Code调试器和Flutter Inspector的介绍
本文深入探讨了Flutter前端开发中的调试技巧与工具使用方法,涵盖调试的重要性、基本技巧如打印日志与断点调试、常用调试工具如Android Studio/VS Code调试器和Flutter Inspector的介绍,以及具体操作步骤、常见问题解决、高级调试技巧、团队协作中的调试应用和未来发展趋势,旨在帮助开发者提高调试效率,提升应用质量。
267 8
|
10月前
|
数据可视化 开发工具 Android开发
Android Studio
Android Studio
658 1