Lots of changes to support Android