Android thread input

Wrote threaded input for Android.
It needs to be tested more extensively first as it's a pretty large modification.