A simple mobile compass application built using Kotlin and Jetpack Compose.
This project is a mobile compass application designed to display real-time orientation information using the device's rotation vector sensor. The application provides a visually appealing compass UI that dynamically updates as the device orientation changes.
- Display of real-time compass needle rotation.
- Numerical display of the current orientation degree.
- Responsive UI using Jetpack Compose.
- Efficient sensor management for minimal battery usage.
In Android development, sensors play a crucial role in capturing various environmental data to enhance user experience and enable innovative applications. One such sensor is the Rotation Vector Sensor, which provides orientation data based on the rotation of the device.
To utilize the Rotation Vector Sensor in your Android application, you need to follow these steps:
-
Declare Sensor Permission: Ensure that your app's manifest file (
AndroidManifest.xml
) includes the necessary permissions to access sensors. Add the following line if it's not already present:<uses-permission android:name="android.permission.BODY_SENSORS" />
- Android Studio (version X.X.X)
- Android SDK (version XX)
- Kotlin (version X.X.X)
-
Clone the repository:
git clone https://github.com/yourusername/mobile-compass-app.git
- Launch the application on your Android device.
- Ensure that the device's rotation sensor is functional.
- Rotate the device to observe the compass needle movement.
- The numerical display indicates the current orientation degree.
This project is licensed under the MIT License - see the LICENSE file for details.