various fixes and improvements (code cleanup; removed some stdout prints; moved socket handling to non-main thread in Android project; improved performance; fixed ResultSet unexpected behaviour on next in do-loop)