Android sample + iOS sample fixes + Bug fixes

Fixes a tremendous amount of bugs.

Both the included Android sample and the iOS sample work as intended.