Android practice project for the Mobile App Development subject at the Universitat Oberta de Catalunya (UOC).
Academic work. This repository contains a coursework exercise (CAT 5 / PR5), published for reference and portfolio purposes. It is a learning project, not a production application: it deliberately keeps teaching scaffolding, hardcoded sample data and commented-out alternatives so the different approaches taught in the course can be compared side by side.
A small seminar-and-quiz application. The user signs in, sees the list of seminars
they are enrolled in, opens one, and answers its multiple-choice questions. At the
end a dialog reports the score, and a full-score run triggers a celebration
animation. Questions may link to external material, which opens in an in-app
WebView.
Each part of the app exists to exercise a specific unit of the course:
| Area | Where it lives |
|---|---|
| Fragments, transactions and back stack | MainActivity.kt |
| ViewModel + LiveData, shared between fragments | ui/login/ |
| RecyclerView with a custom adapter | SeminarsAdapter.kt |
| Local persistence with SQLite | DbHelper.kt |
| Remote persistence with Cloud Firestore | DataSourceFirebase.kt |
| Push notifications (FCM) | MyFirebaseMessagingService.kt |
| Runtime permissions and geolocation | GetLocation() in MainActivity.kt |
| Property animations and shared-element transitions | Animate() / DetailsTransition in MainActivity.kt |
Activities for result, passing Parcelable data |
AddSeminarActivity.kt |
| Image loading from the network | QuizFragment.kt (Glide) |
| Embedded web content | LinkActivity.kt |
All data access goes through the abstract DataSource, obtained from a factory, so the same UI runs against three interchangeable backends:
Hardcode— in-memory sample data (the current default)Local— SQLite viaDbHelper, seeded with demo users, seminars and questionsRemote— Cloud Firestore, asynchronous through aListenerDatacallback
Change the active one in DataSource.DataSourceFactory.Default.
- Kotlin 1.9.0, Android Gradle Plugin 8.6.0, Gradle 8.11.1
minSdk27,compileSdk/targetSdk34- View binding, AndroidX (AppCompat, Fragment KTX, ConstraintLayout), Material Components
- Firebase BoM 33.5.1 — Firestore, Auth, Messaging, Analytics
- Google Play Services Location
- Glide 4.12.0
You need Android Studio (Ladybug or newer) and an SDK with API 34 installed.
- Clone the repository and open it in Android Studio.
- Add your own
app/google-services.json. It is not committed — see below. - Let Gradle sync, then run the
appconfiguration on a device or emulator with API 27+.
app/google-services.json is intentionally excluded from version control, so the
project will not build until you supply one. Create a Firebase project, register an
Android app with the application ID com.uoc.fragments1, and download the generated
file into app/.
The Firestore-backed data source expects user, seminar, items and user_seminar
collections; the schema and the seed rows the SQLite version uses are visible in
DbHelper.kt and can be
mirrored in Firestore.
Firebase Cloud Messaging is only needed for the push-notification exercise; without it the rest of the app still runs.
With the default Hardcode data source, user1@uoc.com and user2@uoc.com are
accepted. The SQLite seed data uses the same addresses with the password 123456.
These are throwaway course fixtures, not real accounts.
app/src/main/java/com/uoc/pr1/
├── MainActivity.kt # host activity, fragment orchestration, location, animations
├── AddSeminarActivity.kt # add-seminar form, returns a Parcelable result
├── LinkActivity.kt # WebView for external material
├── MyFirebaseMessagingService.kt# incoming push messages
├── data/
│ ├── DataSource.kt # abstract source + factory
│ ├── DataSourceHardcode.kt # in-memory
│ ├── DataSourceLocal.kt # SQLite
│ ├── DataSourceFirebase.kt # Firestore
│ ├── localstorage/DbHelper.kt # schema and seed data
│ └── model/ # User, Seminary, Item
└── ui/
├── login/ # LoginFragment + ViewModel
├── listSeminars/ # seminar list and adapter
└── quiz/ # question flow and scoring
Coursework submitted for evaluation at UOC. Published as-is for reference; feel free to read it, but if you are taking the same subject, please write your own.