A few tweaks based on Boris' client. Android version works, but doesn't collect stats yet.