blankj / androidstandarddevelop Goto Github PK
View Code? Open in Web Editor NEW:star2: Best practices in Android develop(final).
Home Page: https://blankj.com/2017/03/08/android-standard-dev-final
License: Apache License 2.0
:star2: Best practices in Android develop(final).
Home Page: https://blankj.com/2017/03/08/android-standard-dev-final
License: Apache License 2.0
10 其他的一些规范
14 .尽量减少对变量的重复计算;
如下面的操作:
for (int i = 0; i < list.size(); i++) {
...
}
建议替换为:
for (int i = 0, int length = list.size(); i < length; i++) {
...
}
这里应该改为
for (int i = 0, length = list.size(); i < length; i++) {
...
}
不需要再为length
指定类型了,也不能指定了
如题
现在阿里巴巴内部的项目分包也是按功能分么?
I think it is helpful to use uniform line-separator for project, and the separator is suggested to be lf(unix-style) instead of crlf(windows-style)
包层次结构图用啥工具绘制的啊?
RT
首先十分感谢作者将自己的开发经验分享给我们,提供了许多 Java/Android 程序代码上的指导,详读后收获很多。
然而有一个无关紧要的点个人不太认同,本项目的中文标题叫《Android 开发规范》,而下文主要是介绍了代码风格和规范,而实际开发当中有许多关于组件功能使用的规范需要注意,如:
这些内容篇幅较长,同时也考虑到本项目已经标上了 “Final (完结版)”,不太可能再加入更多规范。可以考虑直接修改标题来避免一些误解,例如可以改成《Android 开发代码风格规范》,其余内容放置到 “扩展阅读” 章节(值得一提,Android 组件/功能的开发规范 Google 官方都有给出详细内容,建议补充一个扩展链接:https://developer.android.com/training/index.html )。
命名规则:类型{_模块名}_逻辑名称、类型{_模块名}_颜色
建议改为:
模块名_类型_逻辑名称、模块名_类型_颜色
因为如果开发到一定阶段要转组件化, 这样处理资源文件会方便很多. 就算不组件化, 名称看起来也是很整齐的, 因为个人之前经历过, 不确定作者有更全面的考虑吧?
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.