Android support

Fixes  #3991