Evolution of the Android development platform and Android studio settings

Source: Internet
Author: User

①. From Eclipse to Android Studio

A few years ago, Android was developed primarily with eclipse-loaded Android plugins, and Android studio was just beginning on May 16, 2013. There are many bugs in Android studio at first, so more people still use eclipse to develop. But now that Android studio is perfect and there are few bugs, Google has stopped updating its Android development platform for Eclipse.

Android Studio works well, but one thing is critical, it's based on Intellijidea. Intellijidea is very memory, so if only 4GB of memory, run Android studio while running other programs, such as browser, QQ, music player, will be very card. So the recommended memory upgrade is more than 6GB. Not only does it account for large memory, it is very slow to open Android studio and compile, and can be installed with an SSD to speed up startup and compilation.

②. Download and installation of Android Studio

Download page: Http://www.android-studio.org/index.php/download

Windows user best Download (Recommended) version, built-in SDK, such as red box:

If the initial download does not include the SDK version, download a separate SDK:

  

Download and installation is very convenient, not much to say. (much easier than install eclipse)

Attention:

1. The installation path is best not to have Chinese.

2. Set environment variables. Right-click Computer-"Properties-" Advanced system Settings-"advanced-" Environment variables-"User variable-" new.

Variable name: PATH

Variable Value: The Tools folder path in the SDK, such as:

      

③. User habits settings and shortcut keys

1. There are three ways to open the settings screen

  

  

2. If you are accustomed to eclipse shortcut keys, you can map the shortcut keys in the past.

  

If you use the Android studio default shortcut, there are several shortcut keys to recommend:

2.1. Ctrl + Spaces: Code completion, need to use when the compiler prompts.

2.2. Ctrl+alt+o: Delete the excess referenced packets.

2.3. Alt+enter: Imports the required packages, generally referencing some classes, and prompts when the package is not automatically imported.

2.4. Ctrl + Z: Undo Previous action

2.5. Ctrl+shift+z: Cancels the undo operation.

  

3. It is best to set the encoding to UTF-8

  

Such settings are recommended, or sometimes in the code directly written in Chinese, but the actual operation of the program will appear garbled, is not set up here.

Of course, this setting has a problem, that is, when importing other people's projects, the compiler code part of some Chinese comments will be garbled. This can be resolved in the following ways:

  

For example, the lower-right corner of the Android studio software will display UTF-8, while the interface code in the Chinese part is garbled. It is because some Chinese are encoded with GBK. Click the Red Box section and select GBK, which appears as a prompt box:

  

Be sure to choose Reload, you can't choose Convert. At this point, you can see the garbled part back to normal.

Click the Red Box section in the lower right corner again, select UTF-8, and the prompt box will still appear. At this time must choose convert, cannot choose reload.

Get!

4. Set the code style. This is only part of the point.

If you are accustomed to the curly braces {} alone (that is, the C language style) you can set the way the code is formatted.

Episode: http://zhuanlan.zhihu.com/codewar/19700946

Inside the settings, this setting:

    

The compiler defaults to the previous line, and if you press set, press the format shortcut key when writing the code: CTRL+ALT+L will format the code, cool!

  

5. About the directory structure:

    

Android mode as shown in the red box, this situation highlights the main directory, looks cool, there will not be a lot of infrequently used files appear. Easy to operate.

Click on the Red box and select Project, which should be the most complex structure.

    

The directory structure of Android mode is almost the same as the main one here.

Libs directory you need to be aware that when referencing someone's frame, you put the file here, and then

1. Right-click, select Add as Library ...

2. or file-"Project Structure

        

        

    

Click OK to do it.

So far, not regularly updated ...

Evolution of the Android development platform and Android studio settings

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.