{"id":23499641,"url":"https://github.com/syedpiyal/roomdatabasecontactsapp","last_synced_at":"2026-04-26T22:31:29.941Z","repository":{"id":264625414,"uuid":"893894611","full_name":"SyedPiyal/RoomDatabaseContactsApp","owner":"SyedPiyal","description":"An Android app demonstrating the use of Room Database for managing a simple contact list with Kotlin Coroutines and LiveData.","archived":false,"fork":false,"pushed_at":"2024-11-25T11:55:25.000Z","size":43,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-04-23T19:14:21.807Z","etag":null,"topics":["android-application","coroutines","kotlin","roomdatabase"],"latest_commit_sha":null,"homepage":"","language":"Kotlin","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/SyedPiyal.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2024-11-25T11:52:38.000Z","updated_at":"2024-11-25T12:03:22.000Z","dependencies_parsed_at":"2024-11-25T15:46:23.801Z","dependency_job_id":null,"html_url":"https://github.com/SyedPiyal/RoomDatabaseContactsApp","commit_stats":null,"previous_names":["syedpiyal/roomdatabasecontactsapp"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/SyedPiyal%2FRoomDatabaseContactsApp","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/SyedPiyal%2FRoomDatabaseContactsApp/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/SyedPiyal%2FRoomDatabaseContactsApp/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/SyedPiyal%2FRoomDatabaseContactsApp/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/SyedPiyal","download_url":"https://codeload.github.com/SyedPiyal/RoomDatabaseContactsApp/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":250496992,"owners_count":21440231,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["android-application","coroutines","kotlin","roomdatabase"],"created_at":"2024-12-25T06:18:05.105Z","updated_at":"2026-04-26T22:31:29.910Z","avatar_url":"https://github.com/SyedPiyal.png","language":"Kotlin","funding_links":[],"categories":[],"sub_categories":[],"readme":"# RoomDatabaseContactsApp\n\nThis is an Android application that demonstrates how to use **Room Database** with **Kotlin Coroutines** to manage a simple contact list. The app allows users to add, update, delete, and retrieve contacts using Room persistence library.\n\n## Features\n\n- **Room Database** to persist contact data.\n- **Kotlin Coroutines** for background operations (inserting, updating, deleting).\n- **LiveData** to observe changes in the database and update the UI automatically.\n- Simple contact management UI with a button to fetch all contacts.\n- **Edge-to-Edge** design support (using `ViewCompat` for proper padding on modern devices).\n\n## Architecture\n\n- **Room Database**: A local database to store contact details like name and phone number.\n- **Dao (Data Access Object)**: Interface to define methods for database operations such as inserting, updating, deleting, and querying contacts.\n- **LiveData**: Used to observe the data from the database and update the UI accordingly.\n- **Coroutines**: Used for performing long-running database operations in the background to ensure smooth performance.\n\n## Setup Instructions\n\n1. Clone the repository:\n\n    ```bash\n    git clone https://github.com/yourusername/RoomDatabaseContactsApp.git\n    ```\n\n2. Open the project in **Android Studio**.\n\n3. Make sure you have **Kotlin** and **Room dependencies** included in your `build.gradle` files:\n\n    - In your `app/build.gradle`:\n\n      ```gradle\n      dependencies {\n          implementation(libs.androidx.room.runtime)\n          ksp(\"androidx.room:room-compiler:2.5.0\")\n          implementation(libs.androidx.room.ktx)\n          implementation(libs.kotlinx.coroutines.core)\n          implementation(libs.kotlinx.coroutines.android)\n      }\n      ```\n\n4. Sync the project with Gradle.\n\n5. Run the app on an emulator or physical device.\n\n## Code Explanation\n\n### Room Database\n\nThe `ContactDatabase` class is a singleton class that provides access to the Room database. It uses `@Database` annotation to define the entities (Contact table) and database version.\n\n```kotlin\n@Database(entities = [Contact::class], version = 1)\nabstract class ContactDatabase : RoomDatabase() {\n    abstract fun contactDao(): ContactDao\n}\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsyedpiyal%2Froomdatabasecontactsapp","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsyedpiyal%2Froomdatabasecontactsapp","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsyedpiyal%2Froomdatabasecontactsapp/lists"}