Initial copy from https://bitbucket.org/sullis/urbanairship-java/