Android 开发规范

276 阅读1分钟

Android 代码规范

1、通用代码规范

通用代码遵循 阿里巴巴java开发手册	
https://developer.aliyun.com/article/1589859

2、Android 代码规范

2.1 规范内容主要包括以下内容:

  • AS 规范
  • 命名规范
  • 代码样式规范
  • 资源文件规范
  • 版本统一规范
  • 第三方库规范
  • 注释规范
  • 测试规范
  • 其他的一些规范

2.2 主要参考链接

https://blog.csdn.net/qq_26057629/article/details/136315201

https://github.com/Blankj/AndroidStandardDevelop#5-%E8%B5%84%E6%BA%90%E6%96%87%E4%BB%B6%E8%A7%84%E8%8C%83

3、Android 代码检测工具

1、使用 Android Studio 自带的代码检测 lint
    通过使用 lint 检查来改进代码
    https://developer.android.google.cn/studio/write/lint?hl=zh-cn
			
    利用注解改进代码检查
    https://developer.android.google.cn/studio/write/annotations?hl=zh-cn

2、Findbugs 可选
    插件使用:https://developer.aliyun.com/article/642350

3、使用开发自带的 lint 工具即可