Minor fixes and improved error handling

Avoid printStacktrace for error logging, add more information to log entries.
Correct Android minimum API requirement declaration to match code. 
Avoid comparing strings by reference when checking content.
Add missing required equals() implementation to class implementing Comparable.
Report encoding exception.