Skip to content
This repository was archived by the owner on Jul 21, 2026. It is now read-only.

Repository files navigation

courseweb_student_prototype

Android app for students to manage modules, resources, and profiles — with a small admin console for user/module management.

Android Kotlin License: MIT Min SDK

✨ Current Features

  • Secure Login

    • Users stored in Room (local DB)
    • Passwords hashed with BCrypt
    • Lightweight Session (username + role)
    • Admin login via BuildConfig (not stored in DB)
  • Admin Console

    • View all users
    • CRUD: Users (hashed password)
    • CRUD: Modules (unique module code)
  • Modules

    • Lookup module details
    • Register / Unregister modules
    • Per-user registrations stored locally
  • Resources

    • Add resources via file picker or Share (implicit intent)
    • Open externally (PDF, links, etc.)
    • Media player for audio/video using Media3/ExoPlayer
  • Profile

    • View username, role, and user ID (for normal users)
  • UX & Navigation

    • Material-styled screens & cards
    • RecyclerViews where it counts (users, registrations, resources)
    • Backward navigation between activities

🧱 Tech Stack

  • Language: Kotlin
  • UI: Material Components
  • Persistence: Room (Users, Modules, Registrations, Resources)
  • Coroutines: viewModelScope (no GlobalScope)
  • Player: AndroidX Media3 (ExoPlayer)
  • Navigation: Activities + fragments (Admin console)
  • Min SDK: 24
  • Target SDK: 33
  • Compile SDK: 36

📱 Screenshots

Login Page Create User Page Users List User CRUD Module CRUD Main Page About Page1 About Page2 Profile Page Module Page Resource Page Video Player Page Music Player Page Book Page Add Resource Page

🗂️ Project Structure (high level)

app/
└─ src/main/java/com/example/courseweb_student/
├─ auth/                 # SessionManager
├─ database/             # Room DBs: User, Module
│   ├─ dao/
│   ├─ entity/
│   └─ repository/
├─ registrations/        # (user, moduleCode) mapping
├─ resources/            # Resource DB + VM + adapter
├─ admin/                # Admin activity + fragments/adapters
├─ about/                # About activity + fragments (Info, Features)
├─ view/                 # ViewModels + factories
└─ ui activities         # Login, Main, Module, Resource, Player, Profile

🔧 Setup & Build

  1. Clone and open in Android Studio (Giraffe+ recommended).
  2. Ensure these in app/build.gradle.kts:
  • compileSdk = 36, minSdk = 24, targetSdk = 33
  • Enable BuildConfig and (optional) ViewBinding:
    android {
        buildFeatures {
            buildConfig = true
            viewBinding = true
        }
    }
  1. Admin credentials (in defaultConfig):
buildConfigField("String", "ADMIN_USERNAME", "\"admin\"")
buildConfigField("String", "ADMIN_PASSWORD", "\"admin123\"")
  1. Key dependencies (already included in the project):
// Core UI
    implementation("androidx.core:core-ktx:1.17.0")
    implementation("androidx.appcompat:appcompat:1.7.1")
    implementation("com.google.android.material:material:1.13.0")
    implementation("androidx.constraintlayout:constraintlayout:2.2.1")
    implementation("androidx.coordinatorlayout:coordinatorlayout:1.3.0") // needed for CoordinatorLayout
    implementation("androidx.fragment:fragment-ktx:1.8.9")               // handy for fragments

    // Activity (pick one; keep KTX)
    implementation("androidx.activity:activity-ktx:1.11.0")
    // REMOVE: implementation("androidx.activity:activity:1.11.0")

    // Navigation (for Admin tabs/host)
    implementation("androidx.navigation:navigation-fragment-ktx:2.9.5")
    implementation("androidx.navigation:navigation-ui-ktx:2.9.5")

    // RecyclerView (you’ll likely need it for Users list)
    implementation("androidx.recyclerview:recyclerview:1.4.0")

    // Lifecycle
    implementation("androidx.lifecycle:lifecycle-viewmodel-ktx:2.9.4")
    implementation("androidx.lifecycle:lifecycle-livedata-ktx:2.9.4")

    // Room + coroutines + bcrypt
    implementation("androidx.room:room-runtime:2.8.2")
    implementation("androidx.room:room-ktx:2.8.2")
    implementation("androidx.activity:activity:1.11.0")
    kapt("androidx.room:room-compiler:2.8.2")
    implementation("org.jetbrains.kotlinx:kotlinx-coroutines-android:1.10.2")
    implementation("at.favre.lib:bcrypt:0.10.2")

    // Tests
    testImplementation("junit:junit:4.13.2")
    androidTestImplementation("androidx.test.ext:junit:1.3.0")
    androidTestImplementation("androidx.test.espresso:espresso-core:3.7.0")

    implementation("androidx.media3:media3-exoplayer:1.8.0")
    implementation("androidx.media3:media3-ui:1.8.0")
    implementation("androidx.viewpager2:viewpager2:1.1.0")
  1. Run on device/emulator. First run will create local databases.

Dev convenience: Room DBs currently use fallbackToDestructiveMigration(false) while schemas settle. Swap to real migrations before release.

🔐 Security Notes

  • User passwords are BCrypt-hashed; raw passwords are never stored.
  • Admin credentials live in BuildConfig for demo/dev. For production, switch to a proper admin identity source (remote or secure provisioning).
  • Resource URIs use Storage Access Framework; we persist read grants when allowed.

🧭 How to Use

  • Login as a user (or as admin using BuildConfig values).
  • Admin Console: manage users and modules.
  • Modules: search by code, register/unregister (your registrations list updates live).
  • Resources: tap + to pick files, or Share from other apps to add.
  • Open uses external apps; Play uses the built-in Media3 player.
  • Profile: see your username, role, and user ID (for users).

🗺️ Roadmap (light)

  • Improve module browsing (full list + filter/chips)
  • Thumbnails/metadata for resources
  • True user Update flow via DAO @Update (ID-based)
  • Optional: dark mode theme

🤝 Contributing

  • PRs welcome. If you’re touching Room schemas, bump DB versions and include a migration (or call out destructive migration if it’s just for dev).

📄 License

  • This project is licensed under the MIT License. See the full text in the app (About → Info) or the LICENSE file.

About

Creating an android app for a courseweb-based system as a prototype for mobile users

Resources

Contributing

Stars

1 star

Watchers

1 watching

Forks

Releases

Packages

Contributors

Languages