NGO Management System Report From Digicoders 2023
NGO Management System Report From Digicoders 2023
PROJECT REPORT
On
DIPLOMA
In
Session:2023-2024
My early gratitude goes to HOD of College and all other faculty members of
Computer Science and Engineering Department who, with their encouraging and caring words
and most valuable suggestion have contributed directly or indirectly in a significant way
towards completion of this project report.
I am indebted to all my classmates from Computer Science and Engineering, for taking
an interest in discussing my problems and encouraging me.
Last but not least, I owe a debt of gratitude to my family for their consistent
support, sacrifice, candid views, and meaningful suggestions at the different stages of my work.
VIth Semester
Department of Computer Science and Engineering
This is to certify that the project report entitled “NGO Management System” is done by me is an
authentic work carried out for the partial fulfillment of the requirements for the award of the Diploma
in “(Computer Science & Engineering)”under the guidance of Mr. Er. Himanshu Kashyap. The
matter embodied in this project work has not been submitted earlier for award of any degree or
diploma to the best of my knowledge and belief.
Page
1. Introduction…................................................................................................10-12
1.1. Overview of Organization......................................................................................................10-10
1.2. Project Introduction...............................................................................................................10-10
1.3. Objectives...............................................................................................................................10-11
1.4. Problem Definition.................................................................................................................11-12
2. System Analysis.............................................................................................12-21
2.1. Objective................................................................................................................................12-12
2.2. SDLC Phases..........................................................................................................................12-12
2.2.1. Preliminary Investigation.......................................................................................................12-14
2.2.2. System Analysis.....................................................................................................................14-14
2.2.3. System Design........................................................................................................................14-14
2.2.4. Coding....................................................................................................................................14-15
2.2.5. Testing....................................................................................................................................15-15
2.2.6. Implementation......................................................................................................................15-15
2.2.7. Maintenance...........................................................................................................................15-15
2.3. Process Description................................................................................................................16-16
2.4. Project Model Used................................................................................................................16-17
2.5. ER-Diagram...........................................................................................................................18-19
2.6. Data Flow Diagram...............................................................................................................20-20
8. Input-Output Forms......................................................................................42-65
9. Future Scope…...............................................................................................66-66
10. Conclusion......................................................................................................66-66
Page
Page
6. TOP-DOWN DESIGNING….................................................................................23
7. BOTTOM-UP DESIGNING…...............................................................................24
Digicoders is an organization working in both software development and software training, which
aims to make all the specials of its client successful through their coding as well as to make students
more competent to work with a well reputed organization.
We are proud of our high-quality standards. These standards allow us to provide our customers with
reliable and error-free software applications, regardless of complexity. Our top-notch developers use
the latest software methodologies and technologies. This means that they can concentrate on our
clients' business goals and keep them involved in every stage through the entire project. Our
meticulous approach has helped us build our excellent track record with no failed or aborted projects.
We are in the business of change, managing complexity with an unparalleled insight, looking beyond
the horizon of IT with resources focused on solutions. Becoming successful is a skill but one cannot
perfect it without practice.
Our NGO Management System website aims to streamline and enhance the operations of non-profit organizations.
It provides a user-friendly platform for NGOs to manage volunteers, donations, projects, and communication
efficiently. This web-based solution empowers NGOs to make a more significant impact on their mission while
1.3. OBJECTIVE
The objectives of the NGO Management System website are:
1. **Streamline Operations:** Simplify administrative processes to increase efficiency within the organization.
3. **Donation Management:** Improve the tracking and management of donations, including online fundraising
capabilities.
4. **Project Management:** Enhance project planning, monitoring, and reporting for better project outcomes.
5. **Communication:** Foster improved communication and collaboration within the organization and
With external stakeholders.
6. **Transparency and Accountability:** Ensure transparent financial tracking and reporting to enhance
organizational credibility.
7. **Empower NGOs:** Provide user-friendly tools that empower NGOs to make a more significant
impact on their missions and communities.
Low Functionality
With the existing system, the biggest problem was the low functionality. The problem faced
hampered the work. For small task like adding any new node to server or deleting a node or keeping
daily record we have to appoint minimum two or three employee.
In the existing system, humans performed all the tasks. As in the human tendency, error is also a
possibility. Therefore, the inputs entered by the person who is working in the Company, in the
registers may not be absolutely foolproof and may be erroneous. As a result of wrong input, the
output reports etc. Will also be wrong which would in turn affect the performance.
Portability Problem
System that existed previously was manual. As a result, the system was less portable. One has to
carry the loads of many registers to take the data from one place to another. A big problem was that
the system was less flexible and if we wanted to calculate yearly or monthly maintenance
report or
Security-
Security concerns were also one of the motives of the Company for the need of software. In the
registers, the data is not secure as anybody can tamper with the data written in the registers. While in
this software, just a password makes it absolutely secure from the reach of unauthorized persons.
Data Redundancy
In the case of manual system, the registers are maintained in which, a lot of data is written.
Processing Speed
In manual system maintaining a register and performing the necessary calculation has proved to be a
troublesome job, which takes a lot of time and may affect the performance of the Company. But with
this software we can have all the tasks performed in a fraction of second by a single click thus
making the troublesome job much easier.
Manual Errors
When a number of tough tasks are prepared by the humans like preparation of reports, performing
long calculation then some human error are obvious due to a number of factors like mental strain,
tiredness etc. But as we all know that computer never get tired irrespective of the amount of work it
has to do. So this software can nullify the probability of manual error that improve the performance.
Complexity in Work
In manual system whenever a record is to be updated or to be deleted a lot of cutting and overwriting
needs to be done on the registers that are concerned that are deleted or updated record, which makes
the work very complex.
2. SYSTEM ANALYSIS
2.1. Objective:
System analysis is conducted for the purpose of studying a system or its parts in order to identify its
objectives. It is a problem solving technique that improves the system and ensures that all the
components of the system work efficiently to accomplish their purpose.
This is the first phase of the system development life cycle. In this phase we tend to find out the
needs of the client –what exactly does the client want? Before the development of any system the
important point is to know the needs, objectives and scope of the system.
Feasibility Study: -
Feasibility study is the step of preliminary study of the system development life cycle. Things are
always easy at the beginning in any software process. In fact nothing is in feasible with unlimited
time and resources. But it is not the fact. So, practically we have to do in limited resources in a
restricted time margin. So for the system to be feasible, following points we have to consider.
The feasibility study is conducted to check whether the candidate system is feasible. The system
which is selected to be the best against the criteria is there after designed and developed. The
feasibility study takes in to consideration, the risks involved in the project development beforehand.
Therefore in this phase we have to do feasibility study which is the test of the website according to its
work ability, impact on the organization, ability to meet user need and effective use of resources. We
do the feasibility study for website to analyze the risks, costs and benefits relating to economics,
technology and user organization. There are several types of feasibility depending on the aspect they
cover. Import of these includes:
Economic Feasibility:
It deals with question related to the economy. It comprise of the following questions:-
Are there sufficient benefits in creating the system to make the cost acceptable?
Are the costs of not creating the system so great that the project must be undertaken?
Legal Feasibility:
It deals with the question related to the legal issues. It comprise of the following questions: -
Contract Signing
Operational Feasibility:
The operational feasibility consists of the following activity:
Will the system be useful if it is developed &implemented?
Will there be resistance from employee?
Request Approval: -
Physical SystemDesign
2.2.4. Coding:-
Coding is the phase in which a developer codes using any programming languages. Coding
constitutes only 20% of the whole project and which is easier to write. The coding work is also done
in the teams; development of the system is usually done under the modular programming style, which
can be either top-down approach or bottom-up approach.
2.2.5. Testing:-
Testing is the phase in which the system that has been developed is tested. Testing comprises of the
60% of the overall development of the system. Testing of the system is important because testing
aims to uncover the different errors in the system. There are various different testing techniques that
can be used for the testing of the system.
2.2.6. Implementation:-
Implementation process involved the installation of software on user’s side. Implementation process
actually depends on type of a system & various. Opting for suitable conversion approach is a step
implementation. The conversion processes are as follows:-
ParallelConversion
Pilot ConversionApproach
Phase In ConversionApproach
2.2.7. Maintenance: -
Merely developing the system is not important but also maintenance is important. The company that
has built the system provides for some time free of cost maintenance to the client and after that period
it is usually a paid service.
This model has the same phases as the waterfall model, but with fewer restrictions. Generally
the phases occur in the same order as in the waterfall model, but they may be conducted in several
cycles.
Useable product is released at the end of the each cycle, with each release providing additional
functionality. Customers and developers specify as many requirements as possible and prepare a SRS
document. Developers and customers then prioritize these requirements. Developers implement the
specified requirements in one or more cycles of design, implementation and test based on the
definedpriorities.
The procedure itself consists of the initialization step, the iteration step, and the Project Control List.
The initialization step creates a base version of the system. The goal for this initial implementation is
to create a product to which the user can react. It should offer a sampling of the key aspects of the
problem and provide a solution that is simple enough to understand and implement easily. To guide
the iteration process, a project control list is created that contains a record of all tasks that need to be
performed. It includes such items as new features to be implemented and areas of redesign of the
existing solution. The control list is constantly being revised as a result of the analysisphase.
The iteration involves the redesign and implementation of iteration is to be simple, straightforward,
and modular, supporting redesign at that stage or as a task added to the project control list. The
level of design detail is not dictated by the iterative approach. In a light-weight iterative project the
code may represent the major source of documentationof the system; however, in a
critical iterative project a formal Software Design Documentmay be used. The analysis of iteration
is based upon user feedback, and the program analysis facilities available. It involves analysis of the
structure, modularity, usability, reliability, efficiency, & achievement of goals. The project control
list is modified in light of the analysis results.
PHASES:
Incremental development slices the system functionality into increments (portions). In each
increment, a slice of functionality is delivered through cross- discipline work, from the
2.5. ER-Diagram
Introduction: -
In software engineering, an entity-relationship model (ERM) is an abstract and conceptual
representation of data. Entity-relationship modeling is a database modelingmethod, used to produce a
type of conceptual schema or semantic data model of a system, often a relational database, and its
requirements in a top-down fashion. Diagrams created by this process are called entity-relationship
diagrams, ER diagrams, or ERDs. ER Diagrams depicts relationship between data objects. The
E-R Diagram
Introduction:-
DFD is an acronym for the word Data Flow Diagram. DFD is a pictorial representation of the system.
DFD is a graphical representation of the flow of data through the information system. DFD are also
used for the visualization of data processing (structured design). ADFD provides no information about
the timings of the process, or about whether process will operate in parallel or sequence. DFD is an
important technique for modeling system’s high-level detail by showing how input data is transformed
to output results through a sequence of functional transformations. DFD reveal relationships among
between the various components in a program or system. The strength of DFD lies in the fact that
using few symbols we are able to express program design in an easier manner. ADFD can be used to
represent the following:-
External Entity sending and receiving data. Process that change the data.
Flow of data within the system. Data Storage locations.
Uses of DFD:-
The main uses of data flow diagrams are as follows: -
DFD is a method of choice for representation of showing of information through a system because of
the following reasons:-
0. Level DFD
The software requirement specification document enlists all necessary requirements for project
development. To derive the requirements we need to have clear and thorough understanding of the
products to be developed. This is prepared after detailed communications with project team and the
customer.
One year free support for rectifying system bugs including front end and beck end will be provided.
During warranty period Software Engineers will be responsible for removing bugs and improving it.
After one year support can be extended @ 20% of the total product deployment cost.
The top - down designing approach started with major components of the system. It is a stepwise
refinement which starts from an abstract design, in each steps the design is refined two or more
concrete levels until we reach a level where no – more refinement is possible or not needed.
In bottom – up designing the most basic and primitive components are designed first, and we proceed
to higher level components. We work with layers of abstractions and abstraction are implemented until
the stage is reached where the operations supported by the layer is complete.
In this project we are following Mixed Approach i.e. A combination of top – down and bottom – up.
We are developing some of the components using top – down designing approach (e.g. the WebPages)
and the some components in bottom – up designing approach (e.g. the middle tier classes)
MessageList Adapter.java
package com.example.tptchatroom.Adapter;
import android.app.AlertDialog;
import android.content.Context;
import android.content.DialogInterface;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.TextView;
import android.widget.Toast;
import androidx.annotation.NonNull;
import androidx.recyclerview.widget.RecyclerView;
import com.example.tptchatroom.MessageDetail;
import com.example.tptchatroom.R;
import com.example.tptchatroom.model.messagemodel;
import com.google.firebase.auth.FirebaseAuth;
import com.google.firebase.database.FirebaseDatabase;
import java.util.ArrayList;
@NonNull
@Override
public RecyclerView.ViewHolder onCreateViewHolder(@NonNull ViewGroup parent, int
viewType) {
if (viewType == 1) {
View v = LayoutInflater.from(context).inflate(R.layout.sendersimpldesegin,
parent, false);
return new SenderViewHolder(v);
} else {
View v = LayoutInflater.from(context).inflate(R.layout.receviersimpledegin,
parent, false);
return new ReceiverViewHolder(v);
}
@Override
public void onBindViewHolder(@NonNull RecyclerView.ViewHolder holder, int position) {
if (holder.getClass() == SenderViewHolder.class) {
((SenderViewHolder) holder).sendermsg.setText(msglist.get(position).msg);
((SenderViewHolder)
holder).sendermsgtime.setText(msglist.get(position).msgtime);
}
else {
((ReceiverViewHolder) holder).receivermsg.setText(msglist.get(position).msg);
((ReceiverViewHolder)
holder).receivermsgtime.setText(msglist.get(position).msgtime);
}
holder.itemView.setOnLongClickListener(new View.OnLongClickListener() {
@Override
public boolean onLongClick(View view) {
AlertDialog.Builder alert=new AlertDialog.Builder(context);
alert.setTitle("Delete Message");
alert.setMessage("Do You Want To Delete the Message");
alert.setPositiveButton("yes", new DialogInterface.OnClickListener() {
@Override
public void onClick(DialogInterface dialogInterface, int i) {
//Toast.makeText(context,senderreceiver ,
Toast.LENGTH_SHORT).show();
// Toast.makeText(context, "msglist".get,
Toast.LENGTH_SHORT).show();
@Override
public int getItemViewType(int position) {
if(msglist.get(position).senderid.equals(FirebaseAuth.getInstance().getCurrentUser().getU
id()))
return 1;
else
return 2;
}
@Override
public int getItemCount() {
return msglist.size();
}
//refernce of sender message and sender message time Textview from sendermsgsample
class SenderViewHolder extends RecyclerView.ViewHolder
{
TextView sendermsg,sendermsgtime;
public SenderViewHolder(@NonNull View itemView) {
super(itemView);
sendermsg=itemView.findViewById(R.id.sendermsg);
sendermsgtime=itemView.findViewById(R.id.sendermsgtime);
}
}
class ReceiverViewHolder extends RecyclerView.ViewHolder
{
TextView receivermsg,receivermsgtime;
public ReceiverViewHolder(@NonNull View itemView) {
super(itemView);
receivermsg=itemView.findViewById(R.id.receivermsg);
receivermsgtime=itemView.findViewById(R.id.receivermsgtime);
}
}
}
31 Ltd. Lucknow (U.P)
DigiCoders Technologies Pvt.
StatusListAdapter.java
package com.example.tptchatroom.Adapter;
import android.content.Context;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.ImageView;
import android.widget.TextView;
import androidx.annotation.NonNull;
import androidx.recyclerview.widget.RecyclerView;
import com.example.tptchatroom.ChatFragment;
import com.example.tptchatroom.R;
import com.example.tptchatroom.chatRoom;
import com.example.tptchatroom.model.statusmodel;
import com.example.tptchatroom.model.statusmodel;
import com.devlomi.circularstatusview.CircularStatusView;
import com.example.tptchatroom.model.statusmodel;
import com.squareup.picasso.Picasso;
import java.util.ArrayList;
import omari.hamza.storyview.StoryView;
import omari.hamza.storyview.callback.StoryClickListeners;
import omari.hamza.storyview.model.MyStory;
@NonNull
@Override
public ViewHolder onCreateViewHolder(@NonNull ViewGroup parent, int viewType) {
View v= LayoutInflater.from(context).
inflate(R.layout.statussampledesign,parent,false);
return new ViewHolder(v);
}
@Override
public void onBindViewHolder(@NonNull ViewHolder holder,int position) {
32 Ltd. Lucknow (U.P)
DigiCoders Technologies Pvt.
holder.statususername.setText(statuslist.get(position).username);
holder.statususertime.setText(statuslist.get(position).statusdate);
holder.circularstatus.setPortionsCount(statuslist.get(position).status.size()); int
statussize=statuslist.get(position).status.size();
Picasso.get().load(statuslist.get(position).status.get(statussize-
1)).placeholder(R.drawable.user).
into(holder.statususerimg);
//show stories on click of user status icon
holder.statususerimg.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View view) {
@Override
public void onTitleIconClickListener(int position) {
//your action
}
}) // Optional Listeners
.build() // Must be called before calling show method
.show();
}
});
}
@Override
public int getItemCount() {
return statuslist.size();
}
UserList.Adapter.java
package com.example.tptchatroom.Adapter;
import android.content.Context;
import android.content.Intent;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.ImageView;
import android.widget.TextView;
import androidx.annotation.NonNull;
import androidx.recyclerview.widget.RecyclerView;
import com.example.tptchatroom.MessageDetail;
import com.example.tptchatroom.R;
import com.example.tptchatroom.model.Usermodel;
import com.squareup.picasso.Picasso;
import java.util.ArrayList;
@NonNull
@Override
public ViewHolder onCreateViewHolder(@NonNull ViewGroup parent, int viewType) {
View v=LayoutInflater.from(context).inflate(R.layout.sampleuserdesign,parent,false);
return new ViewHolder(v);
}
@Override
public void onBindViewHolder(@NonNull ViewHolder holder, int position) {
Usermodel user=list.get(position);
username.setText(user.name);
34 Ltd. Lucknow (U.P)
DigiCoders Technologies Pvt.
userlastmsg.setText(user.email);
Picasso.get().load(user.profilepic).placeholder
(R.drawable.ic_baseline_account_circle_24).into(userprofilepic);
holder.itemView.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View view) {
Intent intent=new Intent(context, MessageDetail.class);
intent.putExtra("name",user.name);
intent.putExtra("uid",user.uid);
intent.putExtra("profilpic",user.profilepic);
context.startActivity(intent);
}
});
}
@Override
public int getItemCount() {
return list.size();
}
super(itemView);
userprofilepic=itemView.findViewById(R.id.userprofiepic);
username=itemView.findViewById(R.id.username);
userlastmsg=itemView.findViewById(R.id.userlastmsg);
}
}
}
Chat menu.xml
<?xml version="1.0" encoding="utf-8"?>
<menu xmlns:android="http://schemas.android.com/apk/res/android">
<item android:title="Setting"
android:id="@+id/menu_setting"></item>
<item android:title="Logout"
android:id="@+id/menu_logout"></item>
</menu>
Manifest.xml
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
<application
android:allowBackup="true"
android:dataExtractionRules="@xml/data_extraction_rules"
android:fullBackupContent="@xml/backup_rules"
android:icon="@drawable/app1"
android:label="CHAT NOW"
android:roundIcon="@mipmap/ic_launcher_round"
android:supportsRtl="true"
android:theme="@style/Theme.TPTCHATROOM"
tools:targetApi="31">
<activity
android:name=".MessageDetail"
android:exported="false" />
<activity
android:name=".chatRoom"
android:exported="false" />
<activity
android:name=".MainActivity"
android:exported="false" />
<activity
android:name=".SignIn"
android:exported="true">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
</manifest>
Color.xml
<?xml version="1.0" encoding="utf-8"?>
<resources>
<color name="purple_200">#21a6a5</color>
<color name="purple_500">#21a6a5</color>
<color name="purple_700">#21a6a5</color>
<color name="green">#21a6a5</color>
<color name="teal_200">#FF03DAC5</color>
<color name="darkgreen">#ff018786</color>
<color name="teal_700">#FF018786</color>
<color name="black">#FF000000</color>
<color name="white">#FFFFFFFF</color>
</resources>
Strings.xml
Themes.xml
<resources xmlns:tools="http://schemas.android.com/tools">
<!-- Base application theme. -->
<style name="Theme.TPTCHATROOM"
parent="Theme.MaterialComponents.DayNight.DarkActionBar">
<!-- Primary brand color. -->
<item name="colorPrimary">@color/green</item>
<item name="colorPrimaryVariant">@color/darkgreen</item>
<item name="colorOnPrimary">@color/white</item>
<!-- Secondary brand color. -->
<item name="colorSecondary">@color/teal_200</item>
<item name="colorSecondaryVariant">@color/teal_700</item>
<item name="colorOnSecondary">@color/black</item>
<!-- Status bar color. -->
<item name="android:statusBarColor"
tools:targetApi="l">?attr/colorPrimaryVariant</item>
<!-- Customize your theme here. -->
</style>
<style name="roundborder" parent="">
<item name="cornerFamily">rounded</item>
<item name="cornerSize">20dp</item>
<item name="color">@color/black</item>
</style>
</resources>
6. DATA MODELING
6.1 List of Table
37 Ltd. Lucknow (U.P)
DigiCoders Technologies Pvt.
1. RealTime Database
2. Message Table
3. Story Table
4. User Table
“Software Testing can be looked upon as one among much process, an organization performs, and that
provides the last opportunity to correct any flaws in the developed system. Software Testing includes
selecting test data that have more probability of giving errors.” The first step in System testing is to
develop the plan that all aspect of system .Complements, Correctness, Reliability and Maintainability.
Software is to be tested for the best quality assurance, an assurance that system meets the specification
and requirement for its intended use and performance.
System Testing is the most useful practical process of executing the program with the implicit
intention of finding errors that makes the programfail.
Types of Testing:
Testing against specification of system or component. Study it by examining its inputs and related
outputs. Key is to devise inputs that have a higher likelihood of causing outputs that reveal the
presence of defects. Use experience and knowledge of domain to identify such test cases. Failing this a
systematic approach may be necessary. Equivalence partitioning is where the input to a program falls
into a number of classes,
Interface errors.
Performance errors.
Testing based on knowledge of the structure of component (e.g. by looking at source code). The
advantage is that structure of the code can be used to find out how many test cases need to be
performed. Knowledge of the algorithm (examination of the code) can be used to identify the
equivalence partitions. Path testing is where the tester aims to exercise every independent execution
path through the component. All conditional statements were tested for both true and false cases.
Unit Testing:
Unit testing concentrates on each unit of the software as implemented in the code. This is done to
check syntax and logical errors in programs. At this stage, the test focuses on each module
individually, assuring that it functions properly as a unit. In our case, we used extensive white-box
testing at the unit testing stage.
A developer and his team typically do the unit testing do the unit testing is done in parallel with
coding; it includes testing each function and procedure.
Bottom up approach for testing i.e. continuous testing of an application as new functionality is
added; Application functionality and modules should be independent enough to test separately done
by programmers or by testers.
FunctionalTesting:
This type of testing ignores the internal parts and focus on the output is as per requirement or not
.Black box type testing geared to functionality requirements of an application.
System Testing:
Entire system is tested as per the requirements. Black box type test that is based on overall requirement
specifications covers all combined parts of a system.
End-to-End Testing:
Similar to system testing ,involves testing of a complete application environment in a situation that
mimics real-world use, such as interacting with a database ,using network communications, or
interacting with hardware, applications, or system if appropriate.
Regression Testing:
Normally this type of testing is done to verify if system meets the customer specified requirements.
User or customers do this testing to determine whether to accept application.
Performance Testing:
Term often used interchangeably with “stress” and “load” testing, To check whether system meets
performance requirements, Used different performance and load tools to do this.
Alpha Testing:
In house virtual user environment can be created for this type of testing. Testing is done at the end of
development .Still minor design changes may be made as a result of such testing.
Beta Testing:
Testing typically done by end-users or others. This is final testing before releasing application for
commercial purpose.
<com.google.android.material.tabs.TabLayout
android:id="@+id/chattab"
android:layout_width="match_parent"
android:layout_height="50sp"
android:background="@color/purple_700"
app:tabTextColor="@color/black"
app:tabSelectedTextColor="@color/black"
app:tabIndicator="@color/white"
app:tabIndicatorHeight="2sp"
android:elevation="5sp"
>
<com.google.android.material.tabs.TabItem
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Chat" />
<com.google.android.material.tabs.TabItem
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="stories" />
<com.google.android.material.tabs.TabItem
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="profile" />
</com.google.android.material.tabs.TabLayout>
<!--View pager to hold fragments-->
<androidx.viewpager2.widget.ViewPager2
android:layout_width="match_parent"
android:layout_height="match_parent"
android:id="@+id/viewpager">
</androidx.viewpager2.widget.ViewPager2>
</LinearLayout>
ChatActivity.java
package com.example.tptchatroom;
import androidx.annotation.NonNull;
import androidx.appcompat.app.AppCompatActivity;
53 Ltd. Lucknow (U.P)
DigiCoders Technologies Pvt.
import androidx.viewpager2.widget.ViewPager2;
import android.content.Intent;
import android.os.Bundle;
import android.view.Menu;
import android.view.MenuItem;
import android.view.View;
import com.google.android.material.tabs.TabLayout;
import com.google.firebase.auth.FirebaseAuth;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_chat_room);
view.setCurrentItem(tab.getPosition());
}
@Override
public void onTabUnselected(TabLayout.Tab tab) {
@Override
public void onTabReselected(TabLayout.Tab tab) {
}
});
//change position oftab or chnge of viewpager position
view.registerOnPageChangeCallback(new ViewPager2.OnPageChangeCallback() {
@Override
public void onPageScrolled(int position, float positionOffset, int
positionOffsetPixels) {
super.onPageScrolled(position, positionOffset, positionOffsetPixels);
Tab.getTabAt(position).select();
}
});
54 Ltd. Lucknow (U.P)
DigiCoders Technologies Pvt.
}
@Override
protected void onStart() {
super.onStart();
FirebaseAuth auth=FirebaseAuth.getInstance();
if(auth.getCurrentUser()==null)
{
Intent i=new Intent(this,SignIn.class);startActivity(i);
}
}
//lets bind option menu in this activity
@Override
public boolean onCreateOptionsMenu(@NonNull Menu menu) {
getMenuInflater().inflate(R.menu.chat_menu, menu);
return super.onCreateOptionsMenu(menu);
}
@Override
public boolean onOptionsItemSelected(@NonNull MenuItem item){
switch (item.getItemId())
{
case R.id.menu_setting:
break;
case R.id.menu_logout:
FirebaseAuth auth= FirebaseAuth.getInstance();
auth.signOut();
Intent intent=new Intent(this,SignIn.class);
startActivity(intent);
break;
}
return super.onOptionsItemSelected(item);
}
}
activity_main.xml
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout 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"
tools:context=".MainActivity"
android:orientation="vertical"
android:background="@drawable/chitchat2"
android:padding="20sp"
android:paddingTop="50sp">
<ScrollView
android:layout_width="match_parent"
android:layout_height="wrap_content">
<LinearLayout
android:layout_width="match_parent"
55 Ltd. Lucknow (U.P)
DigiCoders Technologies Pvt.
android:layout_height="match_parent"
android:orientation="vertical">
<ImageView
android:layout_width="120sp"
android:layout_height="120sp"
android:src="@drawable/what"
android:layout_gravity="center"
android:layout_marginTop="80sp"></ImageView>
<TextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="Whatsapp"
android:textSize="26sp"
android:fontFamily="cursive"
android:layout_marginTop="10sp"
android:gravity="center"
android:textStyle="bold"
android:textColor="@color/white"></TextView>
<EditText
android:layout_width="match_parent"
android:layout_height="40sp"
android:layout_marginTop="15sp"
android:hint="your name..."
android:background="@drawable/textcolor"
android:id="@+id/txtname"
android:paddingLeft="10dp"
android:textColorHint="@color/black"></EditText>
<EditText
android:layout_width="match_parent"
android:layout_height="40sp"
android:layout_marginTop="15sp"
android:hint="your email.."
android:background="@drawable/textcolor"
android:id="@+id/txtemail"
android:paddingLeft="10dp"
android:textColorHint="@color/black"></EditText>
<EditText
android:layout_width="match_parent"
android:layout_height="40sp"
android:layout_marginTop="15sp"
android:hint="Password"
android:background="@drawable/textcolor"
android:id="@+id/pass"
android:paddingLeft="10dp"
android:textColorHint="@color/black"></EditText>
<TextView
android:layout_width="150dp"
android:layout_height="wrap_content"
android:text="Already have account?"
android:gravity="center"
android:layout_margin="10sp"
android:layout_gravity="center"
android:textStyle="bold"
android:background="@drawable/passwordbg"
android:textColor="@color/black"
android:onClick="openSignIn"></TextView>
56 Ltd. Lucknow (U.P)
DigiCoders Technologies Pvt.
<Button
android:layout_width="100sp"
android:layout_height="wrap_content"
android:padding="10sp"
android:text="Sign UP"
android:background="@drawable/textcolor"
android:id="@+id/btnregister"
android:layout_gravity="center"
android:shadowColor="@color/white"></Button>
</LinearLayout>
</ScrollView>
</LinearLayout>
MainActivity.java
package com.example.tptchatroom;
import androidx.annotation.NonNull;
import androidx.appcompat.app.AppCompatActivity;
import android.app.ProgressDialog;
import android.content.Intent;
import android.os.Bundle;
import android.view.View;
import android.widget.Button;
import android.widget.EditText;
import android.widget.Toast;
import com.google.android.gms.tasks.OnCompleteListener;
import com.google.android.gms.tasks.Task;
import com.google.firebase.auth.AuthResult;
import com.google.firebase.auth.FirebaseAuth;
import com.google.firebase.database.FirebaseDatabase;
import java.util.Calendar;
import java.util.HashMap;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
//create a progree dialog
ProgressDialog pr=new ProgressDialog(this);
pr.setTitle("please wait..");
pr.setMessage("we are creating your account");
// get refernce of all element
EditText txtname=findViewById(R.id.txtname);
EditText txtemail=findViewById(R.id.txtemail);
EditText txtpass=findViewById(R.id.pass);
Button btn=findViewById(R.id.btnregister);
//click event of button
btn.setOnClickListener(new View.OnClickListener() {
FirebaseDatabase.getInstance().getReference().child("user").child(id).setValue(hashMap);
Toast.makeText(MainActivity.this, "Account Created
Successfully", Toast.LENGTH_SHORT).show();
Intent intent=new Intent(MainActivity.this,SignIn.class);
startActivity(intent);
}
else
{
Toast.makeText(MainActivity.this,
task.getException().getMessage()+"", Toast.LENGTH_LONG).show();
}
}
});
}
});
Activity_sign_in.xml
<ScrollView
android:layout_width="match_parent"
android:layout_height="700dp">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical"
>
<ImageView
android:layout_width="120sp"
android:layout_height="150sp"
android:layout_marginVertical="10dp"
android:layout_marginTop="100sp"
android:layout_gravity="center"
android:layout_marginHorizontal="108dp"
android:src="@drawable/what"></ImageView>
<TextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:fontFamily="cursive"
android:gravity="center"
android:text="Let's Talk"
android:textSize="30sp"
android:textStyle="italic"
android:textColor="@color/white"
android:layout_marginBottom="30dp"></TextView>
<EditText
android:id="@+id/txtemail"
android:layout_width="match_parent"
android:layout_height="40sp"
android:layout_marginTop="15sp"
android:background="@drawable/textcolor"
android:hint="Your Email.."
android:paddingLeft="10dp"
android:textStyle="bold"
android:textColorHint="@color/black"
android:textColor="@color/white"></EditText>
<EditText
android:id="@+id/pass"
android:layout_width="match_parent"
59 Ltd. Lucknow (U.P)
DigiCoders Technologies Pvt.
android:layout_height="40sp"
android:layout_marginTop="30sp"
android:background="@drawable/textcolor"
android:hint="Password"
android:textStyle="bold"
android:paddingLeft="10dp"
android:inputType="textPassword"
android:textColorHint="@color/black"
android:textColor="@color/white"></EditText>
<TextView
android:layout_width="80dp"
android:layout_height="wrap_content"
android:layout_margin="20sp"
android:layout_marginTop="300dp"
android:gravity="center"
android:layout_gravity="center"
android:background="@drawable/textcolor"
android:text="New User"
android:textColor="@color/black"
android:textStyle="bold"
android:onClick="openSignIn"></TextView>
<Button
android:layout_width="100sp"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:id="@+id/button_sign"
android:padding="15sp"
android:background="@drawable/textcolor"
android:text="Sign In"
android:layout_marginTop="50dp"
android:layout_marginRight="80dp"></Button>
</LinearLayout>
</ScrollView>
</LinearLayout>
SignInActivity.java
package com.example.tptchatroom;
import androidx.annotation.NonNull;
import androidx.appcompat.app.AppCompatActivity;
import android.content.Intent;
import android.os.Bundle;
import android.view.View;
import android.widget.Button;
import android.widget.EditText;
import android.widget.Toast;
import com.google.android.gms.tasks.OnCompleteListener;
import com.google.android.gms.tasks.Task;
import com.google.firebase.auth.AuthResult;
import com.google.firebase.auth.FirebaseAuth;
60 Ltd. Lucknow (U.P)
DigiCoders Technologies Pvt.
import com.google.firebase.database.FirebaseDatabase;
import java.util.Calendar;
import java.util.HashMap;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_sign_in);
//get reference of all element
EditText txtemail = findViewById(R.id.txtemail);
EditText txtpass = findViewById(R.id.pass);
Button btnsignin = findViewById(R.id.button_sign);
//create onclicklistener of button signin
btnsignin.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View view) {
//show the progree dialogue at activity
if(task.isSuccessful())
{
//Toast.makeText(SignIn.this, "welcome",
Toast.LENGTH_SHORT).show();
Intent intent=new Intent(SignIn.this,chatRoom.class);
startActivity(intent);
}
else
{
//Toast.makeText(SignIn.this,
task.getException().getMessage()+"", Toast.LENGTH_LONG).show();
}
}
});
}
});
}
Fragment_stories.xml
61 Ltd. Lucknow (U.P)
DigiCoders Technologies Pvt.
<?xml version="1.0" encoding="utf-8"?>
<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
tools:context=".StoriesFragment">
<LinearLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:orientation="vertical"
android:background="@drawable/chitchat2"
>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="100dp"
android:orientation="horizontal"
android:padding="10sp"
android:id="@+id/addstory"
>
<ImageView
android:layout_width="45sp"
android:layout_height="45sp"
android:src="@drawable/ic_baseline_update_24"
android:id="@+id/addstory"
></ImageView>
<TextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_gravity="center_horizontal"
android:layout_marginLeft="5dp"
android:textColor="@color/white"
android:textSize="30sp"
android:textStyle="normal"
android:text="Update Story"></TextView>
</LinearLayout>
<androidx.recyclerview.widget.RecyclerView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:id="@+id/storyrecycle"></androidx.recyclerview.widget.RecyclerView>
</LinearLayout>
</FrameLayout>
StoriesFragment.java
package com.example.tptchatroom;
import android.content.Intent;
import android.icu.text.SimpleDateFormat;
import android.net.Uri;
import android.os.Build;
import android.os.Bundle;
62 Ltd. Lucknow (U.P)
DigiCoders Technologies Pvt.
import androidx.annotation.NonNull;
import androidx.annotation.Nullable;
import androidx.annotation.RequiresApi;
import androidx.fragment.app.Fragment;
import androidx.recyclerview.widget.LinearLayoutManager;
import androidx.recyclerview.widget.RecyclerView;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.LinearLayout;
import android.widget.Toast;
import com.example.tptchatroom.Adapter.StatusListAdapter;
import com.example.tptchatroom.model.statusmodel;
import com.google.android.gms.tasks.OnSuccessListener;
import com.google.firebase.auth.FirebaseAuth;
import com.google.firebase.database.DataSnapshot;
import com.google.firebase.database.DatabaseError;
import com.google.firebase.database.FirebaseDatabase;
import com.google.firebase.database.ValueEventListener;
import com.google.firebase.storage.FirebaseStorage;
import com.google.firebase.storage.StorageReference;
import com.google.firebase.storage.UploadTask;
import java.lang.reflect.Array;
import java.util.ArrayList;
import java.util.Date;
import java.util.HashMap;
import java.util.Random;
public StoriesFragment() {
// Required empty public constructor
}
@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container,
Bundle savedInstanceState) {
// Inflate the layout for this fragment
View v= inflater.inflate(R.layout.fragment_stories, container, false);
//let's add story of user to firebase
LinearLayout layout=v.findViewById(R.id.addstory);
layout.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View view) {
Intent intent = new Intent(Intent.ACTION_GET_CONTENT);
intent.setType("image/*");
startActivityForResult(intent, 2);
}
});
//select all stories and bind in Recyclerview
ArrayList<statusmodel> statuslist=new ArrayList<statusmodel>();
RecyclerView statusrecycler=v.findViewById(R.id.storyrecycle);
StatusListAdapter adapter=new StatusListAdapter(getContext(),statuslist);
63 Ltd. Lucknow (U.P)
DigiCoders Technologies Pvt.
statusrecycler.setAdapter(adapter);
statusrecycler.setLayoutManager(new LinearLayoutManager(getContext()));
FirebaseDatabase.getInstance().getReference().child("story").addValueEventListener(new
ValueEventListener() {
@Override
public void onDataChange(@NonNull DataSnapshot snapshot) {
statuslist.clear();
for (DataSnapshot ds : snapshot.getChildren())
{
statusmodel s=new statusmodel();
s.username=ds.child("name").getValue(String.class);
s.statusdate=ds.child("date").getValue(String.class);
ArrayList<String> status=new ArrayList<>();
for (DataSnapshot spic : ds.child("status").getChildren())
{
status.add(spic.child("pic").getValue(String.class));
}
s.status=status;
statuslist.add(s);
}
Toast.makeText(getContext(), ""+statuslist.size(),
Toast.LENGTH_SHORT).show();
adapter.notifyDataSetChanged();
}
@Override
public void onCancelled(@NonNull DatabaseError error) {
}
});
return v;
}
@Override
public void onActivityResult(int requestCode, int resultCode, @Nullable Intent data)
{
super.onActivityResult(requestCode, resultCode, data);
Uri img=data.getData();
Random r=new Random();
int random=r.nextInt();
StorageReference ref=FirebaseStorage.getInstance().getReference().
child("story").child(FirebaseAuth.getInstance().getUid()+random);
ref.putFile(img).addOnSuccessListener(new
OnSuccessListener<UploadTask.TaskSnapshot>() {
@Override
public void onSuccess(UploadTask.TaskSnapshot taskSnapshot) {
try {
taskSnapshot.getStorage().getDownloadUrl().addOnSuccessListener(new
OnSuccessListener<Uri>() {
@Override
public void onSuccess(Uri uri) {
String status = uri.toString();
FirebaseDatabase.getInstance().getReference().child("story").
child(FirebaseAuth.getInstance().getUid()).updateChildren(userdata);
FirebaseDatabase.getInstance().getReference().child("story").
child(FirebaseAuth.getInstance().getUid()).child("status").push().setValue(statusdata);
@Override
public void onCancelled(@NonNull DatabaseError
error) {
}
});
}
});
}
catch (Exception ex)
{
Toast.makeText(getContext(),"Error"
+ex.getMessage(),Toast.LENGTH_LONG).show();
}
}
});
}
}
</de.hdodenhof.circleimageview.CircleImageView>
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:id="@+id/username"
android:text="Akanksha Giri"
android:textColor="@color/white"
android:textSize="22sp">
</TextView>
</LinearLayout>
<androidx.recyclerview.widget.RecyclerView
android:id="@+id/recyclemsg"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_above="@+id/linear2"
android:layout_below="@+id/linear1"
android:background="@drawable/chitchat2">
</androidx.recyclerview.widget.RecyclerView>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="horizontal"
android:layout_alignParentBottom="true"
android:id="@+id/linear2">
</de.hdodenhof.circleimageview.CircleImageView>
</LinearLayout>
</RelativeLayout>
MessageDetail.java
package com.example.tptchatroom;
import androidx.annotation.NonNull;
import androidx.appcompat.app.AppCompatActivity;
import androidx.recyclerview.widget.LinearLayoutManager;
import androidx.recyclerview.widget.RecyclerView;
import android.content.Intent;
import android.os.Bundle;
import android.util.Log;
import android.view.View;
import android.widget.Button;
import android.widget.EditText;
import android.widget.ImageView;
import android.widget.TextView;
import android.widget.Toast;
import com.example.tptchatroom.Adapter.MessageListAdapter;
import com.example.tptchatroom.model.messagemodel;
import com.google.android.gms.tasks.OnCompleteListener;
import com.google.android.gms.tasks.Task;
import com.google.firebase.auth.FirebaseAuth;
import com.google.firebase.database.DataSnapshot;
import com.google.firebase.database.DatabaseError;
import com.google.firebase.database.FirebaseDatabase;
import com.google.firebase.database.ValueEventListener;
import com.squareup.picasso.Picasso;
67 Ltd. Lucknow (U.P)
DigiCoders Technologies Pvt.
import java.text.SimpleDateFormat;
import java.util.ArrayList;
import java.util.Date;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_message_detail);
getSupportActionBar().hide();
Picasso.get().load(intent.getStringExtra("profilepic")).placeholder(R.drawable.horse).int
o(userprofile);
@Override
@Override
public void onClick(View view) {
if (!message.getText().toString().trim().isEmpty())
{
messagemodel md=new messagemodel();
md.msg=message.getText().toString();
SimpleDateFormat format=new SimpleDateFormat("hh:mm aa");
Date date=new Date();
md.msgtime=String.valueOf(format.format(date));
md.senderid=senderuid;
FirebaseDatabase.getInstance().getReference().child("message").
child(receiveruid+senderuid).push().setValue(md);
message.setText("");
}
});
}
else
{
Toast.makeText(MessageDetail.this, "Enter Message",
Toast.LENGTH_LONG).show();
}
}
});
ArrayList<messagemodel> msglist=new ArrayList<>();
//Let's bind MessageListAdapter to the recyclerview
RecyclerView recycle=findViewById(R.id.recyclemsg);
MessageListAdapter adapter=new
MessageListAdapter(this,msglist,senderuid+receiveruid);
recycle.setAdapter(adapter);
recycle.setLayoutManager(new LinearLayoutManager(this));
@Override
public void onCancelled(@NonNull DatabaseError error) {
}
});
}
}
69 Ltd. Lucknow (U.P)
DigiCoders Technologies Pvt.
9. FUTURE SCOPE
10. CONCLUSION:
At the last the Conclusion of project from a cultural standpoint is that COFFFEE SHOP largely serves
as centres of social interaction:a Coffee Shop provides patrons with a place to
congregate,talk,read,write,entertain one another , or pass the time,whether individually or in small
groups.