Include source path of the android framework
Use the latest android platform available
Improve error message
Refactor code into methods
Refactor to stop on error before printing the result to stdout