Summary of android common function settings

In the actual development process of Android, many details can't be remembered clearly. Baidu is needed. Here is a statistical summary,

1. Make aar package and introduce the project

 ANDROID STUDIO generates AARS and references AARS

2. Set coding format

Sometimes there will be garbled code, most of which are coding format problems,

Just unify the three settings in Settings > editor > file encondings, usually utf-8

 

 

3. Plug in sorting

In the actual project, many plug-ins are still very easy to use, which can greatly improve the work efficiency.

But some plug-ins that are not commonly used are easy to forget how to use them

This article has a lot of good plugins The most complete and best used Android Studio plug-ins , I think the top ten are quite common

 

4. Set file header information

Select different files in Settings > editor > file and code templates, and set

What I'm setting up now is

class

/**
  * Copyright (C), 2018-${YEAR}, wankun
*/
#if (${PACKAGE_NAME} && ${PACKAGE_NAME} != "")package ${PACKAGE_NAME};#end
#parse("File Header.java")
/**
 * 〈${DESCRIPTION}〉
 *
 * @author ${USER}
 * @create ${DATE}
 * @since 1.0.0
 */
public class ${NAME} {
}
interface 
/**
  * Copyright (C), 2018-${YEAR}, wankun
*/
#if (${PACKAGE_NAME} && ${PACKAGE_NAME} != "")package ${PACKAGE_NAME};#end
#parse("File Header.java")
/**
 * 〈${DESCRIPTION}〉
 *
 * @author ${USER}
 * @create ${DATE}
 * @since 1.0.0
 */
public interface ${NAME} {
}

enum

/**
  * Copyright (C), 2018-${YEAR}, wankun
*/
#if (${PACKAGE_NAME} && ${PACKAGE_NAME} != "")package ${PACKAGE_NAME};#end
#parse("File Header.java")
/**
 * 〈${DESCRIPTION}〉
 *
 * @author ${USER}
 * @create ${DATE}
 * @since 1.0.0
 */
public enum ${NAME} {
}
html 
​​​​​​​<!DOCTYPE html>
<html lang="en">
    <head>
      <meta charset="UTF-8">
      <meta name="viewport" content="width=device-width, user-scalable=no, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0">
      <meta http-equiv="X-UA-Compatible" content="ie=edge">
      <title>#[[$Title$]]#</title>
    </head>
    <body>
     #[[$END$]]#
    </body>
</html>

 

 

5. Code specification check settings

You can set up specification checking in Android studio. Please refer to this document for specific configuration methods https://www.cnblogs.com/whycxb/p/9736414.html

Tags: Android Java IE

Posted on Sat, 09 Nov 2019 09:49:02 -0500 by chris9902