Skip to content
This repository has been archived by the owner on Dec 12, 2020. It is now read-only.

Todo.txt for Android's Code Style Guide

Gina Trapani edited this page Jun 16, 2013 · 1 revision

Todo.txt's default code style is Eclipse (Helios)'s default (Ctrl+Shift+F)

Readability promotes maintainability. Since this is an open source project that lots of people maintain, readability trumps brevity in all code.

Variable names

Instance variable names should use the under_score style. Object and method names should be CamelCase or camelCase.

Name every Object what it is. For example, TodoTxtTouchApplication, or HelpActivity.

Externalize all resources

No string literals inside the code should be used. Externalize string literals to resource files. Resource names should use the underscore style and be as descriptive as possible.

Drawables should be PNG. Use dp scale independent sizes.

Layout filenames should use the underscore style and named in such a way that they group logically. (For example, the context menu for complete tasks and incomplete task layout files could be menu_context_complete.xml and menu_context_incomplete.xml.)

License header

All code should include license header text and JavaDoc style docblocks. Contributors are not tracked in the licence header anymore, but through git instead. (See here)

Remove unnecessary import statements

Use Ctrl+Shift+O in Eclipse to remove unnecessary imports.