From https://developer.android.com/samples/BasicMultitouch/index.html converted to work in Android Studio 0.8.2