A cutting-edge Android XR (Extended Reality) note-taking application that allows users to create and manage floating notes in both traditional 2D and immersive 3D spatial environments.
XR Note App is an innovative note-taking application built for Android XR devices. It seamlessly transitions between 2D Home Space mode (traditional Android UI) and Full Space mode (immersive 3D XR environment), allowing users to place and interact with notes in a spatial context.
-
Dual-Mode Operation
- ๐ Home Space Mode: Traditional 2D interface for standard Android devices
- ๐ฏ Full Space Mode: Immersive 3D XR environment with spatial notes
-
Note Management
- Create, read, and delete notes
- Persistent storage using Room Database
- Real-time synchronization between 2D and 3D views
-
XR Capabilities
- Movable and resizable spatial panels
- 3D note positioning in virtual space
- Head tracking support
- XR anchor import support
- Clean Architecture with separation of concerns
- Dependency Injection using Koin
- Reactive UI with Jetpack Compose
- Room Database for local persistence
- AndroidX XR Compose integration
The project follows Clean Architecture principles with clear separation between layers:
app/
โโโ data/
โ โโโ local/ # Room Database, DAOs
โ โโโ model/ # Data entities
โ โโโ repository/ # Repository implementations
โโโ domain/
โ โโโ model/ # Domain models
โ โโโ repository/ # Repository interfaces
โ โโโ usecase/ # Business logic
โโโ presentation/
โ โโโ components/ # Reusable UI components
โ โโโ viewmodel/ # ViewModels
โ โโโ xrscene/ # XR-specific scene components
โโโ di/ # Dependency injection modules
-
Data Layer
NoteEntity: Room database entityNoteDao: Database access objectAppDatabase: Room database configurationNoteRepositoryImpl: Repository implementation
-
Domain Layer
Note: Domain modelNoteRepository: Repository interface- Use cases:
AddNoteUseCase,DeleteNoteUseCase,GetAllNotesUseCase,UpdateNotePositionUseCase
-
Presentation Layer
NotesViewModel: Manages UI state and business logicNoteCard: 2D note componentNoteCard3D: 3D spatial note component
- Language: Kotlin
- UI Framework: Jetpack Compose
- Build System: Gradle with Kotlin DSL
- Min SDK: 34 (Android 14)
- Target SDK: 36
androidx.xr.compose:compose:1.0.0-alpha07
androidx.xr.runtime:runtime:1.0.0-alpha07
androidx.xr.scenecore:scenecore:1.0.0-alpha07- Compose BOM 2025.07.00
- Lifecycle Runtime & ViewModel Compose 2.9.3+
- Activity Compose 1.11.0
- Room 2.8.3
- Koin 4.1.1
- Filament Android 1.66.1
- Android Studio Hedgehog or later
- Android SDK 34 or higher
- Android XR Emulator or compatible XR device
- JDK 11
git clone <repository-url>
cd XRNoteApp- Launch Android Studio
- Select "Open an Existing Project"
- Navigate to the cloned directory
- Wait for Gradle sync to complete
- Download and install the Android XR Emulator from Android Studio
- Ensure OpenXR runtime is configured
- Grant necessary permissions when prompted
- Enable developer mode on your XR device
- Connect via ADB
- Deploy the application
# Build the project
./gradlew build
# Install on connected device/emulator
./gradlew installDebug
# Or use Android Studio's Run button- Launch the App: Opens in traditional 2D mode
- Create Notes: Tap "Add Note" to create a new note
- View Notes: All notes appear in a scrollable list
- Delete Notes: Each note has a delete button
- Enter XR: Tap "Enter Full Space" to switch to 3D mode
- Enter Full Space: From Home Space, tap "Enter Full Space"
- Grant Permissions: Allow SCENE_UNDERSTANDING permission if prompted
- View Spatial Notes: Notes appear as floating 3D panels
- Interact with Notes:
- Move panels by grabbing them
- Resize panels using resize handles
- Delete notes using the delete button on each panel
- Add Notes: Use the floating "Add Note" button in 3D space
- Exit XR: Tap "Back to 2D" to return to Home Space mode
The app requires the following permissions:
<uses-permission android:name="android.permission.IMPORT_XR_ANCHOR" />
<uses-permission android:name="android.permission.SCENE_UNDERSTANDING" /> <!-- Runtime permission --><uses-feature android:name="android.hardware.xr.headtracking" android:required="false" />- MainActivity: Entry point, handles 2D mode and permission requests
- XrHostActivity: Isolated XR initialization and Full Space mode hosting
- FloatingNotesApp: Application class for dependency injection setup
Manages the state and logic for notes:
- Fetches notes from repository
- Handles note creation and deletion
- Updates note positions in 3D space
SpatialPanel: Container for 3D UI elementsSubspace: XR composition rootOrbiter: Positions UI elements in 3D space
# Run unit tests
./gradlew test
# Run instrumented tests
./gradlew connectedAndroidTestProblem: "Enter Full Space" button doesn't work Solution:
- Verify OpenXR runtime is installed: Check
/system/etc/openxr/1/active_runtime.json - Grant SCENE_UNDERSTANDING permission
- Restart the XR emulator/device
Problem: Permission requests keep appearing Solution:
- Manually grant permissions via Settings > Apps > XR Note App > Permissions
- Clear app data and try again
Problem: Gradle sync fails Solution:
./gradlew clean
./gradlew build --refresh-dependenciesProblem: Notes not persisting Solution:
- Clear app data
- Uninstall and reinstall the app
- Check Logcat for Room database errors
The app uses a defensive 2D-first approach:
MainActivityprovides a stable 2D UI that always worksXrHostActivityhandles XR initialization separately to prevent crashes- Graceful fallback when XR features are unavailable
- Uses Kotlin Flows for reactive state updates
- ViewModel survives configuration changes
- Single source of truth in Room database
Notes are positioned in 3D space using:
- X and Y coordinates (horizontal and vertical positioning)
- Z coordinate fixed at -800dp (depth from user)
Contributions are welcome! Please follow these steps:
- Fork the repository
- Create a feature branch (
git checkout -b feature/AmazingFeature) - Commit your changes (
git commit -m 'Add some AmazingFeature') - Push to the branch (
git push origin feature/AmazingFeature) - Open a Pull Request
This project is open source and available under the MIT License.
Kishor Ramani
- Android XR Team for the XR Compose libraries
- Jetpack Compose team for the modern UI toolkit
- Koin team for the lightweight dependency injection framework
- Note editing functionality
- Color customization for notes
- Voice-to-text note creation
- Collaborative notes in shared XR spaces
- Note categories and tags
- Export/Import functionality
- Cloud synchronization
- Gesture controls for XR interactions
- Advanced 3D positioning with spatial anchors
- Multi-user XR sessions
Built with โค๏ธ using Kotlin and Jetpack Compose for Android XR