<p dir="auto">Given the fact device motion and rotation are two of the main user inputs in games, we should consider adding related APIs.</p>
<p dir="auto"><a href="http://developer.android.com/guide/topics/sensors/sensors_overview.html" rel="nofollow">http://developer.android.com/guide/topics/sensors/sensors_overview.html</a><br>
<a href="https://developer.apple.com/library/prerelease/ios/documentation/CoreMotion/Reference/CoreMotion_Reference/index.html" rel="nofollow">https://developer.apple.com/library/prerelease/ios/documentation/CoreMotion/Reference/CoreMotion_Reference/index.html</a></p>
<p dir="auto">Mobile devices have a range of common sensors:</p>
<ul dir="auto">
<li>accelerometer</li>
<li>gyroscope</li>
<li>magnetometer</li>
<li>barometer</li>
<li>GPS / wifi location</li>
</ul>
<p dir="auto">We need a package golang.org/x/mobile/sensor to give us access to this data.</p>
<p dir="auto">The challenging part here is, as always, designing an API that will work on both Android and iOS. This will require mapping the differences between sensor APIs on both platforms. There may be more than one Go package under the heading sensor.</p>
<p dir="auto">As an added challenge, some of these sensors (in particular location) require app permissions to use. The permission models are different on android/iOS. I suspect we can design an API that does both: if a binary imports a particular sensor package, it will ask for the permission at installation time (that is, it will be baked into a generated AndroidManifest.xml file). When the package is used at run time, we ask iOS for permission.</p>