{"id":87546,"date":"2023-04-24T10:37:34","date_gmt":"2023-04-24T05:07:34","guid":{"rendered":"https:\/\/techvidvan.com\/tutorials\/?p=87546"},"modified":"2023-04-24T10:37:34","modified_gmt":"2023-04-24T05:07:34","slug":"android-car-pooling-application","status":"publish","type":"post","link":"https:\/\/techvidvan.com\/tutorials\/android-car-pooling-application\/","title":{"rendered":"Android Car Pooling Application &#8211; Share the Ride, Share the Love"},"content":{"rendered":"<p>Today we are going to see and learn to implement an Android Project that is a Car-Pooling App in android studio. We\u2019ll understand the complete project development in this article.<\/p>\n<p>Instead of driving separately to the same places, carpooling will enable users to travel together.<\/p>\n<h3>Features of Android Car Pooling Application<\/h3>\n<p>Users will find it simpler and more comfortable to look for rides according to their intended destinations with the aid of this application. Users of the carpooling application will be able to add new rides by providing the necessary information.<\/p>\n<p>The application will allow every other user that accesses it to view and search for the rides according to their source and destination.<\/p>\n<h3>About Android Car Pooling Application<\/h3>\n<p>It will be advantageous for beginners to learn about app development using kotlin and firebase by creating this project from scratch. You will become accustomed to using Android Studio and Firebase while the app is developed.<\/p>\n<p>A new ride can be added to the carpooling app, and other passengers can search for the rides that are already listed in the database. Details about the user interface are as follows:<\/p>\n<ol>\n<li>The user interface will have two buttons to add a new ride and search for rides respectively.<\/li>\n<li>When the \u2018Add new ride\u2019 button is clicked, UI will consist of various fields for the user to enter information necessary for adding a new ride.<\/li>\n<li>The entered information about the new ride will be saved onto the database when \u2018Save Data\u2019 button clicked.<\/li>\n<li>On the home screen, if the \u2018Search Ride\u2019 button is clicked, it will navigate to a screen containing a list of rides stored on the database.<\/li>\n<li>User interface will have the source and destination for each ride displayed on the screen.<\/li>\n<li>When the user clicks on a specific ride, details about that particular ride will be displayed on the screen.<\/li>\n<\/ol>\n<h3>Prerequisites for Car Pooling Application using Android<\/h3>\n<p>To develop this android application the requirements and prerequisites are as follows:<\/p>\n<ol>\n<li><strong>Kotlin:<\/strong> You need first be familiar with Kotlin programming. Given that we will write the app code in the programming language Kotlin, it is necessary.<\/li>\n<li><strong>XML:<\/strong> Another crucial component of our Android application is XML. It will be applied to the development of the application&#8217;s user interface.<\/li>\n<li><strong>Android Studio:<\/strong> The core of our application is Android Studio because that is how we will develop it. Also included with Android Studio is an Android virtual device that can be used to test the functionality of applications.<\/li>\n<\/ol>\n<h3>Download Android Car Pooling Application Project<\/h3>\n<p>Please download the source code of Android Car Pooling Application Project from the following link:<a href=\"https:\/\/techvidvan.s3.amazonaws.com\/android-projects\/kotlin\/CarPoolingTechVidvan.zip\"> <strong>Android Car Pooling Application Project Code<\/strong><\/a><\/p>\n<h3>Steps to Create Car Pooling Application Project using Android<\/h3>\n<p>We&#8217;ll now start working on developing a car-pooling app. Before putting the code into practice, we will learn about its purpose and function throughout this article. So let&#8217;s look at the files and functions needed to run the code:<\/p>\n<p>You must complete a set of steps in order to create this android car-pooling application. We are here to walk you through every stage of developing an app.<\/p>\n<ol>\n<li>Extract all the files from the downloaded zip file to the location of your choice.<\/li>\n<li>Open Android Studio.<\/li>\n<li>Click on File then Open.<\/li>\n<li>Find and select the folder you extracted earlier and click on OK.<\/li>\n<\/ol>\n<p>You have successfully opened the reminder app\u2019s source code in android studio.<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-87628\" src=\"https:\/\/techvidvan.com\/tutorials\/wp-content\/uploads\/sites\/2\/2023\/04\/android-studio.webp\" alt=\"android studio\" width=\"1920\" height=\"1035\" \/><\/p>\n<p>Let&#8217;s go through each file in this project one at a time as we comprehend how the application works.<\/p>\n<p>1. The \u201cactivity_main\u201d is a XML file which is responsible for creating the buttons and textviews of the home screen.<\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\">&lt;?xml version=\"1.0\" encoding=\"utf-8\"?&gt;\n&lt;androidx.constraintlayout.widget.ConstraintLayout xmlns:android=\"http:\/\/schemas.android.com\/apk\/res\/android\"\n    xmlns:app=\"http:\/\/schemas.android.com\/apk\/res-auto\"\n    xmlns:tools=\"http:\/\/schemas.android.com\/tools\"\n    android:layout_width=\"match_parent\"\n    android:layout_height=\"match_parent\"\n    tools:context=\".MainActivity\"&gt;\n\n    &lt;TextView\n        android:id=\"@+id\/textView\"\n        android:layout_width=\"wrap_content\"\n        android:layout_height=\"wrap_content\"\n        android:text=\"Car Pooling Application\"\n        android:layout_marginTop=\"200dp\"\n        android:textSize=\"28sp\"\n        android:gravity=\"center\"\n        android:textStyle=\"bold\"\n        app:layout_constraintEnd_toEndOf=\"parent\"\n        app:layout_constraintStart_toStartOf=\"parent\"\n        app:layout_constraintTop_toTopOf=\"parent\" \/&gt;\n\n    &lt;TextView\n        android:id=\"@+id\/textView1\"\n        android:layout_width=\"wrap_content\"\n        android:layout_height=\"wrap_content\"\n        android:text=\"TechVidvan\"\n        android:layout_marginTop=\"10dp\"\n        android:textSize=\"20sp\"\n        android:gravity=\"center\"\n        android:textStyle=\"bold\"\n        app:layout_constraintEnd_toEndOf=\"parent\"\n        app:layout_constraintStart_toStartOf=\"parent\"\n        app:layout_constraintTop_toBottomOf=\"@+id\/textView\"\/&gt;\n\n    &lt;Button\n        android:id=\"@+id\/btnInsertData\"\n        android:layout_width=\"wrap_content\"\n        android:layout_height=\"wrap_content\"\n        android:text=\"Add new ride\"\n        android:layout_marginTop=\"90dp\"\n        app:layout_constraintEnd_toEndOf=\"parent\"\n        app:layout_constraintStart_toStartOf=\"parent\"\n        app:layout_constraintTop_toBottomOf=\"@+id\/textView\" \/&gt;\n\n    &lt;Button\n        android:id=\"@+id\/btnFetchData\"\n        android:layout_width=\"wrap_content\"\n        android:layout_height=\"wrap_content\"\n        android:layout_marginTop=\"25dp\"\n        android:text=\"Search Ride\"\n        app:layout_constraintEnd_toEndOf=\"parent\"\n        app:layout_constraintStart_toStartOf=\"parent\"\n        app:layout_constraintTop_toBottomOf=\"@+id\/btnInsertData\" \/&gt;\n\n&lt;\/androidx.constraintlayout.widget.ConstraintLayout&gt;<\/pre>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-87629\" src=\"https:\/\/techvidvan.com\/tutorials\/wp-content\/uploads\/sites\/2\/2023\/04\/activity-mainxml-.webp\" alt=\"activity main(xml)\" width=\"1919\" height=\"1032\" \/><\/p>\n<p>2. The \u201cactivity insertion\u201d is a XML file which is responsible for creating the edit textviews that will allow the users to enter necessary information for adding a new ride along with the save button at the bottom of the form.<\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\">&lt;?xml version=\"1.0\" encoding=\"utf-8\"?&gt;\n&lt;androidx.constraintlayout.widget.ConstraintLayout xmlns:android=\"http:\/\/schemas.android.com\/apk\/res\/android\"\n    xmlns:app=\"http:\/\/schemas.android.com\/apk\/res-auto\"\n    xmlns:tools=\"http:\/\/schemas.android.com\/tools\"\n    android:layout_width=\"match_parent\"\n    android:layout_height=\"match_parent\"\n    android:padding=\"16dp\"\n    tools:context=\".InsertionActivity\"&gt;\n\n    &lt;EditText\n        android:id=\"@+id\/etName\"\n        android:layout_width=\"0dp\"\n        android:layout_height=\"wrap_content\"\n        android:layout_marginTop=\"50dp\"\n        android:ems=\"10\"\n        android:inputType=\"textPersonName\"\n        android:hint=\"Rider's Name\"\n        app:layout_constraintEnd_toEndOf=\"parent\"\n        app:layout_constraintStart_toStartOf=\"parent\"\n        app:layout_constraintTop_toTopOf=\"parent\" \/&gt;\n\n    &lt;EditText\n        android:id=\"@+id\/etSource\"\n        android:layout_width=\"0dp\"\n        android:layout_height=\"wrap_content\"\n        android:layout_marginTop=\"20dp\"\n        android:ems=\"10\"\n        android:inputType=\"textPersonName\"\n        android:hint=\"Enter Source\"\n        app:layout_constraintEnd_toEndOf=\"parent\"\n        app:layout_constraintStart_toStartOf=\"parent\"\n        app:layout_constraintTop_toBottomOf=\"@+id\/etName\"\/&gt;\n\n    &lt;EditText\n        android:id=\"@+id\/etDestination\"\n        android:layout_width=\"0dp\"\n        android:layout_height=\"wrap_content\"\n        android:layout_marginTop=\"20dp\"\n        android:ems=\"10\"\n        android:inputType=\"textPersonName\"\n        android:hint=\"Enter Destination\"\n        app:layout_constraintEnd_toEndOf=\"parent\"\n        app:layout_constraintStart_toStartOf=\"parent\"\n        app:layout_constraintTop_toBottomOf=\"@+id\/etSource\" \/&gt;\n\n    &lt;EditText\n        android:id=\"@+id\/etTotalPassengers\"\n        android:layout_width=\"0dp\"\n        android:layout_height=\"wrap_content\"\n        android:layout_marginTop=\"20dp\"\n        android:ems=\"10\"\n        android:inputType=\"textPersonName\"\n        android:hint=\"Total Passengers\"\n        app:layout_constraintEnd_toEndOf=\"parent\"\n        app:layout_constraintStart_toStartOf=\"parent\"\n        app:layout_constraintTop_toBottomOf=\"@+id\/etDestination\" \/&gt;\n\n    &lt;EditText\n        android:id=\"@+id\/etPrice\"\n        android:layout_width=\"0dp\"\n        android:layout_height=\"wrap_content\"\n        android:layout_marginTop=\"20dp\"\n        android:ems=\"10\"\n        android:inputType=\"textPersonName\"\n        android:hint=\"Price per passenger\"\n        app:layout_constraintEnd_toEndOf=\"parent\"\n        app:layout_constraintStart_toStartOf=\"parent\"\n        app:layout_constraintTop_toBottomOf=\"@+id\/etTotalPassengers\" \/&gt;\n\n    &lt;EditText\n        android:id=\"@+id\/etContact\"\n        android:layout_width=\"0dp\"\n        android:layout_height=\"wrap_content\"\n        android:layout_marginTop=\"20dp\"\n        android:ems=\"10\"\n        android:inputType=\"textPersonName\"\n        android:hint=\"Contact No.\"\n        app:layout_constraintEnd_toEndOf=\"parent\"\n        app:layout_constraintStart_toStartOf=\"parent\"\n        app:layout_constraintTop_toBottomOf=\"@+id\/etPrice\" \/&gt;\n\n    &lt;EditText\n        android:id=\"@+id\/etDate\"\n        android:layout_width=\"0dp\"\n        android:layout_height=\"wrap_content\"\n        android:layout_marginTop=\"20dp\"\n        android:ems=\"10\"\n        android:inputType=\"textPersonName\"\n        android:hint=\"Ride Date (DD-MM-YY)\"\n        app:layout_constraintEnd_toEndOf=\"parent\"\n        app:layout_constraintStart_toStartOf=\"parent\"\n        app:layout_constraintTop_toBottomOf=\"@+id\/etContact\" \/&gt;\n\n    &lt;EditText\n        android:id=\"@+id\/etTime\"\n        android:layout_width=\"0dp\"\n        android:layout_height=\"wrap_content\"\n        android:layout_marginTop=\"20dp\"\n        android:ems=\"10\"\n        android:inputType=\"textPersonName\"\n        android:hint=\"Time (HH:MM am\/pm)\"\n        app:layout_constraintEnd_toEndOf=\"parent\"\n        app:layout_constraintStart_toStartOf=\"parent\"\n        app:layout_constraintTop_toBottomOf=\"@+id\/etDate\" \/&gt;\n\n    &lt;Button\n        android:id=\"@+id\/btnSave\"\n        android:layout_width=\"wrap_content\"\n        android:layout_height=\"wrap_content\"\n        android:layout_marginTop=\"32dp\"\n        android:text=\"Save Data\"\n        app:layout_constraintEnd_toEndOf=\"parent\"\n        app:layout_constraintStart_toStartOf=\"parent\"\n        app:layout_constraintTop_toBottomOf=\"@+id\/etTime\" \/&gt;\n&lt;\/androidx.constraintlayout.widget.ConstraintLayout&gt;\n<\/pre>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-87630\" src=\"https:\/\/techvidvan.com\/tutorials\/wp-content\/uploads\/sites\/2\/2023\/04\/activity-insertionxml-.webp\" alt=\"activity insertion(xml)\" width=\"1920\" height=\"1032\" \/><\/p>\n<p>3. The \u201cactivity_fetching\u201d is a XML file containing a recycler view which is responsible for creating the textviews displaying source and destination for each ride stored in the database.<\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\">&lt;?xml version=\"1.0\" encoding=\"utf-8\"?&gt;\n&lt;androidx.constraintlayout.widget.ConstraintLayout xmlns:android=\"http:\/\/schemas.android.com\/apk\/res\/android\"\n    xmlns:app=\"http:\/\/schemas.android.com\/apk\/res-auto\"\n    xmlns:tools=\"http:\/\/schemas.android.com\/tools\"\n    android:layout_width=\"match_parent\"\n    android:layout_height=\"match_parent\"\n    tools:context=\".FetchingActivity\"&gt;\n\n  &lt;androidx.recyclerview.widget.RecyclerView\n      android:id=\"@+id\/rvRide\"\n      android:layout_width=\"match_parent\"\n      android:layout_height=\"match_parent\"\n      android:layout_marginStart=\"1dp\"\n      android:layout_marginTop=\"1dp\"\n      android:layout_marginEnd=\"1dp\"\n      android:layout_marginBottom=\"1dp\"\n      tools:listitem=\"@layout\/ride_list_item\"\n      app:layout_constraintBottom_toBottomOf=\"parent\"\n      app:layout_constraintEnd_toEndOf=\"parent\"\n      app:layout_constraintStart_toStartOf=\"parent\"\n      app:layout_constraintTop_toTopOf=\"parent\" \/&gt;\n\n  &lt;TextView\n      android:id=\"@+id\/tvLoadingData\"\n      android:layout_width=\"wrap_content\"\n      android:layout_height=\"wrap_content\"\n      android:text=\"Loading Data.....\"\n      android:textSize=\"28sp\"\n      android:textColor=\"@color\/black\"\n      android:textStyle=\"bold\"\n      android:visibility=\"gone\"\n      app:layout_constraintBottom_toBottomOf=\"parent\"\n      app:layout_constraintEnd_toEndOf=\"parent\"\n      app:layout_constraintStart_toStartOf=\"parent\"\n      app:layout_constraintTop_toTopOf=\"parent\" \/&gt;\n\n&lt;\/androidx.constraintlayout.widget.ConstraintLayout&gt;<\/pre>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-87631\" src=\"https:\/\/techvidvan.com\/tutorials\/wp-content\/uploads\/sites\/2\/2023\/04\/activity-fetchingxml-.webp\" alt=\"activity fetching(xml)\" width=\"1920\" height=\"1041\" \/><\/p>\n<p>4. The \u201cride_list_item\u201d is a XML file containing a card view which is used in the above activity_fetching.xml\u2019s recycler view.<\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\">&lt;?xml version=\"1.0\" encoding=\"utf-8\"?&gt;\n&lt;androidx.cardview.widget.CardView xmlns:android=\"http:\/\/schemas.android.com\/apk\/res\/android\"\n    android:layout_width=\"match_parent\"\n    android:layout_height=\"wrap_content\"\n    xmlns:app=\"http:\/\/schemas.android.com\/apk\/res-auto\"\n    app:cardElevation=\"8dp\"\n    app:cardCornerRadius=\"8dp\"\n    android:layout_margin=\"8dp\"&gt;\n\n    &lt;LinearLayout\n        android:layout_width=\"wrap_content\"\n        android:layout_height=\"wrap_content\"\n        android:gravity=\"center\"\n        android:padding=\"16dp\"\n        android:layout_gravity=\"center\"\n        android:orientation=\"horizontal\"&gt;\n\n        &lt;LinearLayout\n            android:layout_width=\"wrap_content\"\n            android:layout_height=\"wrap_content\"\n            android:layout_gravity=\"center_vertical\"\n            android:orientation=\"vertical\"&gt;\n\n            &lt;TextView\n                android:layout_width=\"wrap_content\"\n                android:layout_height=\"wrap_content\"\n                android:text=\"Source:\"\n                android:layout_gravity=\"center\"\n                android:gravity=\"center\"\n                android:textColor=\"@color\/black\"\n                android:textSize=\"22sp\"\n                android:textStyle=\"bold\"\/&gt;\n\n            &lt;TextView\n                android:layout_width=\"wrap_content\"\n                android:layout_height=\"wrap_content\"\n                android:text=\"Destination :\"\n                android:layout_gravity=\"center\"\n                android:gravity=\"center\"\n                android:textColor=\"@color\/black\"\n                android:textSize=\"22sp\"\n                android:textStyle=\"bold\"\/&gt;\n\n\n        &lt;\/LinearLayout&gt;\n\n        &lt;LinearLayout\n            android:layout_width=\"wrap_content\"\n            android:layout_height=\"wrap_content\"\n            android:layout_gravity=\"center_vertical\"\n            android:orientation=\"vertical\"&gt;\n\n            &lt;TextView\n                android:id=\"@+id\/tvSource\"\n                android:layout_width=\"wrap_content\"\n                android:layout_height=\"wrap_content\"\n                android:text=\"Source\"\n                android:layout_gravity=\"center\"\n                android:gravity=\"center\"\n                android:layout_marginLeft=\"2dp\"\n                android:textColor=\"@color\/black\"\n                android:textSize=\"25sp\"\/&gt;\n\n            &lt;TextView\n                android:id=\"@+id\/tvDestination\"\n                android:layout_width=\"wrap_content\"\n                android:layout_height=\"wrap_content\"\n                android:text=\"Destination\"\n                android:layout_gravity=\"center\"\n                android:layout_marginLeft=\"2dp\"\n                android:gravity=\"center\"\n                android:textColor=\"@color\/black\"\n                android:textSize=\"25sp\"\/&gt;\n\n\n        &lt;\/LinearLayout&gt;\n\n    &lt;\/LinearLayout&gt;\n\n&lt;\/androidx.cardview.widget.CardView&gt;<\/pre>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-87632\" src=\"https:\/\/techvidvan.com\/tutorials\/wp-content\/uploads\/sites\/2\/2023\/04\/ride-list-itemxml-.webp\" alt=\"ride list item(xml)\" width=\"1920\" height=\"1029\" \/><\/p>\n<p>5. The \u201cactivity_ride_details\u201d is a XML file which is responsible for creating the textviews that will contain the details about the respective ride.<\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\">&lt;?xml version=\"1.0\" encoding=\"utf-8\"?&gt;\n&lt;androidx.constraintlayout.widget.ConstraintLayout xmlns:android=\"http:\/\/schemas.android.com\/apk\/res\/android\"\n    xmlns:app=\"http:\/\/schemas.android.com\/apk\/res-auto\"\n    xmlns:tools=\"http:\/\/schemas.android.com\/tools\"\n    android:layout_width=\"match_parent\"\n    android:layout_height=\"match_parent\"\n    tools:context=\".RideDetailsActivity\"&gt;\n\n    &lt;LinearLayout\n        android:id=\"@+id\/linearLayout\"\n        android:layout_width=\"match_parent\"\n        android:layout_height=\"wrap_content\"\n        app:layout_constraintStart_toStartOf=\"parent\"\n        app:layout_constraintTop_toTopOf=\"parent\"\n        app:layout_constraintEnd_toEndOf=\"parent\"\n        android:orientation=\"vertical\"&gt;\n\n\n        &lt;LinearLayout\n            android:id=\"@+id\/id_lin\"\n            android:layout_width=\"match_parent\"\n            android:layout_height=\"30dp\"\n            android:layout_marginLeft=\"10dp\"\n            android:layout_marginTop=\"20dp\"\n            android:layout_marginRight=\"10dp\"\n            android:orientation=\"horizontal\"\n            android:weightSum=\"2\"&gt;\n\n            &lt;LinearLayout\n                android:layout_width=\"0dp\"\n                android:layout_height=\"match_parent\"\n                android:layout_weight=\"0.6\"\n                android:background=\"@color\/white1\"&gt;\n\n                &lt;TextView\n                    android:layout_width=\"match_parent\"\n                    android:layout_height=\"wrap_content\"\n                    android:layout_gravity=\"center\"\n                    android:gravity=\"center\"\n                    android:text=\"Rider's Name\"\n                    android:textColor=\"@color\/black\"\n                    android:textSize=\"15sp\" \/&gt;\n\n            &lt;\/LinearLayout&gt;\n\n            &lt;LinearLayout\n                android:layout_width=\"0dp\"\n                android:layout_height=\"match_parent\"\n                android:layout_weight=\"1.4\"&gt;\n\n                &lt;TextView\n                    android:id=\"@+id\/tvName\"\n                    android:layout_width=\"match_parent\"\n                    android:layout_height=\"wrap_content\"\n                    android:layout_gravity=\"center\"\n                    android:gravity=\"center\"\n                    android:text=\"\"\n                    android:textColor=\"@color\/black\"\n                    android:textSize=\"20sp\"\n\n                    \/&gt;\n\n            &lt;\/LinearLayout&gt;\n\n\n        &lt;\/LinearLayout&gt;\n\n\n        &lt;LinearLayout\n            android:id=\"@+id\/contact_lin\"\n            android:layout_width=\"match_parent\"\n            android:layout_height=\"40dp\"\n            android:layout_marginLeft=\"10dp\"\n            android:layout_marginRight=\"10dp\"\n            android:orientation=\"horizontal\"\n            android:weightSum=\"2\"&gt;\n\n            &lt;LinearLayout\n                android:layout_width=\"0dp\"\n                android:layout_height=\"match_parent\"\n                android:layout_weight=\"0.6\"\n                android:background=\"@color\/white1\"&gt;\n\n                &lt;TextView\n                    android:layout_width=\"match_parent\"\n                    android:layout_height=\"wrap_content\"\n                    android:layout_gravity=\"center\"\n                    android:gravity=\"center\"\n                    android:text=\"Source\"\n                    android:textColor=\"@color\/black\"\n                    android:textSize=\"15sp\" \/&gt;\n\n            &lt;\/LinearLayout&gt;\n\n            &lt;LinearLayout\n                android:layout_width=\"0dp\"\n                android:layout_height=\"match_parent\"\n                android:layout_weight=\"1.4\"&gt;\n\n                &lt;TextView\n                    android:id=\"@+id\/tvSource\"\n                    android:layout_width=\"match_parent\"\n                    android:layout_height=\"wrap_content\"\n                    android:layout_gravity=\"center\"\n                    android:gravity=\"center\"\n                    android:text=\"\"\n                    android:textColor=\"@color\/black\"\n                    android:textSize=\"20sp\"\n\n                    \/&gt;\n\n            &lt;\/LinearLayout&gt;\n\n\n        &lt;\/LinearLayout&gt;\n\n        &lt;LinearLayout\n\n            android:layout_width=\"match_parent\"\n            android:layout_height=\"40dp\"\n            android:layout_marginLeft=\"10dp\"\n            android:layout_marginRight=\"10dp\"\n            android:orientation=\"horizontal\"\n            android:weightSum=\"2\"\n\n            &gt;\n\n            &lt;LinearLayout\n                android:layout_width=\"0dp\"\n                android:layout_height=\"match_parent\"\n                android:layout_weight=\"0.6\"\n                android:background=\"@color\/white1\"&gt;\n\n                &lt;TextView\n                    android:layout_width=\"match_parent\"\n                    android:layout_height=\"wrap_content\"\n                    android:layout_gravity=\"center\"\n                    android:gravity=\"center\"\n                    android:text=\"Destination\"\n                    android:textColor=\"@color\/black\"\n                    android:textSize=\"15sp\"\n\n\n                    \/&gt;\n\n            &lt;\/LinearLayout&gt;\n\n            &lt;LinearLayout\n                android:layout_width=\"0dp\"\n                android:layout_height=\"match_parent\"\n                android:layout_weight=\"1.4\"&gt;\n\n                &lt;TextView\n                    android:id=\"@+id\/tvDestination\"\n                    android:layout_width=\"match_parent\"\n                    android:layout_height=\"wrap_content\"\n                    android:layout_gravity=\"center\"\n                    android:gravity=\"center\"\n                    android:text=\"\"\n                    android:textColor=\"@color\/black\"\n                    android:textSize=\"20sp\"\n\n                    \/&gt;\n\n            &lt;\/LinearLayout&gt;\n\n\n        &lt;\/LinearLayout&gt;\n\n\n        &lt;LinearLayout\n\n            android:layout_width=\"match_parent\"\n            android:layout_height=\"40dp\"\n            android:layout_marginLeft=\"10dp\"\n            android:layout_marginRight=\"10dp\"\n            android:orientation=\"horizontal\"\n            android:weightSum=\"2\"\n\n            &gt;\n\n            &lt;LinearLayout\n                android:layout_width=\"0dp\"\n                android:layout_height=\"match_parent\"\n                android:layout_weight=\"0.6\"\n                android:background=\"@color\/white1\"&gt;\n\n                &lt;TextView\n                    android:layout_width=\"match_parent\"\n                    android:layout_height=\"wrap_content\"\n                    android:layout_gravity=\"center\"\n\n                    android:gravity=\"center\"\n                    android:text=\"Total passengers\"\n                    android:textColor=\"@color\/black\"\n                    android:textSize=\"15sp\"\n\n\n                    \/&gt;\n\n            &lt;\/LinearLayout&gt;\n\n            &lt;LinearLayout\n                android:layout_width=\"0dp\"\n                android:layout_height=\"match_parent\"\n                android:layout_weight=\"1.4\"&gt;\n\n                &lt;TextView\n                    android:id=\"@+id\/tvTotal\"\n                    android:layout_width=\"match_parent\"\n                    android:layout_height=\"wrap_content\"\n                    android:layout_gravity=\"center\"\n                    android:gravity=\"center\"\n                    android:text=\"\"\n                    android:textColor=\"@color\/black\"\n                    android:textSize=\"20sp\"\n\n                    \/&gt;\n\n            &lt;\/LinearLayout&gt;\n\n\n        &lt;\/LinearLayout&gt;\n\n        &lt;LinearLayout\n\n            android:layout_width=\"match_parent\"\n            android:layout_height=\"40dp\"\n            android:layout_marginLeft=\"10dp\"\n            android:layout_marginRight=\"10dp\"\n            android:orientation=\"horizontal\"\n            android:weightSum=\"2\"\n\n            &gt;\n\n            &lt;LinearLayout\n                android:layout_width=\"0dp\"\n                android:layout_height=\"match_parent\"\n                android:layout_weight=\"0.6\"\n                android:background=\"@color\/white1\"&gt;\n\n                &lt;TextView\n                    android:layout_width=\"match_parent\"\n                    android:layout_height=\"wrap_content\"\n                    android:layout_gravity=\"center\"\n\n                    android:gravity=\"center\"\n                    android:text=\"Price per passenger\"\n                    android:textColor=\"@color\/black\"\n                    android:textSize=\"15sp\"\n\n\n                    \/&gt;\n\n            &lt;\/LinearLayout&gt;\n\n            &lt;LinearLayout\n                android:layout_width=\"0dp\"\n                android:layout_height=\"match_parent\"\n                android:layout_weight=\"1.4\"&gt;\n\n                &lt;TextView\n                    android:id=\"@+id\/tvPrice\"\n                    android:layout_width=\"match_parent\"\n                    android:layout_height=\"wrap_content\"\n                    android:layout_gravity=\"center\"\n                    android:gravity=\"center\"\n                    android:text=\"\"\n                    android:textColor=\"@color\/black\"\n                    android:textSize=\"20sp\"\n\n                    \/&gt;\n\n            &lt;\/LinearLayout&gt;\n\n\n        &lt;\/LinearLayout&gt;\n\n        &lt;LinearLayout\n\n            android:layout_width=\"match_parent\"\n            android:layout_height=\"40dp\"\n            android:layout_marginLeft=\"10dp\"\n            android:layout_marginRight=\"10dp\"\n            android:orientation=\"horizontal\"\n            android:weightSum=\"2\"\n\n            &gt;\n\n            &lt;LinearLayout\n                android:layout_width=\"0dp\"\n                android:layout_height=\"match_parent\"\n                android:layout_weight=\"0.6\"\n                android:background=\"@color\/white1\"&gt;\n\n                &lt;TextView\n                    android:layout_width=\"match_parent\"\n                    android:layout_height=\"wrap_content\"\n                    android:layout_gravity=\"center\"\n\n                    android:gravity=\"center\"\n                    android:text=\"Contact\"\n                    android:textColor=\"@color\/black\"\n                    android:textSize=\"15sp\"\n\n\n                    \/&gt;\n\n            &lt;\/LinearLayout&gt;\n\n            &lt;LinearLayout\n                android:layout_width=\"0dp\"\n                android:layout_height=\"match_parent\"\n                android:layout_weight=\"1.4\"&gt;\n\n                &lt;TextView\n                    android:id=\"@+id\/tvContact\"\n                    android:layout_width=\"match_parent\"\n                    android:layout_height=\"wrap_content\"\n                    android:layout_gravity=\"center\"\n                    android:gravity=\"center\"\n                    android:text=\"\"\n                    android:textColor=\"@color\/black\"\n                    android:textSize=\"20sp\"\n\n                    \/&gt;\n\n            &lt;\/LinearLayout&gt;\n\n        &lt;\/LinearLayout&gt;\n\n        &lt;LinearLayout\n\n            android:layout_width=\"match_parent\"\n            android:layout_height=\"40dp\"\n            android:layout_marginLeft=\"10dp\"\n            android:layout_marginRight=\"10dp\"\n            android:orientation=\"horizontal\"\n            android:weightSum=\"2\"\n\n            &gt;\n\n            &lt;LinearLayout\n                android:layout_width=\"0dp\"\n                android:layout_height=\"match_parent\"\n                android:layout_weight=\"0.6\"\n                android:background=\"@color\/white1\"&gt;\n\n                &lt;TextView\n                    android:layout_width=\"match_parent\"\n                    android:layout_height=\"wrap_content\"\n                    android:layout_gravity=\"center\"\n\n                    android:gravity=\"center\"\n                    android:text=\"Date\"\n                    android:textColor=\"@color\/black\"\n                    android:textSize=\"15sp\"\n\n\n                    \/&gt;\n\n            &lt;\/LinearLayout&gt;\n\n            &lt;LinearLayout\n                android:layout_width=\"0dp\"\n                android:layout_height=\"match_parent\"\n                android:layout_weight=\"1.4\"&gt;\n\n                &lt;TextView\n                    android:id=\"@+id\/tvDate\"\n                    android:layout_width=\"match_parent\"\n                    android:layout_height=\"wrap_content\"\n                    android:layout_gravity=\"center\"\n                    android:gravity=\"center\"\n                    android:text=\"\"\n                    android:textColor=\"@color\/black\"\n                    android:textSize=\"20sp\"\n\n                    \/&gt;\n\n            &lt;\/LinearLayout&gt;\n\n\n        &lt;\/LinearLayout&gt;\n\n        &lt;LinearLayout\n\n            android:layout_width=\"match_parent\"\n            android:layout_height=\"40dp\"\n            android:layout_marginLeft=\"10dp\"\n            android:layout_marginRight=\"10dp\"\n            android:orientation=\"horizontal\"\n            android:weightSum=\"2\"\n\n            &gt;\n\n            &lt;LinearLayout\n                android:layout_width=\"0dp\"\n                android:layout_height=\"match_parent\"\n                android:layout_weight=\"0.6\"\n                android:background=\"@color\/white1\"&gt;\n\n                &lt;TextView\n                    android:layout_width=\"match_parent\"\n                    android:layout_height=\"wrap_content\"\n                    android:layout_gravity=\"center\"\n\n                    android:gravity=\"center\"\n                    android:text=\"Time\"\n                    android:textColor=\"@color\/black\"\n                    android:textSize=\"15sp\"\n\n\n                    \/&gt;\n\n            &lt;\/LinearLayout&gt;\n\n            &lt;LinearLayout\n                android:layout_width=\"0dp\"\n                android:layout_height=\"match_parent\"\n                android:layout_weight=\"1.4\"&gt;\n\n                &lt;TextView\n                    android:id=\"@+id\/tvTime\"\n                    android:layout_width=\"match_parent\"\n                    android:layout_height=\"wrap_content\"\n                    android:layout_gravity=\"center\"\n                    android:gravity=\"center\"\n                    android:text=\"\"\n                    android:textColor=\"@color\/black\"\n                    android:textSize=\"20sp\"\n\n                    \/&gt;\n\n            &lt;\/LinearLayout&gt;\n\n\n        &lt;\/LinearLayout&gt;\n\n\n    &lt;\/LinearLayout&gt;\n\n&lt;\/androidx.constraintlayout.widget.ConstraintLayout&gt;<\/pre>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-87633\" src=\"https:\/\/techvidvan.com\/tutorials\/wp-content\/uploads\/sites\/2\/2023\/04\/activity-ride-detailsxml-.webp\" alt=\"activity ride details(xml)\" width=\"1920\" height=\"1029\" \/><\/p>\n<p>Moving onto the files that are responsible for the working and functioning of the application.<\/p>\n<p>1. Starting with \u2018RideModel.kt\u2019 file, this file is a data class which contains all the variables that should be included in the database.<\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\">data class RideModel(\n    var empId: String? = null,\n    var empName: String? = null,\n    var empSource: String? = null,\n    var empDestination: String? = null,\n    var empTotalPassenger: String? = null,\n    var empPrice: String? = null,\n    var empContact: String? = null,\n    var empDate: String? = null,\n    var empTime: String? = null\n)<\/pre>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-87634\" src=\"https:\/\/techvidvan.com\/tutorials\/wp-content\/uploads\/sites\/2\/2023\/04\/ride-modelkt-.webp\" alt=\"ride model(kt)\" width=\"1920\" height=\"1035\" \/><\/p>\n<p>2. \u2018MainActivity.kt\u2019 is the file responsible for the functionality of the buttons that are included on the home screen.<\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\">class MainActivity : AppCompatActivity() {\n    private lateinit var addBtn: Button\n    private lateinit var fetchBtn: Button\n    override fun onCreate(savedInstanceState: Bundle?) {\n        super.onCreate(savedInstanceState)\n        setContentView(R.layout.activity_main)\n\n        addBtn = findViewById(R.id.btnInsertData)\n        fetchBtn = findViewById(R.id.btnFetchData)\n\n        addBtn.setOnClickListener{\n            val intent = Intent(this, InsertionActivity::class.java)\n            startActivity(intent)\n        }\n\n        fetchBtn.setOnClickListener{\n            val intent = Intent(this, FetchingActivity::class.java)\n            startActivity(intent)\n        }\n    }\n}<\/pre>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-87635\" src=\"https:\/\/techvidvan.com\/tutorials\/wp-content\/uploads\/sites\/2\/2023\/04\/main-activitykt.webp\" alt=\"main activity(kt)\" width=\"1920\" height=\"1029\" \/><\/p>\n<p>3. \u2018InsertionActivity.kt\u2019 is a kotlin file which is responsible for saving the data and initializing the database when application is executed.<\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\">class InsertionActivity : AppCompatActivity() {\n    private lateinit var etName: EditText\n    private lateinit var etSource: EditText\n    private lateinit var etDestination: EditText\n    private lateinit var etTotal: EditText\n    private lateinit var etPrice: EditText\n    private lateinit var etContact: EditText\n    private lateinit var etDate: EditText\n    private lateinit var etTime: EditText\n    private lateinit var btnSave: Button\n    private lateinit var dbRef: DatabaseReference\n    override fun onCreate(savedInstanceState: Bundle?) {\n        super.onCreate(savedInstanceState)\n        setContentView(R.layout.activity_insertion)\n\n        etName = findViewById(R.id.etName)\n        etSource = findViewById(R.id.etSource)\n        etDestination = findViewById(R.id.etDestination)\n        etTotal = findViewById(R.id.etTotalPassengers)\n        etPrice = findViewById(R.id.etPrice)\n        etContact = findViewById(R.id.etContact)\n        etDate = findViewById(R.id.etDate)\n        etTime = findViewById(R.id.etTime)\n        btnSave = findViewById(R.id.btnSave)\n\n        dbRef = FirebaseDatabase.getInstance().getReference(\"Rides\")\n\n        btnSave.setOnClickListener {\n            saveData()\n        }\n    }\n\n    private fun saveData() {\n        val name = etName.text.toString()\n        val source = etSource.text.toString()\n        val destination = etDestination.text.toString()\n        val total = etTotal.text.toString()\n        val price = etPrice.text.toString()\n        val contact = etContact.text.toString()\n        val date = etDate.text.toString()\n        val time = etTime.text.toString()\n        val id = dbRef.push().key!!\n\n        if (name.isEmpty() || source.isEmpty() || destination.isEmpty() || total.isEmpty() || price.isEmpty() || contact.isEmpty() || date.isEmpty() || time.isEmpty()) {\n            Toast.makeText(this, \"Enter details\", Toast.LENGTH_SHORT).show()\n        } else {\n            val rideModel =\n                RideModel(id, name, source, destination, total, price, contact, date, time)\n\n            dbRef.child(id).setValue(rideModel)\n                .addOnCompleteListener {\n                    Toast.makeText(this, \"Ride data saved successfully\", Toast.LENGTH_SHORT).show()\n                    etName.text.clear()\n                    etSource.text.clear()\n                    etDestination.text.clear()\n                    etTotal.text.clear()\n                    etPrice.text.clear()\n                    etDate.text.clear()\n                    etTime.text.clear()\n                    etContact.text.clear()\n                }\n                .addOnFailureListener { err -&gt;\n                    Toast.makeText(\n                        this,\n                        \"Error ${err.message}\",\n                        Toast.LENGTH_SHORT\n                    ).show()\n                }\n        }\n    }\n}<\/pre>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-87636\" src=\"https:\/\/techvidvan.com\/tutorials\/wp-content\/uploads\/sites\/2\/2023\/04\/insertion-activitykt.webp\" alt=\"insertion activity(kt)\" width=\"1914\" height=\"1032\" \/><\/p>\n<p>4. \u2018RideAdapter.kt\u2019 is a class which sets and initializes the adapter for the recycler view that is being displayed in the fetching activity screen.<\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\">class RideAdapter(private val rideList: ArrayList&lt;RideModel&gt;): RecyclerView.Adapter&lt;RideAdapter.ViewHolder&gt;() {\n    private lateinit var mListener: onItemClickListener\n    interface onItemClickListener{\n        fun onItemClick(position: Int)\n    }\n\n    fun setOnItemClickListener(clickListener: onItemClickListener){\n        mListener=clickListener\n    }\n    override fun onCreateViewHolder(parent: ViewGroup, viewType: Int): RideAdapter.ViewHolder {\n        val itemView =LayoutInflater.from(parent.context).inflate(R.layout.ride_list_item,parent,false)\n        return ViewHolder(itemView, mListener)\n    }\n\n    override fun onBindViewHolder(holder: RideAdapter.ViewHolder, position: Int) {\n        val currentRide = rideList[position]\n        holder.tvSource.text =currentRide.empSource\n        holder.tvDestination.text=currentRide.empDestination\n    }\n\n    override fun getItemCount(): Int {\n        return rideList.size\n    }\n\n    class ViewHolder(itemView: View, clickListener:onItemClickListener): RecyclerView.ViewHolder(itemView) {\n        val tvSource: TextView = itemView.findViewById(R.id.tvSource)\n        val tvDestination: TextView = itemView.findViewById(R.id.tvDestination)\n        init{\n            itemView.setOnClickListener {\n                clickListener.onItemClick(adapterPosition)\n            }\n        }\n    }\n}<\/pre>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-87637\" src=\"https:\/\/techvidvan.com\/tutorials\/wp-content\/uploads\/sites\/2\/2023\/04\/ride-adapterkt.webp\" alt=\"ride adapter(kt)\" width=\"1920\" height=\"1032\" \/><\/p>\n<p>5. \u201cFetchingActivity\u201d is a kotlin line which is responsible for displaying the source and destination of every ride in the database by fetching the data.<\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\">class FetchingActivity : AppCompatActivity() {\n    private lateinit var rideRecyclerView: RecyclerView\n    private lateinit var tvLoadingData: TextView\n    private lateinit var rideList: ArrayList&lt;RideModel&gt;\n    private lateinit var dbRef: DatabaseReference\n    override fun onCreate(savedInstanceState: Bundle?) {\n        super.onCreate(savedInstanceState)\n        setContentView(R.layout.activity_fetching)\n\n        rideRecyclerView = findViewById(R.id.rvRide)\n        rideRecyclerView.layoutManager = LinearLayoutManager(this)\n        rideRecyclerView.hasFixedSize()\n        tvLoadingData = findViewById(R.id.tvLoadingData)\n\n        rideList = arrayListOf&lt;RideModel&gt;()\n\n        getRideData()\n\n\n    }\n\n    private fun getRideData() {\n        rideRecyclerView.visibility = View.GONE\n        tvLoadingData.visibility = View.VISIBLE\n\n        dbRef = FirebaseDatabase.getInstance().getReference(\"Rides\")\n\n        dbRef.addValueEventListener(object :ValueEventListener{\n            override fun onDataChange(snapshot: DataSnapshot) {\n                rideList.clear()\n                if(snapshot.exists()){\n                    for(rideSnap in snapshot.children){\n                        val rideData = rideSnap.getValue(RideModel::class.java)\n                        rideList.add(rideData!!)\n                    }\n                    val mAdapter = RideAdapter(rideList)\n                    rideRecyclerView.adapter = mAdapter\n\n                    mAdapter.setOnItemClickListener(object : RideAdapter.onItemClickListener{\n                        override fun onItemClick(position: Int) {\n                            val intent = Intent(this@FetchingActivity, RideDetailsActivity::class.java)\n                            intent.putExtra(\"name\",rideList[position].empName)\n                            intent.putExtra(\"source\",rideList[position].empSource)\n                            intent.putExtra(\"destination\",rideList[position].empDestination)\n                            intent.putExtra(\"total\",rideList[position].empTotalPassenger)\n                            intent.putExtra(\"price\",rideList[position].empPrice)\n                            intent.putExtra(\"contact\",rideList[position].empContact)\n                            intent.putExtra(\"date\",rideList[position].empDate)\n                            intent.putExtra(\"time\",rideList[position].empTime)\n                            startActivity(intent)\n                        }\n\n                    })\n                    rideRecyclerView.visibility = View.VISIBLE\n                    tvLoadingData.visibility = View.GONE\n                }\n            }\n\n            override fun onCancelled(error: DatabaseError) {\n                TODO(\"Not yet implemented\")\n            }\n\n        })\n    }\n}<\/pre>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-87638\" src=\"https:\/\/techvidvan.com\/tutorials\/wp-content\/uploads\/sites\/2\/2023\/04\/fetching-activitykt.webp\" alt=\"fetching activity(kt)\" width=\"1920\" height=\"1035\" \/><\/p>\n<p>6. \u201cRideDetailsActivity\u201d is a kotlin line which is responsible for displaying the details for the selected source and destination in the format specified by the xml file.<\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\">class RideDetailsActivity : AppCompatActivity() {\n    private lateinit var tvName: TextView\n    private lateinit var tvSource: TextView\n    private lateinit var tvDestination: TextView\n    private lateinit var tvTotal: TextView\n    private lateinit var tvPrice: TextView\n    private lateinit var tvContact: TextView\n    private lateinit var tvDate: TextView\n    private lateinit var tvTime: TextView\n    override fun onCreate(savedInstanceState: Bundle?) {\n        super.onCreate(savedInstanceState)\n        setContentView(R.layout.activity_ride_details)\n        initView()\n        setValuesToViews()\n    }\n\n    private fun initView() {\n        tvName = findViewById(R.id.tvName)\n        tvSource = findViewById(R.id.tvSource)\n        tvDestination = findViewById(R.id.tvDestination)\n        tvTotal = findViewById(R.id.tvTotal)\n        tvPrice = findViewById(R.id.tvPrice)\n        tvContact = findViewById(R.id.tvContact)\n        tvDate = findViewById(R.id.tvDate)\n        tvTime = findViewById(R.id.tvTime)\n    }\n\n    private fun setValuesToViews() {\n        tvName.text = intent.getStringExtra(\"name\")\n        tvSource.text = intent.getStringExtra(\"source\")\n        tvDestination.text = intent.getStringExtra(\"destination\")\n        tvTotal.text = intent.getStringExtra(\"total\")\n        tvPrice.text = intent.getStringExtra(\"price\")\n        tvContact.text = intent.getStringExtra(\"contact\")\n        tvDate.text = intent.getStringExtra(\"date\")\n        tvTime.text = intent.getStringExtra(\"time\")\n    }\n}<\/pre>\n<p>&nbsp;<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-87642\" src=\"https:\/\/techvidvan.com\/tutorials\/wp-content\/uploads\/sites\/2\/2023\/04\/ride-details-activitykt.webp\" alt=\"ride details activity(kt)\" width=\"1920\" height=\"1032\" \/><\/p>\n<h3>Android Car-pooling App Output<\/h3>\n<p>1. Home Screen<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter wp-image-87619 size-full\" src=\"https:\/\/techvidvan.com\/tutorials\/wp-content\/uploads\/sites\/2\/2023\/04\/home-screen-output.webp\" alt=\"home screen output\" width=\"400\" height=\"811\" \/><\/p>\n<p>2. Add a new ride.<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter wp-image-87620 size-full\" src=\"https:\/\/techvidvan.com\/tutorials\/wp-content\/uploads\/sites\/2\/2023\/04\/add-new-ride-output.webp\" alt=\"add new ride output\" width=\"400\" height=\"809\" \/><\/p>\n<p>&nbsp;<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter wp-image-87621 size-full\" src=\"https:\/\/techvidvan.com\/tutorials\/wp-content\/uploads\/sites\/2\/2023\/04\/adding-new-ride-output-.webp\" alt=\"adding new ride output\" width=\"400\" height=\"810\" \/><\/p>\n<p>3. Saving the newly added ride<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-87622\" src=\"https:\/\/techvidvan.com\/tutorials\/wp-content\/uploads\/sites\/2\/2023\/04\/save-new-ride-output.webp\" alt=\"save new ride output\" width=\"400\" height=\"810\" \/><\/p>\n<p>4. New ride details in the database.<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-87623\" src=\"https:\/\/techvidvan.com\/tutorials\/wp-content\/uploads\/sites\/2\/2023\/04\/database-output.webp\" alt=\"database output\" width=\"800\" height=\"376\" \/><\/p>\n<p>5. Fetching Details.<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter wp-image-87624 size-full\" src=\"https:\/\/techvidvan.com\/tutorials\/wp-content\/uploads\/sites\/2\/2023\/04\/fetching-details-output.webp\" alt=\"fetching details output\" width=\"400\" height=\"804\" \/><\/p>\n<p>6. Getting details of the selected ride.<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-87625\" src=\"https:\/\/techvidvan.com\/tutorials\/wp-content\/uploads\/sites\/2\/2023\/04\/ride-details-output.webp\" alt=\"ride details output\" width=\"400\" height=\"822\" \/><\/p>\n<h3>Summary<\/h3>\n<p>So in this project, we have learned how to create and develop a car-pooling app in android studio. This project is highly beneficial for beginners since it familiarizes users with utilizing XML to create user interfaces, switching between activities by clicking a button, using firebase as a database, especially when inserting data into the database or fetching data from it. We sincerely hope you enjoyed it, and we are sure you will enjoy implementing it into reality.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Today we are going to see and learn to implement an Android Project that is a Car-Pooling App in android studio. We\u2019ll understand the complete project development in this article. Instead of driving separately&#46;&#46;&#46;<\/p>\n","protected":false},"author":1,"featured_media":87618,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[4955],"tags":[4958,4959,4960,4910,3007,3010,4961,4962],"class_list":["post-87546","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-android-kotlin-tutorials","tag-android-car-pooling-application","tag-android-car-pooling-application-project","tag-android-car-pooling-project","tag-android-project-for-practice","tag-android-project-ideas","tag-android-projects","tag-car-pooling-application","tag-car-pooling-application-project"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v27.7 - https:\/\/yoast.com\/product\/yoast-seo-wordpress\/ -->\n<title>Android Car Pooling Application - Share the Ride, Share the Love - TechVidvan<\/title>\n<meta name=\"description\" content=\"Reduce your commuting costs, decrease your carbon footprint and enjoy a comfortable ride with our Android Car Pooling Application.\" \/>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/techvidvan.com\/tutorials\/android-car-pooling-application\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Android Car Pooling Application - Share the Ride, Share the Love - TechVidvan\" \/>\n<meta property=\"og:description\" content=\"Reduce your commuting costs, decrease your carbon footprint and enjoy a comfortable ride with our Android Car Pooling Application.\" \/>\n<meta property=\"og:url\" content=\"https:\/\/techvidvan.com\/tutorials\/android-car-pooling-application\/\" \/>\n<meta property=\"og:site_name\" content=\"TechVidvan\" \/>\n<meta property=\"article:publisher\" content=\"https:\/\/www.facebook.com\/TechVidvan\/\" \/>\n<meta property=\"article:published_time\" content=\"2023-04-24T05:07:34+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/techvidvan.com\/tutorials\/wp-content\/uploads\/2023\/04\/car-pooling-application.webp\" \/>\n\t<meta property=\"og:image:width\" content=\"1200\" \/>\n\t<meta property=\"og:image:height\" content=\"628\" \/>\n\t<meta property=\"og:image:type\" content=\"image\/webp\" \/>\n<meta name=\"author\" content=\"TechVidvan Team\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:creator\" content=\"@vidvantech\" \/>\n<meta name=\"twitter:site\" content=\"@vidvantech\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"TechVidvan Team\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"14 minutes\" \/>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"Android Car Pooling Application - Share the Ride, Share the Love - TechVidvan","description":"Reduce your commuting costs, decrease your carbon footprint and enjoy a comfortable ride with our Android Car Pooling Application.","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/techvidvan.com\/tutorials\/android-car-pooling-application\/","og_locale":"en_US","og_type":"article","og_title":"Android Car Pooling Application - Share the Ride, Share the Love - TechVidvan","og_description":"Reduce your commuting costs, decrease your carbon footprint and enjoy a comfortable ride with our Android Car Pooling Application.","og_url":"https:\/\/techvidvan.com\/tutorials\/android-car-pooling-application\/","og_site_name":"TechVidvan","article_publisher":"https:\/\/www.facebook.com\/TechVidvan\/","article_published_time":"2023-04-24T05:07:34+00:00","og_image":[{"width":1200,"height":628,"url":"https:\/\/techvidvan.com\/tutorials\/wp-content\/uploads\/2023\/04\/car-pooling-application.webp","type":"image\/webp"}],"author":"TechVidvan Team","twitter_card":"summary_large_image","twitter_creator":"@vidvantech","twitter_site":"@vidvantech","twitter_misc":{"Written by":"TechVidvan Team","Est. reading time":"14 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/techvidvan.com\/tutorials\/android-car-pooling-application\/#article","isPartOf":{"@id":"https:\/\/techvidvan.com\/tutorials\/android-car-pooling-application\/"},"author":{"name":"TechVidvan Team","@id":"https:\/\/techvidvan.com\/tutorials\/#\/schema\/person\/e9c26e74dd3d87421f7ada9433b8cd22"},"headline":"Android Car Pooling Application &#8211; Share the Ride, Share the Love","datePublished":"2023-04-24T05:07:34+00:00","mainEntityOfPage":{"@id":"https:\/\/techvidvan.com\/tutorials\/android-car-pooling-application\/"},"wordCount":997,"commentCount":0,"publisher":{"@id":"https:\/\/techvidvan.com\/tutorials\/#organization"},"image":{"@id":"https:\/\/techvidvan.com\/tutorials\/android-car-pooling-application\/#primaryimage"},"thumbnailUrl":"https:\/\/techvidvan.com\/tutorials\/wp-content\/uploads\/2023\/04\/car-pooling-application.webp","keywords":["android car pooling application","android car pooling application project","android car pooling project","android project for practice","android project ideas","android projects","car pooling application","car pooling application project"],"articleSection":["Android Kotlin Tutorials"],"inLanguage":"en-US","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/techvidvan.com\/tutorials\/android-car-pooling-application\/#respond"]}]},{"@type":"WebPage","@id":"https:\/\/techvidvan.com\/tutorials\/android-car-pooling-application\/","url":"https:\/\/techvidvan.com\/tutorials\/android-car-pooling-application\/","name":"Android Car Pooling Application - Share the Ride, Share the Love - TechVidvan","isPartOf":{"@id":"https:\/\/techvidvan.com\/tutorials\/#website"},"primaryImageOfPage":{"@id":"https:\/\/techvidvan.com\/tutorials\/android-car-pooling-application\/#primaryimage"},"image":{"@id":"https:\/\/techvidvan.com\/tutorials\/android-car-pooling-application\/#primaryimage"},"thumbnailUrl":"https:\/\/techvidvan.com\/tutorials\/wp-content\/uploads\/2023\/04\/car-pooling-application.webp","datePublished":"2023-04-24T05:07:34+00:00","description":"Reduce your commuting costs, decrease your carbon footprint and enjoy a comfortable ride with our Android Car Pooling Application.","breadcrumb":{"@id":"https:\/\/techvidvan.com\/tutorials\/android-car-pooling-application\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/techvidvan.com\/tutorials\/android-car-pooling-application\/"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/techvidvan.com\/tutorials\/android-car-pooling-application\/#primaryimage","url":"https:\/\/techvidvan.com\/tutorials\/wp-content\/uploads\/2023\/04\/car-pooling-application.webp","contentUrl":"https:\/\/techvidvan.com\/tutorials\/wp-content\/uploads\/2023\/04\/car-pooling-application.webp","width":1200,"height":628,"caption":"car pooling application"},{"@type":"BreadcrumbList","@id":"https:\/\/techvidvan.com\/tutorials\/android-car-pooling-application\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/techvidvan.com\/tutorials\/"},{"@type":"ListItem","position":2,"name":"Android Car Pooling Application &#8211; Share the Ride, Share the Love"}]},{"@type":"WebSite","@id":"https:\/\/techvidvan.com\/tutorials\/#website","url":"https:\/\/techvidvan.com\/tutorials\/","name":"TechVidvan Blogs","description":"","publisher":{"@id":"https:\/\/techvidvan.com\/tutorials\/#organization"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/techvidvan.com\/tutorials\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":"Organization","@id":"https:\/\/techvidvan.com\/tutorials\/#organization","name":"TechVidvan","url":"https:\/\/techvidvan.com\/tutorials\/","logo":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/techvidvan.com\/tutorials\/#\/schema\/logo\/image\/","url":"https:\/\/techvidvan.com\/tutorials\/wp-content\/uploads\/2024\/03\/techvidvan-logo-200x50-1.webp","contentUrl":"https:\/\/techvidvan.com\/tutorials\/wp-content\/uploads\/2024\/03\/techvidvan-logo-200x50-1.webp","width":200,"height":50,"caption":"TechVidvan"},"image":{"@id":"https:\/\/techvidvan.com\/tutorials\/#\/schema\/logo\/image\/"},"sameAs":["https:\/\/www.facebook.com\/TechVidvan\/","https:\/\/x.com\/vidvantech"]},{"@type":"Person","@id":"https:\/\/techvidvan.com\/tutorials\/#\/schema\/person\/e9c26e74dd3d87421f7ada9433b8cd22","name":"TechVidvan Team","description":"The TechVidvan Team delivers practical, beginner-friendly tutorials on programming, Java, Python, C++, DSA, AI, ML, data Science, Android, Flutter, MERN, Web Development, and technology. Our experts are here to help you upskill and excel in today\u2019s tech industry."}]}},"amp_enabled":true,"_links":{"self":[{"href":"https:\/\/techvidvan.com\/tutorials\/wp-json\/wp\/v2\/posts\/87546","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/techvidvan.com\/tutorials\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/techvidvan.com\/tutorials\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/techvidvan.com\/tutorials\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/techvidvan.com\/tutorials\/wp-json\/wp\/v2\/comments?post=87546"}],"version-history":[{"count":0,"href":"https:\/\/techvidvan.com\/tutorials\/wp-json\/wp\/v2\/posts\/87546\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/techvidvan.com\/tutorials\/wp-json\/wp\/v2\/media\/87618"}],"wp:attachment":[{"href":"https:\/\/techvidvan.com\/tutorials\/wp-json\/wp\/v2\/media?parent=87546"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/techvidvan.com\/tutorials\/wp-json\/wp\/v2\/categories?post=87546"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/techvidvan.com\/tutorials\/wp-json\/wp\/v2\/tags?post=87546"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}