How kanaji2002/toraponapp works
Project type & purpose
• Type: Native Android mobile application (tablet-optimized).
• Purpose: Offline/online tourist guide for 栗林公園, displaying current location, points of interest (POIs), and rich multi-language content stored as JSON assets.
File structure & infer architecture
• app/
– src/main/java/com/example/myapplication/componentsPage1 → “Map” feature
– componentsPage2 → “Spot list” & “Spot detail” feature
– componentsPage5 → (presumably another feature like settings or “Toilet filter”)
– utils/LocationUtils.kt & MapUtils.kt → business-logic helpers
– assets/spot*_folder/*.json → data layer (hard-coded POI metadata)
– AndroidManifest.xml, activity_map.xml → platform entrypoints
• Build config: Gradle Kotlin DSL (build.gradle.kts), ProGuard rules, tests (androidTest / unitTest).
README for additional context
• No remote backend; all POI data is local JSON.
• Uses device GPS for “現在地” via Android Location APIs.
• Likely integrates Google Maps or MapView (given MapUtils and activity_map.xml).
• Navigation between features via Jetpack Compose “AppNavHost.kt” in each component package.
Main components
a. Presentation Layer (blue)
• Android OS / Framework
• MainActivity.kt → hosts Compose
• AppNavHost.kt (in each feature) → Navigation Component
• Composable screens (page1.kt, ScreenList.kt, ScreenDetail.kt)
• UI Theme (ui/theme)
b. Domain/Business Logic (green)
• LocationUtils.kt → wraps LocationManager
• MapUtils.kt → marker creation, coordinate mapping
c. Data Layer (yellow)
• assets/*.json → POI metadata, multilingual strings
• Local parsing service (e.g., kotlinx.serialization in code)
d. Infrastructure & External Services (gray/cloud)
• Google Maps SDK (MapView or Compose Maps)
• Android Location Service (GPS)
• Device Storage (assets folder)
Relationships & data flows
1. User taps Map feature → MainActivity → AppNavHost → MapScreen
2. MapScreen invokes LocationUtils → Android Location Service → returns GPS coords
3. MapScreen calls MapUtils to transform JSON POI data → Map SDK → renders markers
4. User taps marker → Compose event → ScreenDetail via Navigation → JSON data parsed again or cached
5. Styling applied via ui/theme
6. All data reads from local assets; no network calls
Architectural patterns & design principles
• Feature-based modularization: each page under componentsPageX
• Unidirectional data flow: Presentation → Domain → Data
• Single Activity with Compose Navigation
• Separation of Concerns: UI vs. business helpers vs. raw data