How salf423/app-nvel-burbuja works
1. Project type and scope
- This is a .NET MAUI Android app for a bubble level / inclinometer, not a multi-service system.
- The architecture is intentionally small: one UI screen, one sensor-driven interaction loop, and Android-specific packaging/build configuration.
2. Application composition
- The repo is split into XAML UI and C# code-behind.
- The main functional boundary is between:
- visual layout (buendia/XAML)
- runtime behavior and sensor handling (buendia/C#)
- There is no backend, database, or network layer in the repository.
3. Startup and host layer
- App.xaml.cs and MauiProgram.cs define the app startup path.
- MainActivity.cs is the Android entry host that connects the MAUI app to the Android runtime.
- App.xaml provides the application-level shell/resources, while MainPage.xaml is the primary screen shown to the user.
4. Main UI subsystem
- MainPage.xaml is the single visible interface for the level indicator.
- The UI likely contains a movable visual element (miBurbuja) whose position represents tilt.
- The UI is updated continuously from sensor events, so the page is both the display surface and the target of live state changes.
5. Sensor processing subsystem
- The core logic is in MainPage.xaml.cs, where the accelerometer change handler is registered and executed.
- The app listens to accelerometer readings and uses them as the raw input stream.
- This is the central data source of the whole application.
6. Signal processing and motion logic
- Each accelerometer update reads the X, Y, and Z axes.
- The values are smoothed with an exponential filter using Alpha, reducing jitter.
- From the filtered values, the app computes:
- pitch from X relative to Y/Z magnitude
- roll from Y and Z
- These angles are then converted into visual offsets for the bubble.
7. UI update flow
- Sensor callbacks are not applied directly to the visual tree; updates are marshaled through the main thread.
- The bubble position is changed via TranslationX and TranslationY.
- The final displacement is scaled and clamped, which keeps the UI stable and prevents the bubble from moving outside the intended range.
8. Android platform boundary
- buendia/Propiedaes/AndroidManifest.xml defines Android-specific capabilities and app metadata.
- The manifest declares:
- app name/label
- minimum and target SDK levels
- required accelerometer hardware
- This means the app is explicitly tied to devices with an accelerometer.
9. Permissions and device constraints
- The README highlights that sensor permissions must be handled for Android runtime behavior.
- It also notes that testing should be done on a real Android device, which is important because the app depends on actual motion hardware.
- This is not an emulator-first design; physical sensor input is the critical dependency.
10. Build and packaging
- AccelerometerEssential.Android.csproj is the Android project definition.
- Directory-Build.props and global.json provide repo-wide build consistency and SDK pinning.
- The repository includes a GitHub Actions workflow at .github/workflows/build-android.yml, indicating automated Android builds/CI.
11. Runtime behavior summary
- The app’s data flow is linear:
- accelerometer hardware → change event → filtering → angle computation → UI translation
- The screen is continuously driven by live sensor input, so the system behaves like a real-time control loop rather than a request/response application.
12. Architecture diagram boundaries to show
- A good diagram should include these distinct blocks:
- Android device hardware (accelerometer)
- Android runtime / MainActivity
- MAUI app shell and page layer
- sensor processing logic
- bubble UI element
- build/CI pipeline
- The key dependency direction is from hardware input into the page logic, then outward to the UI.
13. Repo-specific note
- The folder names show a mix of Spanish labels and MAUI conventions, and Propiedaes appears to be a typo of Propiedades; architecturally, it still functions as the Android properties/manifest area.
- The repo is tightly focused: the accelerometer-driven bubble indicator is the main product behavior, and everything else supports that single flow.
Main entry points: MainPage.xaml.cs Sensor logic · MainPage.xaml Main screen · AccelerometerEssential.Android.csproj Android csproj · App.xaml.cs App startup
Components 13
Device input
Physical accelerometer source on the Android device
- Accelerometer · Physical motion sensor providing X/Y/Z readings
App runtime
MAUI startup, page hosting, and sensor loop
- MainActivity · Android entry point that boots the MAUI app
buendia/C#/MainActivity.cs - MauiProgram · Registers MAUI services and configures the app host
buendia/C#/MauiProgram.cs - App startup · Connects application startup to the main page
buendia/C#/App.xaml.cs - Sensor logic · Handles accelerometer updates, filtering, angles, and UI translation
buendia/C#/MainPage.xaml.cs - App resources · Application-level resources and shell definition
buendia/XAML/App.xaml
Bubble UI
Visible screen and animated level indicator
- Main screen · Primary UI layout for the inclinometer display
buendia/XAML/MainPage.xaml - Bubble · Movable visual element whose position reflects tilt
buendia/XAML/MainPage.xaml
Android platform
Android packaging, manifest, and device constraints
- AndroidManifest · Android app metadata, SDK levels, and hardware requirements
buendia/Propiedaes/AndroidManifest.xml
Build & CI
Repo-wide build settings and automated Android build
- Android csproj · MAUI Android project definition and packaging settings
buendia/C#/AccelerometerEssential.Android.csproj - Build props · Repository-wide build defaults and shared settings
Directory-Build.props - SDK pin · Pinned .NET SDK version for consistent builds
global.json - Android CI · Automated Android build workflow
.github/workflows/build-android.yml
Connections 15
- Accelerometer → MainActivity: device input · Sensor hardware is accessed through the Android app host
- MainActivity → MauiProgram: bootstraps · Android entry point starts the MAUI application
- MauiProgram → App startup: creates app · Configures the app object and startup services
- App startup → App resources: loads resources · Application startup binds to app-level XAML resources
- App startup → Main screen: opens page · Startup routes the user into the main screen
- Main screen → Bubble: contains · The visible level indicator is part of the main screen layout
- Main screen → Sensor logic: code-behind · The page layout is paired with its runtime logic
- Sensor logic → Accelerometer: reads · Registers and consumes accelerometer change events
- Sensor logic → Bubble: moves · Computes translation offsets and updates the indicator
- Sensor logic → Main screen: updates UI · Sensor callbacks marshal changes back to the page thread
- AndroidManifest → Accelerometer: requires · Declares accelerometer hardware as a device dependency
- Android csproj → AndroidManifest: packages · Android project includes platform manifest and app packaging
- Build props → Android csproj: configures · Shared build defaults feed the Android project
- SDK pin → Android csproj: pins toolchain · Locks the .NET SDK used for local and CI builds
- Android CI → Android csproj: builds · GitHub Actions runs the Android project in CI