enhanced android implementation and error handling