Fix Android client, add unit tests and infrastructure