This documentation provides an overview of the architecture, features, and technical implementation of Petal Push, a gamified habit tracker developed for Android.
### Technical Overview
- Language: Kotlin
- UI Framework: Jetpack Compose
- Data Persistence: Jetpack DataStore (Preferences)
- Audio Engine: Android MediaPlayer
### Core Features
- Persistent Habit Tracking: Uses DataStore to save habits and “Plant Power” points locally. Data persists even after the app process is terminated.
- Gamified Leveling System: A dynamic ranking system that evolves based on accumulated points:
- Sprout ๐ฑ: 0โ4 points
- Budding ๐ฟ: 5โ9 points
- Flowering ๐ธ: 10โ19 points
- Ancient Tree ๐ณ: 20+ points
- Auditory Feedback: Milestones (ranks 5, 10, and 20) trigger a success sound (
level_up.mp3) to enhance user engagement. - Modern UI/UX:
- Dark Mode Support: Adapts colors automatically based on system settings.
- Animated Counter: Uses
AnimatedContentfor smooth transitions in point changes. - Sync Indicator: Displays a “Last Synced” timestamp showing the exact time data was last modified.
### Data Persistence Logic
The app utilizes a custom StoreAppData class to manage preferences. Habits are stored as a CSV (comma-separated values) string and parsed back into a list upon retrieval.
Kotlin
// Example DataStore Logicval getHabits: Flow<List<String>> = context.dataStore.data.map { preferences -> val habitsString = preferences[HABITS_KEY] ?: "" if (habitsString.isEmpty()) emptyList() else habitsString.split(",")}
### Development History
- Version 1.0: Initial release focusing on basic habit list functionality (January 2026).
- Version 2.0: Major update including DataStore persistence, rank systems, and sound effects (February 2026).
### Future Roadmap
- Success Sounds: Expand library for different milestones.
- Visual Evolution: Implement customized plant graphics that grow visually with rank progress.
Leave a comment