Skip to content

Satwik0706/MAD_LAB_CAMPUS

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

2 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation



πŸ›οΈ Campus Explore

An interactive Android app to navigate your college campus β€” buildings, floors, rooms & canteen menus, all in one place.



πŸ“± App Flow

Campus Explore Page
        β”‚
        β–Ό
πŸ—ΊοΈ  3D Campus Map          ← Isometric / 3D view of all buildings
        β”‚  (tap a building)
        β–Ό
πŸ›οΈ  Building Details        ← 2D floor plan with floor tabs
        β”‚  (tap a floor)
        β–Ό
πŸ“‹  Floor Details           ← Offices Β· Classrooms Β· Canteen
        β”‚  (tap canteen)
        β–Ό
🍽️  Canteen Menu            ← Food items with prices & categories

✨ Features

  • πŸ—ΊοΈ Interactive 3D/Isometric Campus Map β€” tap any building to explore
  • πŸ›οΈ 2D Floor Plan Viewer β€” custom Canvas-based rendering with room tap support
  • πŸ“‹ Room-level Navigation β€” offices, classrooms, canteen all linked
  • 🍽️ Live Canteen Menu β€” food items, categories & pricing
  • πŸ“¦ JSON-driven Data β€” all campus data loaded from local assets
  • ⚑ ViewModel + Repository pattern β€” clean MVVM architecture

πŸ—‚οΈ Project Structure

app/src/main/java/com/bms/college_explore/
β”‚
β”œβ”€β”€ ui/
β”‚   β”œβ”€β”€ map/
β”‚   β”‚   β”œβ”€β”€ CampusMapFragment.kt        # 3D isometric map with building markers
β”‚   β”‚   β”œβ”€β”€ MapViewModel.kt             # State & data binding for map screen
β”‚   β”‚   └── BuildingMarkerAdapter.kt    # Renders building pins on the map
β”‚   β”‚
β”‚   β”œβ”€β”€ floorplan/
β”‚   β”‚   β”œβ”€β”€ FloorPlanActivity.kt        # 2D floor plan viewer with floor tabs
β”‚   β”‚   β”œβ”€β”€ FloorPlanView.kt            # Custom Canvas view for room rendering
β”‚   β”‚   └── RoomClickListener.kt        # Interface for room tap events
β”‚   β”‚
β”‚   β”œβ”€β”€ canteen/
β”‚   β”‚   β”œβ”€β”€ CanteenMenuFragment.kt      # Displays food items & prices
β”‚   β”‚   └── MenuAdapter.kt             # RecyclerView adapter for menu list
β”‚   β”‚
β”‚   └── common/
β”‚       └── BuildingData.kt             # Shared data class definitions
β”‚
β”œβ”€β”€ data/
β”‚   β”œβ”€β”€ models/
β”‚   β”‚   β”œβ”€β”€ Building.kt                 # Building model (name, location, floors)
β”‚   β”‚   β”œβ”€β”€ Floor.kt                    # Floor model (number, rooms)
β”‚   β”‚   β”œβ”€β”€ Room.kt                     # Room model (id, name, type, bounds)
β”‚   β”‚   └── MenuItem.kt                 # Menu item (name, price, category)
β”‚   β”‚
β”‚   └── repository/
β”‚       └── CampusRepository.kt         # Loads campus JSON from assets/
β”‚
└── utils/
    └── MapUtils.kt                     # Isometric coordinate helpers

πŸ—οΈ Architecture

           β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
           β”‚         UI Layer            β”‚
           β”‚  Fragment / Activity / View β”‚
           β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
                        β”‚ observes
           β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β–Όβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
           β”‚       ViewModel Layer       β”‚
           β”‚       MapViewModel          β”‚
           β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
                        β”‚ requests
           β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β–Όβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
           β”‚      Repository Layer       β”‚
           β”‚      CampusRepository       β”‚
           β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
                        β”‚ reads
           β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β–Όβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
           β”‚       Data / Assets         β”‚
           β”‚     campus.json (assets/)   β”‚
           β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜

Pattern: MVVM Β· Repository Β· LiveData / StateFlow


🧩 Key Components

πŸ—ΊοΈ CampusMapFragment + MapViewModel

Renders an isometric projection of all campus buildings. Uses MapUtils.kt for coordinate conversion:

screenX = (col - row) Γ— tileWidth  / 2
screenY = (col + row) Γ— tileHeight / 2

πŸ›οΈ FloorPlanView (Custom Canvas)

A fully custom View that:

  • Draws room rectangles per floor from Floor data model
  • Hit-tests finger touch against RectF room bounds
  • Fires RoomClickListener on valid tap

πŸ“¦ CampusRepository

Loads JSON from assets/campus.json on an IO coroutine:

withContext(Dispatchers.IO) {
    context.assets.open("campus.json").use { stream ->
        Gson().fromJson(stream.reader(), CampusData::class.java)
    }
}

🍽️ CanteenMenuFragment + MenuAdapter

Displays menu items grouped by category with prices. Backed by MenuItem.kt data model.


πŸ“ Data Models

data class Building(
    val id: String,
    val name: String,
    val gridCol: Int,
    val gridRow: Int,
    val floors: List<Floor>
)

data class Floor(
    val number: Int,
    val label: String,
    val rooms: List<Room>
)

data class Room(
    val id: String,
    val name: String,
    val type: RoomType,   // OFFICE | CLASSROOM | CANTEEN | LAB | OTHER
    val bounds: RectF
)

data class MenuItem(
    val name: String,
    val price: Double,
    val category: String,
    val isAvailable: Boolean
)

πŸš€ Getting Started

Prerequisites

  • Android Studio Hedgehog or later
  • Min SDK 24 Β· Target SDK 34
  • Kotlin 1.9+

Installation

# 1. Clone the repository
git clone https://github.com/YOUR_USERNAME/campus-explore.git

# 2. Open in Android Studio
File β†’ Open β†’ select the cloned folder

# 3. Place your campus data
cp your_campus_data.json app/src/main/assets/campus.json

# 4. Build & Run
./gradlew assembleDebug

πŸ“¦ Dependencies

// build.gradle.kts (app)
dependencies {
    // ViewModel & LiveData
    implementation("androidx.lifecycle:lifecycle-viewmodel-ktx:2.7.0")
    implementation("androidx.lifecycle:lifecycle-livedata-ktx:2.7.0")

    // Coroutines
    implementation("org.jetbrains.kotlinx:kotlinx-coroutines-android:1.7.3")

    // JSON parsing
    implementation("com.google.code.gson:gson:2.10.1")

    // Navigation Component
    implementation("androidx.navigation:navigation-fragment-ktx:2.7.6")
    implementation("androidx.navigation:navigation-ui-ktx:2.7.6")

    // RecyclerView
    implementation("androidx.recyclerview:recyclerview:1.3.2")
}

πŸŽ“ About

Built for BMS College of Engineering to help students, staff, and visitors navigate the campus with ease.


Made with ❀️ for BMS College · Bengaluru

About

No description, website, or topics provided.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages