A Kotlin Android application that combines location detection with educational content, providing users with fascinating information and quizzes about places around the world.
- π Location Detection: Hybrid GPS + Network location detection using FusedLocationProviderClient
- π Manual Location Search: Search for places using OpenStreetMap Nominatim API
- ποΈ Place Information: Rich details about locations using Wikipedia API
- π§ Interactive Quizzes: Knowledge tests using Open Trivia Database API
- π¨ Modern UI: Clean Material 3 design with Jetpack Compose
- Auto-detect current location with proper permission handling
- Search locations manually with autocomplete suggestions
- View comprehensive place information with descriptions and images
- Take knowledge quizzes in different categories (Geography, History, General Knowledge)
- Score tracking with detailed results and retry options
- Offline fallback with mock data when APIs are unavailable
- MVVM Pattern with Repository pattern
- Jetpack Compose for modern UI
- Kotlin Coroutines & Flow for asynchronous operations
- StateFlow & LiveData for reactive state management
- Location Services: Google Play Services Location
- Networking: Retrofit + Gson + OkHttp
- Image Loading: Coil for Compose
- Permissions: Accompanist Permissions
- Navigation: Compose Navigation
- UI: Material 3 + Compose
- OpenStreetMap Nominatim API - Geocoding (forward/reverse)
- Wikipedia REST API - Place information and descriptions
- Open Trivia Database API - Quiz questions and trivia
- OpenStreetMap Overpass API - Place type detection
app/src/main/java/com/example/edai/
βββ data/
β βββ api/ # API interfaces
β β βββ NominatimApi.kt
β β βββ WikipediaApi.kt
β β βββ TriviaApi.kt
β βββ model/ # Data models
β β βββ LocationModels.kt
β β βββ WikipediaModels.kt
β β βββ TriviaModels.kt
β βββ network/ # Network configuration
β β βββ NetworkModule.kt
β βββ repository/ # Data repositories
β βββ LocationRepository.kt
β βββ PlaceRepository.kt
β βββ TriviaRepository.kt
βββ location/ # Location services
β βββ LocationService.kt
βββ ui/
β βββ navigation/ # Navigation setup
β β βββ EdaiNavigation.kt
β βββ screens/ # UI screens
β β βββ HomeScreen.kt
β β βββ PlaceInfoScreen.kt
β β βββ TriviaScreen.kt
β βββ theme/ # UI theming
β β βββ Color.kt
β β βββ Theme.kt
β β βββ Type.kt
β βββ viewmodel/ # ViewModels
β βββ LocationViewModel.kt
β βββ PlaceViewModel.kt
β βββ TriviaViewModel.kt
βββ utils/ # Utility classes
β βββ Constants.kt
β βββ NetworkUtils.kt
βββ MainActivity.kt
- Android Studio Hedgehog or later
- Android SDK 24+ (Android 7.0)
- Kotlin 2.0+
-
Clone the repository
git clone <repository-url> cd EdaiApp
-
Open in Android Studio
- Launch Android Studio
- Click "Open an Existing Project"
- Navigate to the project directory
-
Build the project
./gradlew build
-
Run the app
- Connect an Android device or start an emulator
- Click "Run" in Android Studio or use:
./gradlew installDebug
ACCESS_FINE_LOCATION
- For GPS location detectionACCESS_COARSE_LOCATION
- For network-based locationINTERNET
- For API callsACCESS_NETWORK_STATE
- For network status checking
- Auto-detect Location: Tap "Detect Current Location" to use GPS
- Manual Search: Use "Enter Location Manually" to search for places
- Search Results: Select from search suggestions
- View comprehensive details about the selected location
- See Wikipedia descriptions and images
- Access coordinates and location metadata
- Navigate to quiz section
- Choose Category: Geography, History, or General Knowledge
- Answer Questions: 5 multiple-choice questions per quiz
- View Results: See score, correct answers, and performance
- Retry Options: Retake same category or try different topics
- Nominatim API: 1 request per second (automatic throttling implemented)
- Wikipedia API: No strict limits, but respectful usage
- Open Trivia DB: No limits on free tier
// In NetworkModule.kt
private val okHttpClient = OkHttpClient.Builder()
.connectTimeout(30, TimeUnit.SECONDS)
.readTimeout(30, TimeUnit.SECONDS)
.writeTimeout(30, TimeUnit.SECONDS)
.addInterceptor { chain ->
val original = chain.request()
val requestBuilder = original.newBuilder()
.header("User-Agent", "EdaiApp/1.0 (Educational Travel App)")
val request = requestBuilder.build()
chain.proceed(request)
}
.build()
./gradlew test
./gradlew connectedAndroidTest
- Repository layer tests
- ViewModel state management tests
- API response parsing tests
- Location Data: Only used for place information, never stored permanently
- API Calls: All data fetched from public, free APIs
- No Personal Data: App doesn't collect or store personal information
- Network Security: HTTPS enforced for all API calls
- Uses Google's Fused Location Provider for best accuracy
- Fallback to network-based location if GPS unavailable
- Mock data fallback for testing and offline scenarios
- Proper error handling and user feedback
- Wikipedia integration for rich, educational content
- Image loading with caching via Coil
- Coordinate display and metadata
- Graceful fallback to mock data when APIs fail
- Multiple categories with varying difficulty
- Score calculation and performance tracking
- Question shuffling for replayability
- Detailed result display with correct answers
- Fork the repository
- Create a feature branch (
git checkout -b feature/amazing-feature
) - Commit changes (
git commit -m 'Add amazing feature'
) - Push to branch (
git push origin feature/amazing-feature
) - Open a Pull Request
- Follow Kotlin coding conventions
- Use meaningful variable names
- Add comments for complex logic
- Maintain consistent formatting
This project is licensed under the MIT License - see the LICENSE file for details.
- OpenStreetMap for free geocoding services
- Wikipedia for educational content API
- Open Trivia Database for quiz questions
- Google for location services and Material Design
- Jetpack Compose team for modern UI toolkit
For support, questions, or feature requests:
- Open an issue on GitHub
- Contact the development team
- Check the documentation
Made with β€οΈ for educational exploration and discovery π