Finalproject
Finalproject
ON
DIPLOMA IN
INFORMATION TECHNOLOGY
AFFILIATED TO
MAHARASHTRA STATE BOARD OF TECHNICAL EDUCATION
MUMBAI
SUBMITTED BY
Nameof
Name ofStudents
Student Enrollment No.
GUIDED BY
MS. TANUJA BHOIR
2024-25
This is to certify that Ms. Anushka Tamboli Enrollment No. 2211440004 of Sixth Semester
of Diploma in Information Technology at G.V. ACHARYA POLYTECHNIC has
completed the Micro Project satisfactorily in Subject Capstone Project Execution(CPE)
the academic year 2024- 2025 as per the MSBTE prescribed curriculum of I scheme.
This is to certify that the project titled “Carpooling Android Application” is a bonafied work
carried out by the student of Diploma in Information Technology as a part of curriculum as
prescribed by MSBTE.
I hereby declare that the project work has not formed the basis for the award previously of any
Diploma, Associateship, Fellowship or any other similar title according to my knowledge.
Signature of Student
1.
2.
3.
4.
ACKNOWLEDGEMENT
This project work titled “Carpooling Android Application” is a part of curriculum as prescribed
by MSBTE.
We are really thankful to our Principal Mrs. Madhura Mahindrakar and our HOD Mrs.
Madhura Mahindrakar, Computer Department, G.V Acharya Polytechnic, Shelu. For her
invaluable guidance and assistance, without which the accomplishment of the task would have
never been possible.
We are also thankful to our Guide Ms. Tanuja Bhoir for giving this opportunity to explore into
the real world and realize the interrelation without which a Project can never progress.
We are also thankful to parents, friend and all staff of Information Technology Department,
for providing us relevant information and necessary clarifications, and great support.
G.V. ACHARYA POLYTECHNIC, SHELU
CERTIFICATE
This is certify that the project report entitled “Carpooling Android Application” Was successfully
completed by student of Sixth semester Diploma in Computer Engineering.
1) Anushka Tamboli
2) Pragati Rajput
3) Harshita Gawade
4) Shreya Gade
In partial fulfillment of the requirements for the award of the Diploma in Information Technology
and submitted to the Department of Information Technology Department of G.V.Acharya
Polytechnic, Shelu. The matter embodied is the actual work done by the student during a period for
the academic year
2024-25 under the supervision of our guide.
Carpooling mobile application is used for reducing fuel wastage, traffic, and environmental
problems caused by increasing privately owned vehicles. Sharing vehicles with travelers going
in the same direction, referred to as carpooling, is presented as a cheap and environmentally
safe solution to the problem. The said platform allows users, car owners as well as travelers, to
sign up and interact through a website that offers ride-sharing facilities for daily commutes.
This way, when two or more people share one car, the number of cars on the road is reduced
which significantly results in saving fuel, fewer emissions into the atmosphere and decreased
congestions on the roads. The main clearly defined objectives of this research include
eliminating unnecessary initiation costs, such as possible geographical constraints; increased
fuel efficiency; positive environmental impact; and enhanced social component as they involve
interacting with others. But the paper also accepts that some elements of the current carpooling
CAST system are less than ideal including security issues as well as time constraints. To
address these limitations, features such as the availability of seats, estimated costs, live location
sharing, and ratings and reviews are some of the features thought for the target app. The
research anticipates and suggests valuable future perspectives such as, incorporation of GPS
tracking, SOS features, intelligent matching, self-driving cars and block.
Keyword: Ridesharing, Android Studio, Java, Kotlin, Location Tracking, Google Maps API,
Login, Registration, Firebase, OTP Verification, Ride Request, Trip Details, Geolocation,
Route Optimization.
LIST OF FIGURES
x
LIST OF TABLES
Symbol Explanation
CANDIDATE'S DECLARATION
ACKNOWLEDGEMENT
ABSTRACT
LIST OF FIGURES
LIST OF TABLES
LIST OF SYMBOLS AND ABBREVIATIONS
1 INTRODUCTION 1
1.2 Relevance 3
2 LITERATURE REVIEW 5
3 PROPOSED WORK 10
3.3 Methodology 13
3.5 Conclusion 28
List of Reference 30
Carpooling Android Application
Chapter 1
Introduction
The increasing population in urban areas has led to a significant rise in the number of private
vehicles on the road, contributing to severe traffic congestion, higher fuel consumption, and
escalating pollution levels. Many metropolitan cities face daily gridlocks, resulting in longer travel
times, increased stress, and reduced overall productivity. Additionally, the growing reliance on
fossil fuels for transportation has had detrimental effects on the environment, contributing to
climate change and deteriorating air quality. Public transportation systems, although widely
available, often struggle to keep up with the demand for flexible and convenient commuting
solutions. Many commuters experience overcrowding, unreliable schedules, and last-mile
connectivity issues, making public transit less appealing. Ride-hailing services, while offering
convenience, can be costly and contribute further to urban congestion due to an increased number
of single-passenger trips.
Carpooling presents a viable alternative by addressing both economic and environmental concerns.
By allowing individuals to share rides with others traveling in the same direction, carpooling not
only reduces travel costs but also optimizes vehicle usage, leading to fewer cars on the road. This
practice helps in decongesting urban traffic, lowering greenhouse gas emissions, and promoting a
culture of shared mobility. Advances in mobile technology have made it easier than ever to
facilitate carpooling, providing users with digital platforms that offer real-time ride matching,
secure transactions, and convenient scheduling. With increasing awareness of sustainability and
the need for cost-effective travel solutions, carpooling has gained traction as an essential
component of modern urban mobility strategies.
1.2 Relevance
The importance of an efficient carpooling system cannot be overstated. Rising fuel prices,
increased urban traffic, and concerns about climate change have made carpooling an essential
aspect of sustainable transportation. By reducing the number of vehicles on the road, carpooling
significantly decreases greenhouse gas emissions, helping cities combat pollution and improve
air quality. Additionally, it provides financial relief to commuters by lowering individual travel
expenses and optimizing fuel consumption. Beyond economic and environmental benefits,
carpooling also fosters social interactions among commuters, creating a sense of community
and shared responsibility for sustainable urban development. Our Carpooling Mobile
Application leverages advanced ride-matching algorithms, real-time tracking, and secure
payment systems to ensure a convenient, cost-effective, and eco-friendly commuting option
1. Introduction
2. Literature Review
3. Proposed Work
List of References
Cite all used sources.
Chapter 2
Literature Review
Urban transportation faces major challenges due to increasing traffic congestion, rising fuel
costs, and environmental pollution. The growing reliance on private vehicles has worsened
these issues, leading to longer commute times and higher carbon emissions. Existing ride-
sharing services, such as taxis and commercial ride-hailing platforms, are often expensive and
do not cater to daily commuters looking for cost-effective alternatives.
While informal carpooling exists within workplaces and communities, it lacks proper
coordination, security, and technology-driven features. There is a need for a structured, reliable,
and user-friendly Carpooling Mobile Application that facilitates secure ride-sharing, optimizes
travel costs, and reduces traffic congestion while ensuring safety and convenience for daily
commuters.
2. 15,550
Smartphone Redmi Note 11 01 15,550
Total=63,150
Chapter 3
Proposed Work
A carpooling mobile application aims to connect individuals traveling in the same direction,
enabling them to share rides and reduce commuting costs. By facilitating ride-sharing, the app
helps lower fuel expenses, decrease traffic congestion, and minimize carbon emissions,
contributing to a more sustainable environment. It also enhances convenience by allowing users
to find reliable travel companions, whether for daily commutes or long-distance trips.
Additionally, such apps promote social interaction and networking among users while
incorporating safety features like user verification, route tracking, and secure payment options.
Overall, the goal is to make transportation more economical, efficient, and eco-friendly.
1. Environmentally Friendly Lowers carbon emissions and fuel consumption by reducing the
number of vehicles in use.
2. Cost-Effective Helps users save money on fuel, tolls, and maintenance by splitting costs among
riders.
3. Convenient Travel Option Offers a more flexible and accessible commuting solution,especially in
areas with limited public transport.
4. Time Saving Carpool lanes (HOV lanes) can reduce commute time for shared rides.
5. Promotes Social Interaction Connects people with similar routes, building community and making
commuting more enjoyable.
6. Reduces Parking Issues Fewer cars on the road mean less demand for parking spaces, especially in
urban areas.
7. Supports Sustainable Urban Living Contributes to smarter and greener cities by promoting shared
mobility.
8. User-Friendly Access Android apps offer a convenient platform for users to find, offer, or join
rides quickly and easily.
1. Reduce Parking Demand: Lessen the need for parking spaces by decreasing the number of
vehicles in use.
2. Build a Community: Foster a trusted carpooling community through social features and user
engagement tools.
3. AI-Based Ride Matching: Implement smart algorithms or AI to suggest the best matches based on
user preferences, travel history, and compatibility.
4. Emergency Features: Include an SOS or emergency button for users to feel safe while commuting.
5. Multi-Language Support: Provide multilingual support to cater to a diverse user base.
3.3 Methodology
• Requirement Analysis – A detailed study was conducted through research and surveys to
understand user needs, traffic congestion issues, and existing carpooling challenges. The
key features of the application were identified based on this analysis.
• System Design – The architecture of the application was designed, including user interface
(UI), system flow diagrams etc. Security features such as authentication and data
encryption were planned to protect user information.
• Testing & Debugging – The application was tested for functionality, security, and
performance. Unit testing, integration testing, and user acceptance testing (UAT) were
conducted to ensure smooth operation and reliability. Bugs and issues identified during
testing were fixed.
• Deployment – The APK version of the app was released and tested by selected users.
Based on user input, improvements were made before the final deployment. Hosting
services and server configurations were optimized for performance.
The flowchart diagram for the Carpooling Mobile Application visually represents the sequence of
processes, decisions, and data flows involved in the application. It highlights the interactions
between the user, driver, and the system at various stages.
The Activity Diagram for the Carpooling Mobile Application visually represents the flow of control and
activities performed by users, drivers, and the system. It highlights the sequence of actions, decision points,
and system interactions.
A Data Flow Diagram (DFD) Level 0 for a carpooling Android application represents the high-level
system overview, illustrating major processes and interactions. It typically includes external entities
like users, drivers, and the carpooling service, with data flowing between them. Key processes may
include user registration, ride booking, and ride matching.
The diagram shows how users input data (like passenger information or driver details), which the
system processes and stores. The Level 0 DFD provides a broad view of the carpooling app’s
functionality, without delving into complex internal operations
This Level 1 DFD provides a more detailed view of the processes and subsystems involved in the
Carpooling Mobile Application, enhancing the understanding of the system's functionalities and data
flow within the context of report.
It serves as an intermediate level between the high-level overview provided by the Level 0 DFD and
the detailed processes that will be depicted in subsequent levels of the DFD hierarchy.
The Level 2 DFD further decomposes the key processes defined in the Level 1 DFD of the
Carpooling Mobile Application. It breaks down each major process into more granular sub-processes
and shows detailed interactions between data stores, processes, and external entities.
External entities such as Users, Drivers, and Emergency Services interact with these processes to
facilitate the application’s functionalities. For example, users register, request rides, and track their
journey, while drivers manage ride requests and provide location updates emergency services are
notified during SOS alerts. This Level 2 DFD enhances understanding by showcasing detailed data
flows and operations, serving as a foundation for more refined analysis and decomposition in Level
3
Code:
CarPool_User
AndroidManifest.xml
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
package="com.carpool.user">
<uses-permission android:name="android.permission.FOREGROUND_SERVICE"/>
<application
android:allowBackup="false"
android:fullBackupOnly="false"
android:icon="@mipmap/ic_launcher"
android:label="@string/app_name"
android:roundIcon="@mipmap/ic_launcher_round"
android:supportsRtl="true"
android:theme="@style/AppTheme"
android:usesCleartextTraffic="true"
tools:ignore="GoogleAppIndexingWarning">
<activity android:name=".ui.rides.Offer_Ride_details" />
<uses-library
android:name="org.apache.http.legacy"
android:required="false" />
<activity
android:name=".LoginActivity"
android:screenOrientation="portrait"
android:windowSoftInputMode="stateHidden">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
android:name=".RegisterActivity"
android:screenOrientation="portrait"
android:windowSoftInputMode="stateHidden" />
<activity
android:name=".NavigationActivity"
android:label="@string/title_activity_navigation"
android:screenOrientation="portrait"
android:windowSoftInputMode="stateHidden" />
<activity android:name=".MainActivity" />
<activity
android:name=".CabActivity"
android:screenOrientation="portrait"
android:windowSoftInputMode="stateHidden" />
<activity
android:name=".ui.rides.PassengerDetails"
android:screenOrientation="portrait"
android:windowSoftInputMode="stateHidden" />
<service android:name=".background.Back_Service"
/>
<meta-data
android:name="com.google.android.geo.API_KEY"
android:value="@string/google_maps_key" />
</application>
</manifest>
Activity_login.xml
<?xml version="1.0" encoding="utf-8"?>
<androidx.constraintlayout.widget.ConstraintLayout
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintTop_toTopOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintEnd_toEndOf="parent"
>
<ImageView
android:layout_width="100dp"
android:layout_height="100dp"
android:layout_gravity="center"
android:src="@mipmap/ic_launcher_round"
android:layout_marginBottom="@dimen/margin10"
/>
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@string/app_name"
android:layout_gravity="center"
android:gravity="center"
android:layout_marginTop="@dimen/margin10"
android:layout_marginBottom="@dimen/margin10"
android:textColor="@android:color/black"
android:textSize="@dimen/size21"/>
<com.google.android.material.textfield.TextInputLayout
style="@style/Widget.MaterialComponents.TextInputLayout.OutlinedBox"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:hint="Email"
android:layout_margin="@dimen/margin10"
app:boxBackgroundMode="outline"
app:startIconDrawable="@android:drawable/sym_action_email"
app:startIconTint="@color/colorPrimary"
>
<com.google.android.material.textfield.TextInputEditText
android:id="@+id/login_username"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:inputType="textEmailAddress"
android:padding="@dimen/padding10"
/>
</com.google.android.material.textfield.TextInputLayout>
<com.google.android.material.textfield.TextInputLayout
style="@style/Widget.MaterialComponents.TextInputLayout.OutlinedBox"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:hint="Password"
android:layout_marginStart="@dimen/margin10"
app:boxBackgroundMode="outline"
android:layout_marginEnd="@dimen/margin10"
app:passwordToggleEnabled="true"
app:startIconDrawable="@android:drawable/ic_lock_lock"
app:startIconTint="@color/colorPrimary"
app:passwordToggleTint="@color/colorPrimary">
<com.google.android.material.textfield.TextInputEditText
android:id="@+id/login_password"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:inputType="textPassword"
android:padding="@dimen/padding10"
/>
</com.google.android.material.textfield.TextInputLayout>
<com.google.android.material.button.MaterialButton
android:id="@+id/login_signin"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_margin="@dimen/margin10"
android:text="Sign in"
/>
<com.google.android.material.button.MaterialButton
style="@style/Widget.MaterialComponents.Button.OutlinedButton"
android:id="@+id/login_signup"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_margin="@dimen/margin10"
android:text="Sign UP"
app:strokeColor="@color/colorPrimaryDark"
/>
</LinearLayout>
</androidx.constraintlayout.widget.ConstraintLayout>
LoginActivity
package com.carpool.user;
import android.app.ProgressDialog;
import android.content.Context;
import android.content.Intent;
import android.os.AsyncTask;
import android.os.Bundle;
import android.util.Log;
import android.util.Pair;
import android.util.Patterns;
import android.view.View;
import android.widget.EditText;
import androidx.appcompat.app.AppCompatActivity;
import com.carpool.user.background.Back_Service;
import com.carpool.user.helper.PreferenceManager;
import com.carpool.user.webservices.JSONParse;
import com.carpool.user.webservices.RestAPI;
import com.carpool.user.webservices.Utility;
import com.google.android.material.button.MaterialButton;
import com.google.android.material.snackbar.Snackbar;
import org.json.JSONException;
import org.json.JSONObject;
import java.lang.ref.WeakReference;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
getSupportActionBar().setTitle("Login");
if (PreferenceManager.getLoggedIn(LoginActivity.this)) {
Intent back_intent = new Intent(LoginActivity.this, Back_Service.class);
stopService(back_intent);
startService(back_intent);
editEmail = findViewById(R.id.login_username);
editPassword = findViewById(R.id.login_password);
findViewById(R.id.login_signup).setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
startActivity(new Intent(LoginActivity.this, RegisterActivity.class));
}
});
mLoginButton.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
if (editEmail.getText().length() == 0) {
Snackbar.make(v, "Enter email.", Snackbar.LENGTH_SHORT).show();
editEmail.requestFocus();
} else if
(!(Patterns.EMAIL_ADDRESS.matcher(editEmail.getText().toString()).matches())) {
Snackbar.make(v, "Enter valid email.", Snackbar.LENGTH_SHORT).show();
editEmail.requestFocus();
} else if (editPassword.getText().length() == 0) {
Snackbar.make(v, "Enter password.", Snackbar.LENGTH_SHORT).show();
editPassword.requestFocus();
} else {
new LoginTask(LoginActivity.this)
.execute(editEmail.getText().toString().trim()
, editPassword.getText().toString().trim());
}
}
});
@Override
protected void onPreExecute() {
super.onPreExecute();
if (!mProgressDialog.isShowing()) {
mProgressDialog.setMessage("Please wait");
mProgressDialog.show();
}
}
@Override
protected String doInBackground(String... strings) {
String a = "back";
RestAPI api = new RestAPI();
try {
Log.d(TAG, "doInBackground: "+strings[0]+"-"+strings[1]);
JSONObject json = api.Login(strings[0], strings[1]);
Log.d(TAG, "doInBackground: "+json);
JSONParse jp = new JSONParse();
a = jp.Parse(json);
} catch (Exception e) {
a = e.getMessage();
}
return a;
}
@Override
protected void onPostExecute(String s) {
super.onPostExecute(s);
Log.d(TAG, "onPostExecute: " + s);
if (mProgressDialog.isShowing()) {
mProgressDialog.dismiss();
}
if (Utility.checkConnection(s)) {
Pair<String, String> mErrors = Utility.GetErrorMessage(s);
Utility.ShowAlertDialog(mContext.get(), mErrors.first, mErrors.second, false);
} else {
try {
JSONObject jsonObject = new JSONObject(s);
if (jsonObject.getString("status").equalsIgnoreCase("ok")) {
JSONObject details = jsonObject.getJSONArray("Data").getJSONObject(0);
if (details.getString("data2").equalsIgnoreCase("Pending_U")) {
} else if (details.getString("data2").equalsIgnoreCase("Pending_D")) {
} else if (details.getString("data2").equalsIgnoreCase("Rejected")) {
} else if (jsonObject.getString("status").equalsIgnoreCase("false")) {
Utility.ShowAlertDialog(mContext.get(), "Invalid Credentials"
, "You have entered an invalid username or password", false);
} else {
String error = jsonObject.getString("Data");
Log.d(TAG, "Error : " + error);
}
} catch (JSONException e) {
e.printStackTrace();
}
}
}
}
}
CarPool_Admin
AndroidManifest.xml
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
package="com.carpool.admin">
<uses-permission android:name="android.permission.INTERNET"/>
<application
android:allowBackup="true"
android:icon="@mipmap/ic_launcher"
android:label="@string/app_name"
android:roundIcon="@mipmap/ic_launcher_round"
android:supportsRtl="true"
android:usesCleartextTraffic="true"
android:theme="@style/AppTheme"
tools:ignore="GoogleAppIndexingWarning"
>
<activity android:name=".LoginActivity"
android:screenOrientation="portrait"
android:windowSoftInputMode="stateHidden">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<activity
android:name=".NavigationActivity"
android:label="@string/title_activity_navigation"/>
<activity android:name=".MainActivity"/>
<activity android:name=".ui.CabActivity"/>
<activity android:name=".ui.ActivityProfile"/>
</application>
</manifest>
Activity_login.xml
<?xml version="1.0" encoding="utf-8"?>
<androidx.constraintlayout.widget.ConstraintLayout
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintTop_toTopOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintEnd_toEndOf="parent"
>
<ImageView
android:layout_width="100dp"
android:layout_height="100dp"
android:layout_gravity="center"
android:src="@mipmap/ic_launcher_round"
android:layout_marginBottom="@dimen/margin10"
/>
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Car Pool Admin"
android:layout_gravity="center"
android:gravity="center"
android:layout_marginTop="@dimen/margin10"
android:layout_marginBottom="@dimen/margin10"
android:textColor="@android:color/black"
android:textSize="@dimen/size21"/>
<com.google.android.material.textfield.TextInputLayout
style="@style/Widget.MaterialComponents.TextInputLayout.OutlinedBox"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:hint="Username"
android:layout_margin="@dimen/margin10"
app:boxBackgroundMode="outline"
app:startIconDrawable="@android:drawable/sym_action_email"
app:startIconTint="@color/colorPrimary"
>
<com.google.android.material.textfield.TextInputEditText
android:id="@+id/login_username"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:inputType="textEmailAddress"
android:padding="@dimen/padding10"
/>
</com.google.android.material.textfield.TextInputLayout>
<com.google.android.material.textfield.TextInputLayout
style="@style/Widget.MaterialComponents.TextInputLayout.OutlinedBox"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:hint="Password"
android:layout_marginStart="@dimen/margin10"
app:boxBackgroundMode="outline"
android:layout_marginEnd="@dimen/margin10"
app:passwordToggleEnabled="true"
app:startIconDrawable="@android:drawable/ic_lock_lock"
app:startIconTint="@color/colorPrimary"
app:passwordToggleTint="@color/colorPrimary">
<com.google.android.material.textfield.TextInputEditText
android:id="@+id/login_password"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:inputType="textPassword"
android:padding="@dimen/padding10"
/>
</com.google.android.material.textfield.TextInputLayout>
<com.google.android.material.button.MaterialButton
android:id="@+id/login_signin"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_margin="@dimen/margin10"
android:text="Sign in"
/>
</LinearLayout>
</androidx.constraintlayout.widget.ConstraintLayout>
LoginActivity
package com.carpool.admin;
import android.app.ProgressDialog;
import android.content.Context;
import android.content.Intent;
import android.os.AsyncTask;
import android.os.Bundle;
import android.util.Log;
import android.util.Pair;
import android.util.Patterns;
import android.view.View;
import android.widget.EditText;
import androidx.appcompat.app.AppCompatActivity;
import com.carpool.admin.webservices.JSONParse;
import com.carpool.admin.webservices.RestAPI;
import com.carpool.admin.webservices.Utility;
import com.google.android.material.button.MaterialButton;
import com.google.android.material.snackbar.Snackbar;
import com.google.android.material.textfield.TextInputEditText;
import com.carpool.admin.helper.*;
import org.json.JSONException;
import org.json.JSONObject;
import java.lang.ref.WeakReference;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
getSupportActionBar().setTitle("Login");
if (PreferenceManager.getLoggedIn(LoginActivity.this)) {
editEmail = findViewById(R.id.login_username);
editPassword = findViewById(R.id.login_password);
mLoginButton.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
if (editEmail.getText().length() == 0) {
Snackbar.make(v, "Enter username.", Snackbar.LENGTH_SHORT).show();
editEmail.requestFocus();
}else if (editPassword.getText().length() == 0) {
Snackbar.make(v, "Enter password.", Snackbar.LENGTH_SHORT).show();
editPassword.requestFocus();
} else {
new LoginTask(LoginActivity.this)
.execute(editEmail.getText().toString(), editPassword.getText().toString());
}
}
});
@Override
protected void onPreExecute() {
super.onPreExecute();
if (!mProgressDialog.isShowing()) {
mProgressDialog.setMessage("Please wait");
mProgressDialog.show();
}
}
@Override
protected String doInBackground(String... strings) {
String result = "";
RestAPI restAPI = new RestAPI();
try {
@Override
protected void onPostExecute(String s) {
super.onPostExecute(s);
Log.d(TAG, "onPostExecute: " + s);
if (mProgressDialog.isShowing()) {
mProgressDialog.dismiss();
}
if (Utility.checkConnection(s)) {
Pair<String, String> mErrors = Utility.GetErrorMessage(s);
Utility.ShowAlertDialog(mContext.get(), mErrors.first, mErrors.second, false);
} else {
try {
JSONObject jsonObject = new JSONObject(s);
if (jsonObject.getString("status").equalsIgnoreCase("true")) {
PreferenceManager.setLoggedIn(mContext.get()
, true
, editEmail.getText().toString());
}
}
Output:
3.5 Conclusion
Conclusion
The Carpool Android App successfully provides a reliable and efficient platform for connecting
drivers and passengers traveling along similar routes, promoting ride-sharing as a cost-effective and
eco-friendly solution. Developed using Android Studio with Java and XML, and powered by a
MySQL database with PHP APIs, the app ensures seamless communication and secure data
management. Key features such as real-time GPS tracking, SOS emergency alerts, secure payment
integration, and chatbot support enhance user safety, convenience, and engagement. By reducing
travel costs, minimizing traffic congestion, and lowering carbon emissions, the application
contributes positively to environmental sustainability. Overall, the Carpool Android App
demonstrates a well-rounded and innovative approach to addressing modern commuting challenges
while ensuring a safe and user-friendly experience. the Carpooling Mobile Application not only
promotes resource optimization but also encourages a shift toward eco-friendly commuting solutions.
It provides a scalable and adaptable platform that can be further improved by incorporating advanced
features like AI-based route optimization and feedback systems, making it a valuable tool for modern
urban mobility.
The future of carpooling applications is promising, with advancements in AI and machine learning
enabling route optimization, dynamic pricing, and fraud detection. Blockchain technology can
enhance security and transparency by securing payment systems and ensuring reliable ride histories.
Integration with electric and autonomous vehicles will make carpooling more sustainable, reducing
carbon emissions and promoting eco-friendly travel. IoT-based monitoring can provide real-time
vehicle tracking and ensure vehicle health, enhancing the safety and reliability of rides. Additionally,
multi-modal transportation integration will allow seamless transitions between different transport
modes, improving lastmile connectivity for users.
Moreover, gamification and reward systems can boost user engagement, while expanding services to
rural and semi-urban areas can address transportation challenges in underserved communities.
Enhanced safety features, including SOS alerts and AI-based emergency responses, will increase user
trust. Collaboration with corporates and institutions can facilitate employee and student carpooling,
reducing congestion. Additionally, future carpooling apps can leverage voice assistants and chatbots
to enhance the user experience and provide personalized recommendations.
With global expansion and localization, carpooling apps can adapt to regional preferences,
contributing to sustainable urban mobility on a global scale.
List Of References
1] Bhumi Rakeshkumar Patel, Vivek Rajivkumar Patel, “ERIDE: Carpooling Website” Science,
Volume: 08 Issue: 08 | Aug 2021, irjet.
2] Sasikumar C, Jaganathan, “A Dynamic Carpooling System with Social Network Based Filtering”,
Volume - 8, Issue - 3, Year – 2017, ijersonline.org .
3] Surbhi Dhar, Sandra Arun, Vivek Dubey, Nilesh Kulal,” App for Ride Sharing”, Volume: 07 Issue:
03 , Mar 2020, irjet
4]Dejan Dimitrijević, Nemanja Nedić, ”Real-time carpooling and ride-sharing: Position paper on
design concepts, distribution and cloud computing strategies”, Faculty of Technical Sciences,
TrgDositejaObradovića 6, 21000,Novi Sad, Serbia.
6]Amirkiaee, S. Y., & Evangelopoulos, N. (2018). Why do people rideshare? Anexperimental study.
Transportation Research Part F: Traffic Psychology and Behaviour, 55, 9–24.
https://doi.org/10.1016/j.trf.2018.02.025.
7]Bachmann, F., Hanimann, A., Artho, J., & Jonas, K. (2018). What drives peopleto carpool?
Explaining carpooling intention from the perspectives of carpooling passengers and drivers.
Transportation Research Part F: Traffic Psychology and Behaviour, 59(A), 260–
268. https://doi.org/10.1016/j.trf.2018.08.022.
9]Bonsall, P. W., Spencer, H., & Tang, W. (1984). What makes a car-sharer?
Transportation, 12(2), 117–114. https://doi.org/10.1007/BF00167372.
10]Clavel, R., & Legrand, P. (2009). Le covoiturage dynamique: Etude préalableavant expérimentation
[Dynamic carpooling: Preliminary study beforeexperimentation]. Lyon: Certu.