The Android Story: Quality, Performance, Stability. ENG (MBLTdev 2017, Moscow)
Overview of tools aimed at increasing the quality of the applications. Static code analysis tools, dev tools, application metrics and environment helpers.
of filename/path here } } $ ./gradlew lintDebug ......... Wrote XML report to file:///lint-results-debug.xml Lint found 1 warning (3 warnings filtered by baseline lint-baseline.xml) :base:lintDebug
and is dereferenced at line 9 7. private void clearStorageSpace(Dir dir, long requiredSpace) { 8. long spaceCleared = 0; 9. > for (File file : dir.files()) { 10. long fileLength = file.length(); 11. http://fbinfer.com/docs/analyzing-apps-or-projects.html
result += field + " "; // <-- issue USE_STRINGBUFFER_CONCATENATION } StringBuilder resultBuilder = new StringBuilder(); for (String field : fields) { resultBuilder.append(field).append(" "); }
== or != Method invokes toString() method on a String Test for floating point equality Method may fail to close stream Unread fields/methods … and many others
time. Run all quality checks ONLY before making a commit. Quality tools + CI = MAXIMUM PROFIT! Your team should be ready for it. Better app quality, performance, readability.
https://github.com/square/leakcanary public class MyApplication extends Application { public void onCreate() { super.onCreate(); LeakCanary.install(this); } }