Locate DICK'S Sporting Goods stores using ZIP codes or their current location.
This app follows Clean Architecture principles with MVVM pattern
- StoreApiService: Interface for making API calls to the DSG store search endpoint
- StoreRepository: Handles data operations and transforms API responses to UI models
- Data Models: StoreResponse, Store, StoreUiModel
- API Security: Keys stored in gradle.properties and accessed via BuildConfig
- LocationProvider: Utility for accessing the device's location
- StoreSearchViewModel: Connects UI with the repository and manages UI state
- StoreSearchScreen: Main composable screen for searching stores
- UI Components: SearchBar, StoreList, StoreItem, ErrorMessage
- AppModule: Provides application context
- NetworkModule: Provides Retrofit, OkHttp, and API service instances
- StoreSearchViewModelTest: Unit tests for the ViewModel
- StoreRepositoryTest: Unit tests for the Repository
- Single-Activity Architecture: Utilizes Jetpack Navigation for Compose
- NavigationRoute: Defines app navigation destinations
- NavHost: Centralized navigation graph in MainActivity
- External Intent Integration: Seamlessly launches external map applications
- User can enter a ZIP code and search for nearby stores
- Displays a list of stores within 100 miles of the ZIP code
- User can use their device's GPS to find nearby stores
- Handles location permission requests appropriately
- Shows store name, distance, and city/state
- Handles empty states when no stores are found
- Displays appropriate error messages when API calls fail
- Handles location permission denials and errors
- 404 responses mapped to success with empty list for better UX
- API keys stored securely in gradle.properties (excluded from version control)
- Keys accessed at build-time via BuildConfig fields
- Consistent error handling prevents sensitive information exposure
- Migrated from multi-activity architecture to single-activity with Compose Navigation
- Removed MapDetailActivity in favor of direct map app integration
- Created MapUtils utility class for clean external map app launching
- Streamlined navigation flow when opening location in maps
- Clone the repository
- Create a
gradle.properties
file in the project root - Add the following line to your gradle.properties file:
API_KEY=code-challenge
- Sync the project with Gradle files
- Build and run the application
- Android Studio Hedgehog or later
- Minimum SDK: 24 (Android 7.0)
- Target SDK: 35
- Kotlin 1.9.0 or later
- Jetpack Compose for UI
- Jetpack Navigation for Compose
- Retrofit for network calls
- Hilt for dependency injection
- Kotlin Coroutines and Flow
- Google Play Services Location API