An intelligent study companion that helps you build better study habits, one brick at a time.
- Overview
- Features
- Screenshots
- Architecture
- Tech Stack
- Getting Started
- Development Setup
- Project Structure
- Key Components
- Database Schema
- Building the Project
- License
MindBricks is a comprehensive Android study-tracking platform designed to optimize learning for students and professionals. By integrating the Pomodoro technique with sensor-based focus tracking and post-session self-assessments, the app builds a deep understanding of user productivity. These insights power a personalized study timeline that adapts to individual habits, leveraging intelligent analytics and gamification to maximize focus and drive consistent academic growth.
| Feature | Description |
|---|---|
| π Smart Timer | Flexible Pomodoro timer with custom work/break intervals and subject tagging. |
| π‘ Focus Sensing | Real-time monitoring of noise, light, and motion to ensure optimal study conditions. |
| π Deep Analytics | Visual insights with 7+ chart types, heatmaps, and weekly focus trends. |
| ποΈ Gamification | Build a virtual city with coins earned from productive study sessions. |
| π€ AI Planner | Smart daily schedule recommendations based on your habits and calendar. |
Click to expand detailed feature breakdown
- Pomodoro Technique Integration: Configurable work/break intervals with customizable durations
- Multiple Timer Modes: Short break (5-10 min), long break (15-30 min), and focus session (25-60 min)
- Session Tags: Organize study sessions by subject/topic with custom color-coded tags
- Real-time Coin Rewards: Earn in-app currency for completing study sessions
- Session History: Complete chronological record of all study sessions with detailed statistics
- Multi-Sensor Tracking: Real-time monitoring during study sessions using:
- Microphone: Ambient noise level detection (background noise monitoring)
- Light Sensor: Environmental lighting conditions
- Accelerometer: Device orientation (kill-switch for light sensor when face-down) and movement detection
- Significant Motion Sensor: Major movement detection (distraction tracking) with accelerometer fallback
- Foreground Service: Continuous sensor monitoring even when screen is off (with WakeLock optimization)
- Session Quality Metrics: Automatic calculation of focus scores based on sensor data
- Privacy-First Design: All sensor data is processed locally and stored only as aggregated statistics
- Weekly Focus Chart: Bar chart showing daily study time over the past 7 days
- Hourly Distribution Heatmap: Visualize your most productive hours of the day
- Quality Heatmap: Color-coded calendar showing focus quality for each study session
- Tag Usage Pie Chart: Distribution of study time across different subjects/tags
- Daily Goal Rings: Apple Watch-style activity rings showing daily progress
- Streak Calendar: Visual representation of study streaks with color intensity
- Daily Timeline: Detailed hour-by-hour breakdown of study sessions
- Session History List: Expandable cards with detailed session information including:
- Duration and timestamps
- Perceived productivity rating
- Emotional state (PAM - Pleasure, Arousal, Dominance model)
- Focus score calculated from sensor data
- Environmental conditions (noise level, light, movement)
- Adaptive Daily Schedule: AI-powered schedule generation based on:
- Your study preferences and goals
- Historical performance data
- Calendar integration
- Optimal study time allocation
- Calendar Integration: Syncs with device calendar to avoid scheduling conflicts
- Context-Aware Suggestions: Recommendations consider:
- Sleep schedule preferences
- Meal times
- Work schedule
- Exercise routine
- Social time
- Daily study hour goals
- Visual Schedule Display: Interactive 24-hour timeline with activity blocks
- Study Plan Customization: Set daily study goals for each day of the week
- Coin Economy: Earn coins by completing study sessions
- City Building Mini-Game:
- Build and customize your own virtual city
- Purchase tiles (buildings, parks, roads, decorations) from the shop
- 40x40 grid world for extensive city building
- Drag-and-drop tile placement system
- Multiple tile categories: terrain, buildings, nature, infrastructure
- Persistent world state saved locally
- Inventory management system
- Categorized shop with preview images
- Visual Progress: Watch your city grow as you maintain study habits
- Profile Picture: Choose from gallery or take a photo with camera
- Study Objectives: Set and track your learning goals
- Customizable Tags: Create unlimited subject/topic tags with custom colors
- Theme Support: Material Design 3 with system theme support
- Avatar Generation: Automatic avatar generation via API integration
- Emotion Assessment: PAM (Pleasure-Arousal-Dominance) model questionnaire
- Productivity Rating: Multi-dimensional perceived productivity questions:
- Overall accomplishment
- Task progression
- Focus level
- Efficiency perception
- Session satisfaction
- Focus Score Calculation: Automatic scoring based on sensor data
- Historical Comparison: Compare current session with personal averages
- Device Calendar Sync: Read calendar events for intelligent scheduling
- Conflict Detection: Avoid scheduling study sessions during existing events
- Permission Management: Granular calendar permission requests
- Event Display: Shows calendar events in recommendation timeline
- Profile Management: Update name, avatar, and study objectives
- Pomodoro Configuration: Customize timer durations for all modes
- Study Plan Editor: Set daily study hour goals for each weekday
- Calendar Settings: Manage calendar sync and permissions
- Debug Tools (Debug builds only):
- Test data generation
- Database inspection
- Development utilities
- Multi-Step Setup: Guided introduction to app features
- Permission Requests: Contextual explanation for each permission
- User Profile Creation: Set up name and avatar during onboarding
- Sensor Testing: Verify sensor availability and functionality
- Skip Option: Fast-track for experienced users
MindBricks requires the following permissions:
- Microphone (
RECORD_AUDIO): Record ambient noise levels during sessions (processed locally) - Activity Recognition (
ACTIVITY_RECOGNITION): Detect significant device movement - Camera (
CAMERA): Take profile pictures - Gallery (
READ_MEDIA_IMAGES): Select profile pictures from gallery - Calendar (
READ_CALENDAR): Sync calendar events for recommendations (optional) - Notifications (
POST_NOTIFICATIONS): Session reminders and completion alerts - Internet (
INTERNET): Avatar generation API only - Vibration (
VIBRATE): Haptic feedback for timer events - Wake Lock (
WAKE_LOCK): Keep sensors active during study sessions
MindBricks handles sensitive behavioral data (study habits, environmental conditions, location context). To ensure user privacy and GDPR compliance:
- Local-Only Storage: All sensor data and questionnaire responses are processed and stored strictly on the device using Room Database.
- No Cloud Upload: We do not transmit any personal data to external servers.
- Data Control: Users have full ownership of their data with options to delete it at any time.
- Aggregated Statistics: Raw sensor streams (like audio) are processed in real-time to extract features (e.g., "noise level") and are never stored raw.
Pomodoro timer with tag selection, coin balance, and session tracking dots
Left: Welcome introduction screen | Right: User profile creation with name and avatar
Left: Sensor permissions explanation and testing | Right: Notification permission request
Left: AI-powered daily schedule with calendar integration | Right: Study streak calendar with quality indicators
Left: Weekly focus bar chart showing daily study time | Right: Hourly distribution heatmap
Left: Focus quality heatmap calendar | Right: Tag usage pie chart showing subject distribution
Detailed session history with expandable cards showing focus scores, duration, and statistics
Left: User profile with avatar and study objectives | Right: Pomodoro timer configuration
Left: Weekly study plan editor | Right: Calendar integration settings
Left: 40x40 tile-based city world with placed buildings | Right: Editing mode with tile placement
Tile shop with categorized items - purchase buildings, decorations, and infrastructure with earned coins
Left: PAM (Pleasure-Arousal-Dominance) emotion assessment | Right: Multi-dimensional productivity questionnaire
Developer tools for testing and database inspection
MindBricks follows Clean Architecture principles with MVVM (Model-View-ViewModel) pattern:
graph TD
subgraph Presentation_Layer [Presentation Layer]
direction TB
Activities
Fragments
Custom_Views[Custom Views]
ViewModels
Activities --> ViewModels
Fragments --> ViewModels
Custom_Views --> ViewModels
end
subgraph Domain_Layer [Domain Layer]
direction TB
Repositories
Use_Cases[Use Cases]
ViewModels --> Repositories
Repositories --> Use_Cases
end
subgraph Data_Layer [Data Layer]
direction TB
Room_Database[Room Database]
Sensors
SharedPrefs
Calendar
Use_Cases --> Room_Database
Use_Cases --> Sensors
Use_Cases --> SharedPrefs
Use_Cases --> Calendar
end
- MVVM: Separation of UI logic from business logic
- Repository Pattern: Abstraction layer for data sources
- Observer Pattern: LiveData for reactive UI updates
- Strategy Pattern: Sensor implementations with pluggable strategies
- Factory Pattern: Tile asset creation and loading
- Singleton Pattern: Database and manager instances
- Service Locator: Dependency management for ViewModels
Initially designed to run in the background, we pivoted to a Foreground Service architecture due to Android's strict background execution limits and sensor access restrictions (particularly microphone and camera access). This ensures reliable data collection while the user studies, respecting OS constraints and preventing system kills.
The city-building mini-game required handling complex state, assets, and logic. To maintain code quality, we refactored the monolithic game logic into ten dedicated modules, separating concerns:
- City State: Manages the grid data and persistence
- Asset Manager: Handles loading and caching of tile resources
- Inventory System: Tracks user items and purchases
- Renderer: specialized
Canvasdrawing logic
We implemented sophisticated time-series analysis on sensor data (noise, light, motion). The system performs Statistical Aggregation, Predictive Analytics, and Pattern Recognition to generate the Focus Score. This score helps identify peak performance times by correlating environmental data with user-reported productivity.
- Language: Java 17
- Min SDK: Android 10 (API 29)
- Target SDK: Android 15 (API 36)
- Build System: Gradle with Kotlin DSL
- Room Database: Local data persistence with SQLite
- LiveData: Observable data holder for reactive UI
- ViewModel: Lifecycle-aware UI-related data management
- Navigation Component: Fragment navigation and deep linking
- ViewBinding & DataBinding: Type-safe view access
- WorkManager: Background task scheduling (future feature)
- Fragment KTX: Kotlin extensions for fragments
- Material Design 3: Latest Material components and theming
- MPAndroidChart: Advanced charting library for analytics
- Glide: Efficient image loading and caching
- SwipeRefreshLayout: Pull-to-refresh gesture
- RecyclerView: Efficient list rendering
- ConstraintLayout: Flexible responsive layouts
- ViewPager2: Swipeable onboarding screens
- Gson: JSON parsing and serialization
- Room Type Converters: Object serialization for database
- SensorManager: Access to device sensors
- AudioRecord: Microphone for ambient noise detection
- CalendarProvider: Device calendar integration
- CameraX (via FileProvider): Camera and gallery access
- Android Studio: Official IDE
- Gradle Version Catalog: Centralized dependency management
- ProGuard: Code obfuscation for release builds
- JUnit & Espresso: Unit and UI testing frameworks
- Android Studio: Hedgehog (2023.1.1) or later
- JDK: Java 17 or higher
- Android SDK: API 29 or higher
- Physical Device or Emulator: API 29+ (Android 10+) for full sensor support
-
Clone the repository
git clone https://github.com/yourusername/mindbricks.git cd mindbricks -
Open in Android Studio
- Launch Android Studio
- Select
File > Open - Navigate to the
androiddirectory - Click
OKto open the project
-
Sync Gradle
- Android Studio will automatically prompt to sync Gradle
- Wait for dependency download to complete
-
Run the app
- Connect an Android device or start an emulator
- Click the
Runbutton or pressShift + F10 - Select your target device
Note: For detailed workflows, debugging tips, and common issues, please refer to the Development Guide. For a quick cheat sheet, check the Quick Reference.
Tools > SDK Manager
βββ Android SDK Platform 36
βββ Android SDK Build-Tools 36.0.0
βββ Android Emulator
βββ Android SDK Platform-Tools
Build > Select Build Variant
βββ debug: Development build with debug menu
βββ release: Production build with optimizations
ViewBinding is enabled by default in build.gradle.kts:
buildFeatures {
viewBinding = true
dataBinding = true
}cd android
./gradlew assembleDebugOutput: app/build/outputs/apk/debug/app-debug.apk
cd android
./gradlew assembleReleaseOutput: app/build/outputs/apk/release/app-release.apk
# Unit tests
./gradlew test
# Instrumented tests
./gradlew connectedAndroidTestThis project follows Google Java Style Guide with these key conventions:
- Indentation: 4 spaces (no tabs)
- Line Length: 120 characters max
- Naming:
- Classes:
PascalCase - Methods/Variables:
camelCase - Constants:
UPPER_SNAKE_CASE - Resources:
snake_casewith prefixes (activity_,fragment_,component_)
- Classes:
- Javadoc: All public classes and methods must have documentation
- Author Tags: Include
@authortags for attribution
layouts/
βββ activity_*.xml # Activity layouts
βββ fragment_*.xml # Fragment layouts
βββ component_*.xml # Reusable components
βββ item_*.xml # RecyclerView items
βββ dialog_*.xml # Dialog layouts
strings/
βββ strings_main.xml # Global strings
βββ strings_home.xml # Home fragment strings
βββ strings_analytics.xml
βββ strings_shop.xml
βββ strings_settings.xml
mindbricks/
βββ android/ # Android application
β βββ app/
β β βββ src/
β β β βββ main/
β β β β βββ java/ch/inf/usi/mindbricks/
β β β β β βββ config/ # App configuration
β β β β β βββ database/ # Room Database & DAOs
β β β β β βββ drivers/ # Sensor drivers
β β β β β β βββ base/ # Base sensor interfaces
β β β β β β βββ calendar/ # Calendar integration
β β β β β β βββ motion/ # Motion sensor strategies
β β β β β βββ game/ # City building game
β β β β β βββ model/ # Data models & entities
β β β β β β βββ evaluation/ # PAM scores
β β β β β β βββ plan/ # Study plan models
β β β β β β βββ questionnare/ # Questionnaire data
β β β β β β βββ recommendation/# Recommendation models
β β β β β β βββ visual/ # UI-specific models
β β β β β βββ repository/ # Data repositories
β β β β β βββ service/ # Foreground services
β β β β β βββ ui/ # UI components
β β β β β β βββ charts/ # Custom chart views
β β β β β β βββ nav/ # Navigation fragments
β β β β β β β βββ analytics/
β β β β β β β βββ home/
β β β β β β β βββ shop/
β β β β β β βββ onboarding/ # Onboarding flow
β β β β β β βββ settings/ # Settings screens
β β β β β βββ util/ # Utility classes
β β β β β βββ analytics/ # Analytics helpers
β β β β β βββ database/ # DB utilities
β β β β β βββ evaluation/ # Recommendation engine
β β β β β βββ questionnaire/# Questionnaire logic
β β β β β βββ validators/ # Input validation
β β β β βββ res/
β β β β β βββ drawable/ # Vector graphics
β β β β β βββ layout/ # XML layouts
β β β β β βββ mipmap/ # App icons
β β β β β βββ navigation/ # Navigation graphs
β β β β β βββ raw/ # Sound files
β β β β β βββ values/ # Strings, colors, themes
β β β β β βββ xml/ # Preferences, file paths
β β β β βββ AndroidManifest.xml
β β β βββ test/ # Unit tests
β β βββ schemas/ # Room database schemas
β β βββ build.gradle.kts
β βββ build.gradle.kts
β βββ settings.gradle.kts
βββ assets/ # Project assets
βββ docs/ # Documentation
β βββ final_report/ # LaTeX final report
β βββ project_proposal.pdf
βββ slides/ # Presentation slides
βββ README.md
LauncherActivity: Splash screen and onboarding checkMainActivity: Main navigation host with bottom navigation barOnboardingActivity: Multi-step user onboarding flowSettingsActivity: Hierarchical settings with multiple fragments
HomeFragment: Study timer with Pomodoro controlsAnalyticsFragment: Comprehensive analytics dashboardShopFragment: City building game and tile shop
HomeViewModel: Manages study session state and timersAnalyticsViewModel: Aggregates and processes study statisticsProfileViewModel: User profile and coin balance managementTileGameViewModel: City building game state
AppDatabase: Room database singleton with 7 tablesStudySessionDao: CRUD operations for study sessionsTagDao: Tag management queriesPAMScoreDao: Emotion assessment storageSessionQuestionnaireDao: Productivity questionnaire responsesSessionSensorLogDao: Sensor data logsCalendarEventDao: Calendar sync cache
SensorService: Foreground service for continuous monitoringMicrophoneRecorder: Ambient noise level detectionLightSensor: Environmental lighting monitoringAccelerometerSensor: Device orientation trackingSignificantMotionSensor: Major movement detectionBaseSensor: Abstract sensor interface
RecommendationEngine: AI-powered schedule generationFocusScoreCalculator: Sensor data analysisPreferencesManager: SharedPreferences wrapperUserPreferenceLoader: JSON-based preference loadingTagManager: Tag CRUD operationsNotificationHelper: Notification creation and managementSoundPlayer: Audio feedback for timersVibrationHelper: Haptic feedback wrapper
GoalRingsView: Circular progress rings (Apple Watch style)WeeklyFocusChartView: Bar chart for weekly overviewHourlyDistributionChartView: Heatmap for hourly patternsQualityHeatmapChartView: Calendar heatmap for session qualityStreakCalendarView: Streak visualization calendarTagUsageChartView: Pie chart for tag distributionDailyTimelineChartView: Horizontal timeline chartCityView: Custom canvas-based tile world renderer
MindBricks uses Room Database with the following tables:
Primary table for study session records.
CREATE TABLE study_sessions (
id INTEGER PRIMARY KEY AUTOINCREMENT,
tag_id INTEGER NOT NULL,
start_time INTEGER NOT NULL,
end_time INTEGER,
duration_seconds INTEGER,
coins_earned INTEGER DEFAULT 0,
focus_score REAL,
FOREIGN KEY (tag_id) REFERENCES tags(id) ON DELETE CASCADE
)Subject/topic categorization.
CREATE TABLE tags (
id INTEGER PRIMARY KEY AUTOINCREMENT,
name TEXT NOT NULL UNIQUE,
color TEXT NOT NULL,
created_at INTEGER NOT NULL
)Post-session evaluations.
CREATE TABLE session_questionnaires (
id INTEGER PRIMARY KEY AUTOINCREMENT,
session_id INTEGER NOT NULL,
accomplishment INTEGER NOT NULL,
task_progression INTEGER NOT NULL,
focus_level INTEGER NOT NULL,
efficiency INTEGER NOT NULL,
satisfaction INTEGER NOT NULL,
average_score REAL NOT NULL,
FOREIGN KEY (session_id) REFERENCES study_sessions(id) ON DELETE CASCADE
)PAM (Pleasure-Arousal-Dominance) emotional assessment.
CREATE TABLE pam_scores (
id INTEGER PRIMARY KEY AUTOINCREMENT,
session_id INTEGER NOT NULL,
pleasure INTEGER NOT NULL,
arousal INTEGER NOT NULL,
dominance INTEGER NOT NULL,
created_at INTEGER NOT NULL,
FOREIGN KEY (session_id) REFERENCES study_sessions(id) ON DELETE CASCADE
)Aggregated sensor readings during sessions.
CREATE TABLE session_sensor_logs (
id INTEGER PRIMARY KEY AUTOINCREMENT,
session_id INTEGER NOT NULL,
timestamp INTEGER NOT NULL,
light_level REAL NOT NULL,
noise_level REAL NOT NULL,
device_face_up INTEGER NOT NULL,
motion_detected INTEGER NOT NULL,
FOREIGN KEY (session_id) REFERENCES study_sessions(id) ON DELETE CASCADE
)Cached calendar events for recommendations.
CREATE TABLE calendar_events (
id INTEGER PRIMARY KEY AUTOINCREMENT,
calendar_id INTEGER NOT NULL,
event_id INTEGER NOT NULL,
title TEXT,
start_time INTEGER NOT NULL,
end_time INTEGER NOT NULL,
all_day INTEGER NOT NULL,
synced_at INTEGER NOT NULL
)tags (1) ββ< (N) study_sessions
study_sessions (1) ββ< (1) session_questionnaires
study_sessions (1) ββ< (1) pam_scores
study_sessions (1) ββ< (N) session_sensor_logs
# Verify Java version
java -version # Should be Java 17+
# Verify Android SDK
echo $ANDROID_HOME # Should point to Android SDK location# Navigate to Android project
cd android
# Clean build
./gradlew clean
# Build debug APK
./gradlew assembleDebug
# Build release APK
./gradlew assembleRelease
# Install debug on connected device
./gradlew installDebug
# Run all checks and tests
./gradlew check
# Generate code coverage report
./gradlew jacocoTestReport- Open Project:
File > Openβ Selectandroiddirectory - Build Menu:
Build > Clean ProjectBuild > Rebuild ProjectBuild > Make Project(Ctrl+F9 / βF9)
- Generate APK:
Build > Build Bundle(s) / APK(s) > Build APK(s) - Run: Click βΆ button or press Shift+F10
For production builds, configure signing in local.properties:
storeFile=path/to/keystore.jks
storePassword=****
keyAlias=****
keyPassword=****Then build:
./gradlew assembleReleaseThis project is licensed under the MIT License - see the LICENSE file for details.
MindBricks represents two months of dedicated development, combining theoretical knowledge with practical Android development skills. The project demonstrates:
- β Clean architecture with separation of concerns
- β Modern Android development best practices
- β Comprehensive sensor integration
- β Advanced database design with Room
- β Custom view implementations
- β Material Design 3 compliance
- β Extensive code documentation
- β Robust error handling
- β Performance optimizations
We hope MindBricks serves as a valuable reference for Android development and helps students build better study habits!
Happy Studying! π






















