java formatting of magnetank and android cookbook