Modifications for android compatibility