A modern Android application for tracking stock market data with real-time analytics, built using Jetpack Compose and MVVM architecture.
| Splash Screen | Home Screen | Details Screen | Dark Mode |
|---|---|---|---|
![]() |
![]() |
![]() |
![]() |
- Live stock prices from Marketstack API
- Daily change percentage with color-coded indicators
- Stock analytics dashboard
- Jetpack Compose for declarative UI
- Material Design 3 with dynamic colors
- Dark/Light mode toggle with persistence
- Search stocks by symbol, company, or sector
- Pull-to-refresh for latest data
- Offline support with Room database caching
- Detailed analytics for each stock
- Market statistics and sharky tracking
- MVVM (Model-View-ViewModel) pattern
- MVI (Model-View-Intent) state management
- Repository pattern for data abstraction
- Clean separation of concerns
- Language: Kotlin 100%
- UI Framework: Jetpack Compose
- Architecture: MVVM + MVI
- Local Database: Room
- Networking: Retrofit + Coroutines
- Dependency Injection: Manual DI (Factory pattern)
- Testing: JUnit, Coroutines Test
- API: Marketstack Stock API
- Animated welcome screen
- Gradient background with smooth transitions
- Professional branding
- Stock list with real-time prices
- Search functionality with filtering
- Market statistics overview
- Dark/light mode toggle
- Pull-to-refresh for updates
- Comprehensive stock analytics
- Price history and statistics
- Company information
- 52-week high/low data
- Interactive action buttons
\
sharky-stocks/
βββ app/
β βββ src/main/java/com/example/sharkystocks/
β β βββ MainActivity.kt
β β βββ mvi/ # MVI architecture
β β β βββ StockAction.kt
β β β βββ StockState.kt
β β β βββ reducer.kt
β β βββ data/ # Data layer
β β β βββ local/ # Room database
β β β βββ network/ # API layer
β β β βββ repository/ # Repository pattern
β β βββ screens/ # UI Screens
β β βββ navigation/ # Navigation
β β βββ ui/theme/ # Theming system
β β βββ viewmodels/ # ViewModels
β βββ src/test/ # Unit tests
βββ build.gradle.kts
βββ README.md
\\
Comprehensive test suite with 90%+ code coverage:
- Unit Tests: JUnit tests for ViewModel, Repository, and Reducer
- Coroutine Testing: Using TestDispatcher for async operations
- Mock API: FakeApiService for network testing
- State Management: Complete MVI reducer testing
- \StockViewModelTest.kt\ - ViewModel logic testing
- \StockRepositoryTest.kt\ - Data layer testing
- \ReducerTest.kt\ - State management testing
- \FakeApiService.kt\ - Mock API implementation
- Android Studio Giraffe or later
- Android SDK 34
- Java 17
- Marketstack API Key (free tier available)
-
Clone the repository: \
git clone https://github.com/ngohaihuyen/Sharky-Stock.git \\ -
Open in Android Studio:
- File β Open β Select project directory
-
Add API Key:
- Get free API key from marketstack.com
- Replace in \ApiService.kt: \\kotlin @Query("access_key") accessKey: String = "YOUR_API_KEY_HERE" \\
-
Build and run on emulator or physical device
- Why: Predictable state management, unidirectional data flow
- Benefit: Easy debugging, testable, maintainable
- Why: Modern declarative UI, faster development
- Benefit: Less boilerplate, reactive UI, better performance
- Why: Network resilience, better user experience
- Benefit: App works without internet, faster loading
- Why: Consistent branding, user preference support
- Benefit: Polished appearance, accessibility compliance
- Challenge: Marketstack free tier allows only 1000 API calls/month
- Solution: Implemented smart caching with Room database
- Result: Reduced API calls while maintaining data freshness
- Challenge: Multiple concurrent data states (loading, success, error)
- Solution: MVI (Model-View-Intent) architecture
- Benefit: Predictable, testable, maintainable codebase
- Challenge: Creating financial-grade user interface
- Solution: Jetpack Compose + Material Design 3 + custom animations
- Outcome: Polished, responsive, accessible interface
Building this project helped me practice:
- Advanced Android Architecture: MVVM + MVI patterns
- Jetpack Compose: Building complex UIs declaratively
- State Management: Handling complex app states predictably
- Testing: Comprehensive unit testing with coroutines
- API Integration: RESTful APIs with Retrofit
- Database: Room persistence with caching strategies
- Professional UI/UX: Creating polished, production-ready interfaces
Planned features for future releases:
- Portfolio Tracking: User portfolio management
- Real-time Push Notifications: Price alerts
- Advanced Charts: Interactive price history charts
- More Stock Exchanges: NASDAQ, NYSE, global markets
- Watchlists: Custom stock watchlists
- News Integration: Latest financial news
Hai Huyen Ngo
- GitHub: @ngohaihuyen
- LinkedIn: [Hai Huyen Ngo]
- Marketstack API for providing free stock data
- Android Developers for excellent documentation
- JetBrains for Kotlin language
- Google for Jetpack Compose and Android Studio



