How To: Use the Android Accelerometer


Introduction

Portable devices can be used in a variety of orientations. Applications need to consider the ways in which orientation affects them, such as a custom UI for landscape versus portrait modes, or interpreting raw sensor data. Applications making use of the accelerometer must take special care when processing the raw data, given device and operating system expectations, in order to deliver a proper user experience.

While the accelerometer is an important input device to many software applications, some developers are using incorrect methods to process the accelerometer data. More to the point, these applications are not taking into account device orientation, which results in a poor if not failed user experience. Proper orientation handling of accelerometer input is a simple matter, which we will discuss in the sections that follow.

 

 

 


NVIDIA® GameWorks™ Documentation Rev. 1.0.200608 ©2014-2020. NVIDIA Corporation. All Rights Reserved.