Don’t you know how Android Studio can improve productivity?

Work efficiency can be improved

I remember when I just started working, my colleagues taught me some ways and methods of doing things, which have impressed me so far. “When a thing is repeated for three times, we should try to develop a tool to improve the efficiency”; “When a mistake occurs for three times, we must try to solve it, because it may accompany the whole life cycle of the software”.

In my later work, I always keep in mind that I should do less repetitive work and do more things to improve work efficiency. I should not use five years of one year’s work experience.

In addition to developing new tools to improve productivity, it’s also important to learn how to use IDE shortcuts that many people ignore. Shortcut keys, learn once, after the benefit of the next, the use of shortcut keys friends, surely know that the efficiency of shortcut keys is much higher than the mouse click, and another thing is, typing is clearly a cooler experience.

Recently, I needed to preprocess the intermediate results generated by the program running in the HAL layer. Due to the complexity of the processing process, I simply made a tool on the PC to improve the efficiency. Then I combined the tool with the IDE and used it with the application and shortcut keys.

In this article, I will share the process of using Android Studio’s custom shortcut keys to invoke external programs.

Custom shortcuts call external tools

AS Adds external tools

In the upper left of Android Studio, select File -> Settings -> Tools -> External Tools and click + to add External Tools:

In Create Tool, enter the Tool name, description (optional), program path, program input parameters (optional), and program working directory.

ProjectFileDirProjectFileDirProjectFileDir said the current AS the root directory of the project, this article in the root directory of the doc folder placed Player. Exe and output. Mp4 files, used for test later.

The project catalog is as follows:

When you’re done, right-click -> External Tools to bring up the External program you just added.

Define shortcuts to invoke external programs

After the External Tools are added, select File -> Settings -> Keymap -> External Tools, select the External Tools that we want to add shortcuts to, and right click the mouse. Three options appear. We’re going to Add Add Keyboard Shortcut.

Then type the shortcut you like (be careful not to conflict with other shortcut keys) :

After the addition is complete, test the shortcut key, and the following call succeeds:

Android Studio custom shortcuts to external applications are as simple as that, giving you a little boost in productivity every day and a thumbs-up.