You are on page 1of 110

Women

Safety App

PROJECT
RECORD

Submitted By:
JuvinWilsonT
Reg.No:DSAT
BCA021

Submitted in partial fulfillment for the award of


the Degree of BCA

Mar Dionysius College ,Thrissur,Kerala

Department of Computer Applications

MAR DIONYSIUS COLLEGE,THRISSUR,KERALA


(Affiliated to University of Calicut)

March 2022
DEPARTMENT OF COMPUTER APPLICATION
MAR DIONYSIUS COLLEGE
PAZHANJI

CERTIFICATE
This is to certify that the project report, ”WOMEN SAFETY APP” is the bonafide work of
JUVIN WILSON T (DSATBCAO21) in partial fullfillment of the requirements for the award of
the Degree of Bachelor of Computer Application under University of Calicut during the year
2021-2022.

Internal Guide
Head of the Department
DECLARATION

We hereby declare that this submission is our own work and that, to the best of our knowledge
and belief, it contains no material previously published or written by another person or material
which has been accepted for the award of any other degree or diploma of the university or other
institute of higher learning, except where due acknowledgement has been made in the text.

Place : Thrissur Roy

Date :
Reg No :DSATBCA031

Signature :
Name : Juvin Signature :
Wilson t Name :
Reg No : Athul V Jiju
DSATBCA021
Reg No
: DSATBCA019
Signature :

N
a
m
e

:
R
i
g
i
l

C
ABSTRACT

The main actors in the use of the proposed website will be the administrator, women and
police. In this WOMEN SAFETY you will be able to add a contact list , emergency alert, view
complaints, add police stations, submit complaint and view the emergency alert. This project will
contain a lot of advanced modules whichmakes the backend system very powerful. The list of
requirements for this project was also influenced by the work done in the background research
section above. TABLE 1 below gives a description of the modules proposed for the WOMEN
SAFETY.

MODULE OBJECTIVE FEATURES


ACTIVITY LOGS Manage activity logs ● Admin can manage
the activity logs
● Admin can edit/delete
the activity logs
● Admin can see the list
of all activity logs
● Teacher can see his
activity logs

CLASS Tracks all the information and ● Admin can add new
details of classes. classes
● Admin can see the list
of classes details
● Only admin can edit
and update the record
of the classes
● Admin will be able to
delete the records of
the classes
● All classes forms are
validated on client
side using JavaScript

TEACHER Tracks all the information of ● Admin can add new


the teacher. Create, Read, teacher records
Update and Delete (CRUD) ● Admin can see the list
operations will be developed of teacher details
for teachers. This is a role ● Only admin can edit
based module where the and update the record
admin can perform each and of the teacher
every operation on data but ● Admin will be able to
the teacher will be able to delete the records of
view only his/her data. the teacher
Access level restrictions will ● All teacher forms are
be implemented for students. validated on client
side using JavaScript

ASSIGNMENTS Administrator to manage ● Admin can manage


Assignments the assignment
● Admin can edit/delete
the assignment
● Admin can see the list
of all assignments
● Teacher can see his
assignment

DEPARTMENTS Administrator to manage ● Admin can manage


departments the departments
● Admin can edit/delete
the departments
● Admin can see the list
of all departments
● Teacher can see his
departments

EVENTS Provides all the functionality ● Admin can add new


related to events and tracks events
all the information and details ● Admin can see the list
of events of events details
● Only admin can edit
and update the record
of the events
● Admin will be able
to delete the records
of the events
● All events forms are
validated on client
side using JavaScript

SUBJECTS Administrator can add ● Admin can manage


subjects and a teacher can see the subjects
subjects ● Admin can edit/delete
the subjects
● Admin can see the list
of all subjects
STUDENTS Tracks all the information and ● Admin can add new
details of the students. Create, students
Read, Update and Delete ● Admin can see the list
(CRUD) will be developed of students details
for operations of the students ● Only admin can edit
and update the records
of the students
● Admin will be able to
delete the records of
the students
● All Students
publication forms will
be validated on the
client side using
JavaScript.
ACKNOWLEDGMENT

I am glad to present the project report entitled “WOMEN SAFETY APP” prepared asa part of
our final year Bachelor of Computer Application course. First and foremost we are
extremely grateful to God Almighty, whose blessings have given us courage and strength to
complete this project successfully.
I express my heartiest gratitude to DR.THOMAS MATHEW,
Principal of, Mar Dionysius College Pazhanji Thrissur for his inspiration and encouragement
throughout our project. We would like to express our gratitude to DR.BENSON , Head of the
Department of Computer Application, who has served as a host of valuable encouragement. It is
wordless to say thanks to our internal guide DR.MANJU K MATHAI & DR.MANJUSHA K
K , Assistant Professor, Department of Computer Application, for her proper guidance and
support. We extend our sincere gratitude to all other faculties in the department, who have
contributed to fulfill our attempt.
We thank all our family members, friends and all other working staff
who helped us in successful completion of our project.
Place: Thrissur
Date:
CONTENTS

1. INTRODUCTION
2.SYSTEM STUDY
2.1 Existing system
2.2 Objective of the Project
2.3 Proposed System
3.SYSTEM ANALYSIS
3.1 Software Requirement Specification
3.1.1 Significance & Scope
3.1.2 Technologies & Tools
3.1.3 Software and Hardware Configuration
3.2 Feasibility study
4.SYSTEM DESIGN
4.1 Module description
4.1.1 modules
4.1.1.1 Admin Module
4.1.1.2 Student Module
4.1.1.3 Teacher Module
4.2 Conceptual Models
4.2.1 Data Flow diagram
4.2.2 ER diagram
4.3 Database Design
4.3.1 Normalization
4.4 Table Design
4.4.1 Users Table
4.5 Interface Design
4.5.1 Input Design
4.5.2 Output Design
5. SYSTEM DEVELOPMENT
5.1 Front End
5.2 Back End
6. SYSTEM TESTING
6.1 Modular Integration Testing
6.1.1 Test Case Design Method
6.1.1.1 Blackbox Testing
6.1.1.2 Whitebox Testing
7. SYSTEM IMPLEMENTATION
8. SYSTEM MAINTENANCE AND SECURITY
8.1 System Maintenance
8.2 System Security
9. CONCLUSION
10. APPENDIX
10.1 Coding Details
10.2 User Interface Design
!0.2.1 Input Form Design
10.2.2 Output Form Design
INTRODUCTION

This project is concerned with the analysis, design, development,


implementation and evaluation of an e-learning management system to provide a user- friendly
environment for prospective students to acquire knowledge at any educational level and to bridge
the gap between teachers and students.

The web has become a public square, a library, a doctor’s office, a shop, a
school, a design studio, an office, a cinema, a bank, and so much more. (Berners-Lee, 2018).
Trinidad and Tobago’s education system has a real opportunity to move forward in terms of
digital infrastructure and digital education as smaller countries have the greatest chance of
achieving system wide transformations. E-learning is a fairly new concept for Trinidad and
Tobago’s education system and with proper design and implementation using ideas from existing
e-learning applications, a world-class digital education programme can be established and
executed right here in Trinidad and Tobago.

This interim report charts the progress of my E-Learning Management


System project. This report provides a critical analysis of the tasks that were undertaken along
with supporting evidence of all work done and includes comments on any setbacks that may
have delayed progress. It also looks at what still needs to be done to complete the project.

Many proponents of e-learning believe that everyone must be equipped with


basic knowledge in technology, as well as use it as a medium to reach a particular goal and aim.
In the 20th century, we have moved from the Industrial Age through the Information Age and
now to the Knowledge Age. Knowledge and its efficient management constitute the key to
success and survival for organizations in the highly dynamic and competitive world of today.
Efficient acquisition, storage, transfer, retrieval, application, and visualization of knowledge
often distinguish successful organizations from the unsuccessful ones. The ability to obtain,
assimilate, and apply the right knowledge effectively will become a key skill in the next century.
Learning is the key to achieving our full potential. Our survival in the 21first century as
individuals, organizations, and nations will 2 depend upon our capacity to learn and the
application of what we learn to our daily lives. Elearning has the potential to transform how and
when employees learn. Learning will become more integrated with work and will use shorter,
more modular, just-in-time delivery systems. By leveraging workplace technologies, e-learning
is bridging the gap between learning and work. Workers can integrate learning into work more
effectively because they use the same tools and technology for learning as they use for work.
Both employers and employees recognize that elearning will diminish the narrowing gap
between work and home, and between work and learning. E-learning is an option to any
organization looking to improve the skills and capacity of its employees. With the rapid change
in all types of working environments, especially medical and healthcare environments, there is a
constant need to rapidly train and retrain people in new technologies, products, and services
found within the environment. There is also a constant and unrelenting need for appropriate
management and leveraging of the knowledge base so that it is readily available and accessible
to all stakeholders within the workplace environment.
SYSTEM STUDY

EXISTING SYSTEM

In the existing system there is no monitoring system for girls in kerala, it should create many
problems for them and the no safety mechanism to protect the girls from the misbehaviour
activities.
In addition, in the existing system there is no alert mechanism for the girl’s safety, it
should be done by manually only.

Disadvantages
• All the existing systems must be connected to the GPS service to work properly, hence cannot be
used during emergency if there is no internet connectivity.
• here is no hidden camera detector which is portable to ensure our privacy.
• Monitoring was tedious.
• Mischance in arriving rate.

OBJECTIVE OF THE PROJECT

E-Learning represents an innovative shift in the field of learning,


providing rapid access to specific knowledge and information. It offers online instruction
that can be delivered anytime and anywhere through a wide range of electronic learning
solutions such as Web-based courseware,online discussion groups, live virtual classes,
video and audio streaming, Web chat, online simulations, and virtual mentoring.
E-Learning enables organizations to transcend distance and other organizational gaps by
providing a cohesive virtual learning environment. Companies must educate and train
vendors, employees, partners, and clients to stay competitive and E-Learning can provide
such just-in-time training in a cost-effective way. Developing and deploying effective
ELearning programs may require products and services supplied by a variety of vendors,
leaving one to connect the dots. One way to start is to define the goals of the desired
learning solution.Definition of the goals of an E-Learning solution is driven by the
following factors:

● To perform task analysIS


Determine the tasks to be taught, identify subtasks and other elements
involved, and identify the knowledge, skills, and attitudes required to
complete the tasks efficiently and effectively.

● To perform training needs analysis


Identify the target audience for the training. Identify the shortfall in
knowledge, skills, and attitudes of this audience and determine what the
target learners need to know.

● To review existing capabilities


Review existing methods and infrastructure for providing training or
meeting learning needs.
● To determine expectations
Identify concrete expectations and/or ROI requirements from the desired
E-Learning solution. The development of an E-Learning strategy begins by
setting goals. What will the E-Learning strategy accomplish? Without a true
understanding of the goals of the E-Learning strategy, it will be difficult, if
not impossible, to be successful.
Before implementing E-Learning, organizations need to set common goals
or objectives. Common goals and objectives include the following:
● To reduce learning costs
As a small business owner, you know that online transactions cost a
fraction as much as those requiring paper or staff. It’s the same with
E-Learning because there are no papers, no delays, and no travel
expenses. Such learning enables employees to take what they have
just learned from their computer screens and apply it to the tasks at
hand.
● To motivate employees
E-Learning is considered an effective way to keep up with new technology, to
generate new ideas, and to keep your workforce fresh and inspired.
● To improve flexibility of course delivery
Smaller businesses don’t have the staff to manage their training and development
initiatives. ELearning technologies can overcome these administrative restrictions

PROPOSED SYSTEM

In this Android Application is used to find the location and send the location to the group of
people stored in the phone , sos, message, track your phone.

ADVANTAGES
• It is an all-in-one system. Hence no need to carry multiple devices.
• GPS tracking feature tracks the user lively when you are the move after triggering the emergency
button.
• It records audio, which can be used for further investigations
The device works without internet connectivity
SYSTEM ANALYSIS

Software Requirement Specification


Significance & Scope
○ Significance
■ User-friendly
■ access the study material unlimited times.
■ You can study your subject anytime and anywhere.
■ This indicates that learning time is reduced.

■ Physically disabled people can procure degrees and build their career
through online learning effortless
○ Scope

■ Time and Cost-Effective


■ Efficient Accessibility

Technologies & Tools

○ Android studio
○ Java
○ Firebase(Realtime database)
○ JSON

Software and Hardware Configuration

HARDWARE CONFIGURATION
Processor : Pentium IV or above
RAM :512MB
HDD : 50GB
KeyBoard/Mouse : Any standard KeyBoard/Mouse
Monitor : Any standard Monitor
SOFTWARE CONFIGURATION
Front End : Android studio
Back End : Fire base
Operating System : Windows 10 OR above

Feasibility Study

Best Learning Management System Defined

The best LMS solution is defined in this study as one in which all LMS components are
considered within the total learning infrastructure of Zanzibar University such that maximum
student success is ensured from both an institutional and System perspective. Aspects of these
components within the framework of student success were assessed by the following attributes:
•Cost effectiveness
The total cost figures included in this report represent a current snapshot of the LMS
expenditures excluding self-hosting and migration cost, reported to the Assessment team. The
benefits of the LMS is expected to be more than cost such as hosting maintenance and other
costs that may be incurred.
•Support and Training
The system must have a virtual learning community that provides students orientated templates
and professionals, development resources for faculty by providing online help desk services for
students and faculty that includes chat, email, telephone and a personalized support portal
available 24/7/365.
•Ease of Use
The LMS must have ease of use components and no additional instrument questions were
developed; the system should have a higher level of instructor and administrator perceived
application functionality.
•Scalability
The LMS must be able to report on the number of active courses, users, and average course size
and storage capacity on their LMS. It should be able to hold a lot of activities but still be able to
use less storage capacity.
•Sustainability
The sustainability of an LMS is paramount to the future growth of distance learning in the
university. The system-wide capability to support LMS-centric learning technology is
challenging in both the short and long terms. Information from the success NC listening tour
notes indicate that: -
(1) Colleges differ on LMS preferences but want continued support from the System Office.
(2) Learning technology offers an effective and flexible means to facilitate learning.
la Firefox, Internet Explorer
(3) Increased enrollments have negatively affected instructors, strained facilities, and encouraged
creative interventions to maximize resources
SYSTEM DESIGN

The system design is the second of the four system development life cycle phases. It is the phase
in which the detailed design of the system selected in the study phase is accomplished and the
users oriented performance specification is converted into a technical design specification. The
principal activity performed during the design phase includes the general system design and the
design of all outputs, input design phase reports and user review. At this point in the system
development life cycle, the problems have been identified, alternative solutions have been
studied, and also a management review has been ended with an authorization to proceed with a
recommended solution. The first design step, the system design involves the selection of those
system functions to be performed by either the people in the system, the equipment, or computer
programs. These functions are usually identified by decomposing the data flow diagrams into
low levels, more detailed DFD‟s, or drawing expanded system flow charts in the course of the
design phase, the performance specification is expanded into design specification.
The goal of the design process is to produce a model which can be used later
to develop a system. Produced model is called design of the system. The user oriented baseline
document prepared in the study phase becomes a baseline document oriented to the needs of the
programmers and other professional personals, which are actually developing the system. A
smooth traction for the study phase to the design phase is necessary because the design phase
continues the activities begun in the earlier phase. However, the project becomes enlarged in
scope, and the personnel are added. The system design phase provides details on how to meet the
requirements.
This phase converts the alternative solutions into logical and then physical
system solutions. In this phase we must design all the aspects from input and output to reports,
database and computer process. There are two types of design possible. They are logical design
and physical design. In logical design, concentrate on the business aspect of the system to be
obtained to a high level of specificity. In a physical system, analysts will design the various parts
of the system to perform physical operations. The analyst must design the following elements of
a system, that are files and database, input design, output design, forms and reports, dialogue an
interface, system and program structure, distributed system
System design consists of two major steps:-
1. Initiation of the detailed design by allocating system function between manual tasks, the
equipment functions and computer program functions
2. The identification of the test requirements for the system and each of the parts.

Module description

The main actors in the use of the proposed website will be the administrator, teacher and student.
In this E-Learning system you will be able to add a student in a class, upload a file, a course,
department, subject and video. This project will contain a lot of advanced modules which makes
the backend system very powerful. The list of requirements for this project was also influenced
by the work done in the background research section above.

MODULES

USER FUNCTIONAL REQUIREMENTS

ADMIN ● Login for Admin


● Forgot password for Admin
● Edit Profile for Admin
● Change password for Admin
● Logout functionality
● Dashboard for Admin User
● MANAGE ACTIVITY LOG: Add
NewActivity log, edit the existing
activity log, view details of the
activity log and see a listing of all
activity logs
● MANAGE TEACHER: Add new
teacher, edit existing teacher, view
details of teacher and see a listing
of all teachers
● MANAGE CLASS: Add new class,
edit existing class, view details of a
class and see a listing of all
classes
● MANAGE ASSIGNMENTS: Add new
assignment, edit the existing
assignment, view details of the
assignments and see a listing of all
assignments
● MANAGE DEPARTMENTS: Add a
new department, edit the existing
department, view details of the
department and see a listing of all
departments
● MANAGE EVENT: Add a new
event,edit the existing event, view
detailsof events and see a listing
of all events
● MANAGE FILES: Add new files, edit
existing files, view details and a
listing of all files
● MANAGE STUDENT: Add new
student, edit the existing student,
view details of the student and see
a listing of all students
● MANAGE SUBJECT: Add a new
subject, edit the existing subject,
view details of a subject and see a
listing of all subjects.
● REPORTS OF THE E-LEARNING
MANAGEMENT SYSTEM: Reports
of Activity logs, Teachers, Classes,
Assignments, Departments,
Events, Files, Students and
Subjects.

TEACHER ● TEACHER REGISTRATION: Any


Teacher can register on the
website using the registration
module
● TEACHER LOGIN: This is the login
form from where the Teacher can
login into the system
● TEACHER ADDS CLASS: This is the
Teacher Add Class form
● TEACHER ASSIGNMENTS ADD:
This is the Teacher assignments
add form of the project
● TEACHER CLASS: This is the
Teacher class in this project
● TEACHER EVENT: This is the
Teacher Event where a teacher will
be able to add an event and see an
event report
● TEACHER SEND MESSAGE: This is
the teacher Send Message form
where the teacher will be able to
send a message
● TEACHER QUIZ SCREEN: This is
the teacher quiz screen form
where a teacher can add a quiz
and see a quiz report
● CHANGE PASSWORD: This is the
change password module from
where a teacher can change his
account password.
● VIDEO UPLOADING for teachers:
Teachers can also upload videos
to aid in teaching.

STUDENT ● STUDENT REGISTRATION: Any


Students can register on the
website using the registration
module
● STUDENT LOGIN: This is the login
form from where students can
login to the system
● STUDENT VIEW
ANNOUNCMENT SCREEN:
Students can view
announcements
● STUDENT ASSIGNMENTS REPORT:
This is the Student assignments
report of the project
● STUDENT COMPOSE MESSAGE
SCREEN: Student compose
message screen
● STUDENT EVENT SCREEN: A
student will be able to see an event
report
● STUDENT INBOX SCREEN: A
student will be able to see a
message
● STUDENT QUIZ SCREEN: Student
can see the quiz report
● CHANGE PASSWORD: A student
can change his account password
from this module.

Conceptual Models

DATA FLOW DIAGRAM


Data flow diagrams are used widely for modeling the requirements.DFDs show the flow
of data through a system. The system may be a company, an organizational set of
procedures, a computer hardware system, a software system or any combination of the
proceedings.

The DFD is also known as a data flow graph or a bubble chart. The following
observations about DFDs are important:

1. All names should be unique. This makes it easier to refer to items in the DFD.
Remember that a DFD is not a flow chart.
2. Arrows in a flow chart represent the order of events; arrows in DFD represent flowing
data. A DFD doesn’t imply any order of events.
3. Suppress logical decisions (A diamond shape box is used in flowchart to represent
decision points with multiple exit paths of which only one is taken).This implies an
ordering of events, which makes no sense in DFD.
Standard symbols:
1. Data Flow :
Used to connect processes to each other, to sources of sinks; the arrow head indicates
direction of data flow.
2. Process :
Performs some transformation of input data to yield output data.
3. Source/Suit (external entity) :
A source of system inputs or sinks of system output.
4. Data store :
A logical file in which it is used to store table details.

ER DIAGRAM

the entities and the list of data that would need to be stored must be represented. The
requirements analysis provided most of the information for this phase in the
development process, as functional requirements formed the basis of the data required.
The Entity Relationship Model is frequently used for the conceptual design of database
application and many database design tools employ its concept. An entity relationship
diagram was created based on the functional requirements outlined above. Images
below show draft ERD’s which need to be completed to align with the final database
design.
Database Design

Database design is the process of producing a detailed data model of a database. This data
model contains all the needed logical and physical design choices and physical storage
parameters needed to generate a design in a data definition language, which can then be
used to create a database. A fully attributed data model contains detailed attributes for
each entity. The term database design can be used to describe many different parts of the
design of an overall database system. Principally, and most correctly, it can be thought of
as the logical design of the base data structures used to store the data. In the relational
model these are the tables and views. In an object database the entities and relationships
map directly to object classes and named relationships. However, the term database
design could also be used to apply to the overall process of designing, not just the base
data structures, but also the forms and queries used as part of the overall database
application within the database management system (DBMS). Database Management is
the key to effective handling of data within an organization and between different
functional entities. The storage of all the data in a standardized and streamlined manner is
important.

The process of doing database design generally consists of a number of


steps which will be carried out by the database designer. Usually, the designer must:
• Determine the data to be stored in the database .
• Determine the relationships between the different data elements.
• Superimpose a logical structure upon the data on the basis of these Relationships.

Benefits of a good database design include :


• Efficient support for complex and interrelated business processes
• Lower cost of database ownership.
• Consistent availability of data to support business operations and decision making.
• Reduction in redundant data storage.
• Increased productivity at work.
• Avoidance of inconsistent data

NORMALIZATION

The term normalization refers to a technique of separating redundant fields and breaking up
large tables into smaller ones. After the conceptual level, the next level process of the database
designed to organize the database structure into a good shape is called normalization.

Normalization is adopted to overcome drawbacks like


• Loss of information
• Inconsistency
• Reparation of data
Different normal forms
• First Normal Form(1 NF)
• Second Normal Form(2NF)
• Third Normal Form(3NF)

First Normal Form (1NF)


A relation is said to be in 1NF if it satisfies the constraints that it contains primary key only.

Second Normal Form (2NF)


The concept of 2NF, because every table has a primary key and other fields are dependent on the
primary key.

Third Normal Form (3NF)


A relation is said to be in 3NF if and only if it is in 2NF and moreover non –key attributes of the
relation should not depend on other non-key.

TABLE DESIGN
Users Table
The users table is used to manage the user information. The table is made up of 8
columns to store uid, unique_id, firstname, surname, email, encrypted_password, salt and
created_at. The primary key for the table is the user id which is represented in the table by uid. It
is an integer and its value is set to auto increment.

The unique user id is generated by using the function uniqid('', true). The sample uniqid
generated is 53682b0ba49121.72753406.
The firstname and the surname columns of the table store the user first and last names
respectively. The email column stores the email address of the user and this should be unique for
every user.

The encrypted_password column is needed for security purposes to encrypt user passwords in
the database so that it is not saved in plain text. It uses the base64_encoding method. The salt
column is used to store the value with which the password was encrypted. 27 The column
created_at is included to be able to track when the user account was created.

The column is saved in datetime format and uses NOW() function while saving user information
into the database table.
SYSTEM DEVELOPMENT

There are several technologies and tools used in the development of this project
work. These tools and technologies include: Android, Java, PHP, MySQL, JSON, phpMyAdmin
and Android mobile phone.Here we use android studio as front end and firebase as back end.

FRONT END-ANDROID STUDIO

Android is an open-source mobile operating system that is based on Linux kernel.


It is designed primarily for touchscreen mobile devices which include smart phones and tablet
computers. Apart from its use in mobile devices, the technology has also been implemented in
digital cameras, smart televisions and other electronics appliances. The Android operating
system is made up of four main layers which are divided roughly into five sections. These
sections are Linux kernel, Libraries, Android runtime, Application framework and
Applications./8/

BACKEND-FIREBASE

Firebase is an integral part of Google Cloud. Its benefits include scalability, faster time to
market, and comprehensive app development and deployment functions. A few drawbacks
include its closed-source status, lack of SQL databases and users getting locked-in on
vendor’s platform

Firebase offers the free Spark Plan and the premium Blaze Plan. The free plan offers limited
server resources that cover most Firebase services, while the Blaze Plan charges users based
on the server resources used.
The features of Firebase provide value all through an app development cycle, from building
to deployment through monitoring and engaging users. Viable alternatives to Firebase
include Back4app, AWS Amplify and Backendless.
SYSTEM TESTING

Software testing is a critical element of software quality assurance and


represents the ultimate review of specification, design and coding. Testing represents an
interesting anomaly or the software. Testing is vital to the success of the system. Errors can be
injected at any state during development. System testing makes a logical assumption that all the
parts of the system are correct, the goal will be successfully achieved. During testing, the
program to be tested is executed with a set of data and the output of the program for the test data
is evaluated to determine if the program is performing as expected. A series of testing are
performed for the proposed system before the system is ready for user acceptance testing. The
testing steps are;
• Unit Testing
• Integration Testing
• Validation Testing
• Acceptance Testing
• Output Testing

UNIT TESTING
Unit testing focuses verification effort on the smallest unit of the software design, the module
this is known as module testing. Since the proposed system has modules the testing is
individually performed on each module. Using the detailed design description as a guide,
important control paths are tested to uncover errors within the boundary of the module. This
testing was carried out during the programming stage itself. In this testing step, each module is
found to be working satisfactorily as regards to the expected output from the module.

INTEGRATION TESTING
Data can be tested across an interface, one module can have effect on another, sub-function
when combined may not produce the desired function. Integration P a g e | 26 testing is a
systematic technique for constructing the program structure while at the same time conducting
tests to uncover errors associated within the interface.
VALIDATION TESTING
Validation testing can be defined in many ways, but a simple definition is that validation
succeeds in the software functions in a manner that is reasonably expected by the customer.
Software validation is achieved through a series of black box tests that demonstrates conformity
with requirements. After validation test has been conducted, one of the two conditions exists;

• The function or performance characteristics conform to specifications and are accepted.


• A validation from specification is uncovered and a deficiency created.

Deviation of errors discovered at this step in this project is corrected prior to completion of the
project with the help of the user by negotiating to establish a method for resolving deficiencies.
Thus the proposed system under consideration has been tested by using validation testing and
found to be working satisfactorily.

OUTPUT TESTING
After performing the validation testing, the next step is output testing of the proposed system.
Since no system could be useful if it does not produce the required output in the specific format.
The output generator displayed by the system under consideration is tested by asking the users
about the format required by them. Here the output is considered in two ways; One is on screen
and the other is printed format. The output format on the screen is found to be correct as the
format was designed in the system design phase according to the user needs. As far as hardcopies
are considered, it goes in terms with the user requirement. Hence output testing does not result in
any correction in the system.

ACCEPTANCE TESTING
User acceptance of the system is a key factor for the success of any system. The system under
consideration is tested for user acceptance by constantly keeping in touch with prospective
system and user at the time of developing and making changes whenever required.

Modular Integration Testing


Test Case Design Method

There are two types of testing commonly:


1. White Box Testing
2. Black Box Testing

WHITE BOX TESTING


White Box testing is the test case design method that uses the control structure of the procedural
design to derive test cases. White Box testing of software is predicted on close examination of
procedural details.

BLACK BOX TESTING


Black Box testing focuses on the functional requirements of the software. It helps to find out
errors in incorrect or missing functions, interface errors, errors in data structures, performance
errors and initialization and termination errors. The Black Box testing is applied during the later
stages for the functional requirement evaluation
SYSTEM IMPLEMENTATION

Implementation is the stages of a project when the theoretical design is


turned into a working system. If the implementation stage is not properly planned and controlled,
it can cause chaos. Thus it can be considered to be the most crucial stage in achieving a
successful new system and in giving the users confidence that the new system will work and be
effective.
Normally this stage involves setting up a co-ordination committee, which will
act as a sounding board of ideas, complaints and problems. The first task is implementation
planning ie; decision of the methods and time scale to be adopted. Apart from planning, the two
major tasks of repairing for implementation are education and training of administrators and
testing of the system.
After the implementation phase is completed and the user staff adjusted to the
changes created by the candidate system, evaluation and maintenance is continuing to bring the
new system standards.
The activities of the implementation phase can be summarized as;
• Implementation planning
• Education and training
• System training
System implementation is the final stage that puts the utility into action. Implementation
is the state in the project where the theoretical design turns into a working system.
The system is implemented after thorough checking is done and if it is found
working according to the specification. It involves careful planning, investigation of the current
system and constraints on implementation, design of methods to achieve.
Two checking is done and if it is found working according to the major task of
preparing the implementation are educating, training the administrator.
The implementation process begins with preparing a plan for the implementation
of the system. According to this plan, the activities are to be carried out, discussions made
regarding the equipment, resources and the additional equipment that has to be acquired to
implement the new system. The most important thing in the implementation stage is, gaining the
users confidence that the system will work effectively. The system can be implemented only after
the testing is done. This method also offers the greatest P a g e | 29 security since the existing
system can take over if errors are found or inability to handle certain type of transaction while
using the new system.
SYSTEM MAINTENANCE & SECURITY

SYSTEM MAINTENANCE
The maintenance phase of the software cycle is the time in which a software
product forms useful work. After a system is successfully implemented, it should be maintained
in a proper manner. System maintenance is an important aspect in the software development life
cycle. The need for maintenance is to make it adaptable to the changes in the environment. There
may be social, technical, and other environmental changes, which affects a system to be
implemented. Software produces enhancement that may provide new functional capabilities,
improving administrator displays and mode of interaction, upgrading the performance
characteristics of the system. So only through proper system maintenance procedures, the system
can be adapted to cope up with these changes.
Software maintenance is of course far more than “Finding mistakes' '. We
may define maintenance by describing four activities. Those are undertaken after a program is
released for use. The first maintenance activity occurs because it is unreasonable to assume that
software testing will uncover all latent errors in a large software system. During the use of any
large program, errors will occur and be reported to the developer.
The process that includes the diagnosis and correction of one or more errors is
called corrective maintenance. The second activity that contributes to a definition of maintenance
occurs because of the rapid change that is encountered in every aspect of computing. Therefore
adaptive maintenance is an activity that modifies software interfaces with a changing
environment is so common.
After a system is successfully implemented, it should be maintained in a proper
manner. System maintenance is performed to make the system adaptable to the changing
environment. Maintenance is in three ways;
• Corrective Maintenance
• Adaptive Maintenance
• Perfective Maintenance

CORRECTIVE MAINTENANCE
In software testing users will not uncover the errors in the system. During the use of any
large program errors will occur and be reported to the developer.

ADAPTIVE MAINTENANCE
It is an activity that modifies the entire system to properly interact with the changing
environment.
PERFECTIVE MAINTENANCE
It is performed to enhance the system by making modifications in the program to meet
the users changing needs.

SYSTEM SECURITY

Security involves both policies and mechanisms to protect the data and ensures that it
is not accessed, altered or deleted without proper authorization. There are two dimensions for the
protection of data in the database. The logged user can only perform the operations. This ensures
that the confidentiality of the data is maintained, second, the data must be protected from
accidental or intentional corruption or destruction.
The security features are considered while developing the system, so as to avoid the
errors and omissions that may lead to serious problems. The system may have to face the
unwanted events called threats. A threat to a computer system is any events that adversely affect
the one or more assets or resources, which make up the system. An event can be any of the
following:
• Interruption of communication.
• Destruction of hardware.
• Modification of software.
• Removal of programs.
• Disclosure of information.

There are many methods for handling a threat.


• Avoid it by altering the design.
• Threat retention.
• Threat reduction that is the frequency of occurrence of a threat is reduced.

The security measures of a computer system should be specified at an early stage in


the design of the system. During the system operation each user should understand the
procedures required to keep the system secure.
There are many possible threats to the security and integrity of any system where
more than one user is associated with the system. Software integrity has become increasingly
important. The attribute measures a system’s ability to withstand attacks, both accidental and
intentional on its security. Attacks can be made on all the three components of software:
programs date and documents.
In this project the data security, data validation checking methods are applied using
password authentication. All the data, which is entered by the administrator, will be validated
CONCLUSION

The project was designed primarily to provide assistance to students while


preparing for examinations. Since the application runs on the user's mobile phone, he or she can
have access to the materials anywhere and at any time. The hint on answering each question
included in the application is also an advantage as students can have the opportunity to learn the
tricks associated with answering the questions correctly.
The application can also be used in schools to conduct real examinations. Since
examination results are saved to an external database, teachers and school authorities can have
access to these results. With this in mind the project was developed so that all the data used in
the application including the questions, the answers and the set of incorrect options are saved on
an external database rather than the local database (SQLite) to prevent any possibility of users
having access to them. Even though this situation will be a difficult one, it is never totally
impossible.
The timing functionality included in the application is another interesting part as a user
can monitor the time he or she spends each time answering different examination questions and
how accurate the responses are.
Most of the goals set at the beginning of the project design stage for this application
have been achieved with its implementation. There are quite a few parts of the application which
I found challenging. The most difficult part of the implementation was finding a way to hold the
set of questions retrieved from the database and displaying them in a view with their set of
options one after the other. For this problem, I created a class to hold each question object and
added them to an array. To display each of the questions, I only needed to iterate through the
array using the position of each of the elements in that array.
To develop this application further, there are some additional features that could be
added. One of these features is the functionality that will make it possible for a 63 user to
challenge a friend to a quiz. It could be implemented in such a way that the question is displayed
to both of them at the same time but only one person whose turn it is to answer will be enabled to
answer the question under a given time. However, if the person fails to answer within the
allocated time, the opponent will then have the opportunity to answer the same question. Points
are awarded for a right answer to every question.
APPENDIX
Coding Details

LoginActivity
Xml
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:gravity="center"
android:padding="16dp">

<RelativeLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_gravity="center">

<androidx.cardview.widget.CardView
xmlns:Card_View="http://schemas.android.com/apk/res-auto"
android:layout_width="match_parent"
android:layout_height="350dp"
android:layout_margin="5dp"
android:padding="10dp"
Card_View:cardCornerRadius="5dp"
Card_View:cardElevation="10dp">

<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:layout_margin="5dp"
android:orientation="vertical">

<com.google.android.material.textfield.TextInputLayout
android:id="@+id/emailError"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="5dp">
<EditText
android:id="@+id/email"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="10dp"
android:hint="@string/prompt_email"
android:inputType="textEmailAddress"
android:maxLines="1"
android:paddingStart="5dp"
android:singleLine="true"
android:paddingLeft="5dp" />

</com.google.android.material.textfield.TextInputLayout>

<com.google.android.material.textfield.TextInputLayout
android:id="@+id/passError"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="5dp"
app:passwordToggleEnabled="true">

<EditText
android:id="@+id/password"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="10dp"
android:hint="@string/prompt_password"
android:inputType="textPassword"
android:maxLines="1"
android:paddingStart="5dp"
android:singleLine="true"
android:paddingLeft="5dp" />

</com.google.android.material.textfield.TextInputLayout>

<Button
android:id="@+id/login"
android:layout_width="match_parent"
android:layout_height="50dp"
android:layout_margin="20dp"
android:background="@color/purple_200"
android:text="@string/login"
android:textColor="@android:color/white"
android:textSize="16sp"/>

<TextView
android:id="@+id/register"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="5dp"
android:gravity="center"
android:text="@string/create_new"
android:textColor="@color/design_default_color_primary"
android:textSize="16sp"/>

</LinearLayout>
</androidx.cardview.widget.CardView>
</RelativeLayout>

<ImageView
android:id="@+id/profile"
android:layout_width="100dp"
android:layout_height="100dp"
android:layout_centerHorizontal="true"
android:layout_marginTop="-50dp"
android:background="@drawable/users"
android:padding="15dp"/>

</RelativeLayout>

Java
package com.example.blooddonation.Student;

import android.app.ProgressDialog;
import android.content.Intent;
import android.os.Bundle;
import android.text.TextUtils;
import android.view.View;
import android.widget.Button;
import android.widget.EditText;
import android.widget.TextView;
import android.widget.Toast;
import androidx.annotation.NonNull;
import androidx.appcompat.app.AppCompatActivity;
import com.example.blooddonation.Admin.AdminHome;
import com.example.blooddonation.R;
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;

public class MainActivity extends AppCompatActivity {


EditText email,password;
TextView register;
Button login;
String emailid, pass;
private ProgressDialog progressDialog;
private FirebaseAuth auth;

@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);

email = findViewById(R.id.email);
password = findViewById(R.id.password);
login = findViewById(R.id.login);
register = findViewById(R.id.register);
progressDialog = new ProgressDialog(this);
auth = FirebaseAuth.getInstance();

if (auth.getCurrentUser() != null) {
try{
Intent j=getIntent();
String logout = j.getStringExtra("logout");
if(logout.equals("logout")){
startActivity(new Intent(MainActivity.this,
MainActivity.class));
finish();
}

}
catch (Exception e) {
startActivity(new Intent(MainActivity.this, Home.class));
finish();
}

register.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
Intent i = new Intent(MainActivity.this, Register.class);
startActivity(i);
}
});
login.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
emailid = email.getText().toString();
pass = password.getText().toString();

if (TextUtils.isEmpty(emailid)) {
Toast.makeText(getApplicationContext(), "Enter email
address!", Toast.LENGTH_SHORT).show();
return;
}

if (TextUtils.isEmpty(pass)) {
Toast.makeText(getApplicationContext(), "Enter password!",
Toast.LENGTH_SHORT).show();
return;
}
progressDialog.setMessage("Logging....... ");
progressDialog.show();
if(emailid.equals("admin") && pass.equals("admin")){
progressDialog.dismiss();
Intent j = new Intent(MainActivity.this, AdminHome.class);
startActivity(j);
}
else{
auth.signInWithEmailAndPassword(emailid, pass)
.addOnCompleteListener(MainActivity.this, new
OnCompleteListener<AuthResult>() {
@Override
public void onComplete(@NonNull Task<AuthResult>
task) {

if (!task.isSuccessful()) {
// there was an error
if (password.length() < 6) {
progressDialog.dismiss();

password.setError(getString(R.string.error_invalid_password));
} else {
progressDialog.dismiss();
Toast.makeText(MainActivity.this,
getString(R.string.auth_failed), Toast.LENGTH_LONG).show();
}
} else {
progressDialog.dismiss();
Intent intent = new
Intent(MainActivity.this, Home.class);
startActivity(intent);
finish();
}
}
});
}
}
});
}
@Override
public void onBackPressed(){
moveTaskToBack(true);

}
}

RegisterActivity

xml
<?xml version="1.0" encoding="utf-8"?>
<ScrollView
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"
android:padding="16dp"
android:scrollbarThumbVertical="@null"
tools:context=".Student.Register">

<androidx.cardview.widget.CardView
xmlns:Card_View="http://schemas.android.com/apk/res-auto"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:layout_margin="5dp"
android:padding="10dp"
Card_View:cardCornerRadius="5dp"
Card_View:cardElevation="5dp">

<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:layout_margin="5dp"
android:orientation="vertical">

<com.google.android.material.textfield.TextInputLayout
android:id="@+id/nameError"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="5dp">

<EditText
android:id="@+id/name"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="10dp"
android:hint="@string/name"
android:inputType="textNoSuggestions"
android:maxLines="1"
android:paddingStart="5dp"
android:singleLine="true"
android:paddingLeft="5dp" />

</com.google.android.material.textfield.TextInputLayout>

<com.google.android.material.textfield.TextInputLayout
android:id="@+id/emailError"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="5dp">

<EditText
android:id="@+id/email"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="10dp"
android:hint="@string/prompt_email"
android:inputType="textEmailAddress"
android:maxLines="1"
android:paddingStart="5dp"
android:singleLine="true"
android:paddingLeft="5dp" />

</com.google.android.material.textfield.TextInputLayout>

<com.google.android.material.textfield.TextInputLayout
android:id="@+id/phoneError"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="5dp">

<EditText
android:id="@+id/phone"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="10dp"
android:hint="@string/phone_number"
android:maxLength="12"
android:inputType="number"
android:maxLines="1"
android:paddingStart="5dp"
android:singleLine="true"
android:paddingLeft="5dp" />

</com.google.android.material.textfield.TextInputLayout>

<com.google.android.material.textfield.TextInputLayout
android:id="@+id/passError"
android:layout_width="match_parent"
android:layout_height="wrap_content"
app:passwordToggleEnabled="true"
android:layout_marginTop="5dp">

<EditText
android:id="@+id/password"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="10dp"
android:hint="@string/prompt_password"
android:inputType="textPassword"
android:maxLines="1"
android:paddingStart="5dp"
android:singleLine="true"
android:paddingLeft="5dp" />

</com.google.android.material.textfield.TextInputLayout>

<Button
android:id="@+id/register"
android:layout_width="match_parent"
android:layout_height="50dp"
android:layout_margin="20dp"
android:background="@color/purple_200"
android:text="@string/register"
android:textColor="@android:color/white"
android:textSize="16sp"/>

<TextView
android:id="@+id/login"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="5dp"
android:layout_marginBottom="5dp"
android:gravity="center"
android:text="@string/not_register"
android:textColor="@color/purple_200"
android:textSize="16sp"/>

</LinearLayout>
</androidx.cardview.widget.CardView>
</ScrollView>

Java
package com.example.blooddonation.Student;

import android.app.ProgressDialog;
import android.content.Intent;
import android.os.Bundle;
import android.text.TextUtils;
import android.view.View;
import android.widget.Button;
import android.widget.EditText;
import android.widget.TextView;
import android.widget.Toast;

import androidx.annotation.NonNull;
import androidx.appcompat.app.AppCompatActivity;

import com.example.blooddonation.R;
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.DatabaseReference;
import com.google.firebase.database.FirebaseDatabase;

public class Register extends AppCompatActivity {


private ProgressDialog progressDialog;
private FirebaseAuth auth;
EditText na,em,ph,pass;
Button register;
TextView login;
String name,email,phone,password;
DatabaseReference databaseReference;
User user;

@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_register);
na = findViewById(R.id.name);
em = findViewById(R.id.email);
ph = findViewById(R.id.phone);
pass = findViewById(R.id.password);
register = findViewById(R.id.register);
login = findViewById(R.id.login);
progressDialog = new ProgressDialog(this);
auth = FirebaseAuth.getInstance();

databaseReference =
FirebaseDatabase.getInstance().getReference("users");
// below line is used to get reference for our database.
user = new User();
login.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
Intent i = new Intent(Register.this, MainActivity.class);
startActivity(i);
}
});

register.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
name = na.getText().toString();
email = em.getText().toString();
phone = ph.getText().toString();
password = pass.getText().toString();

if (TextUtils.isEmpty(name)) {
Toast.makeText(getApplicationContext(), "Enter your name!",
Toast.LENGTH_SHORT).show();
return;
}

if (TextUtils.isEmpty(email)) {
Toast.makeText(getApplicationContext(), "Enter email
address!", Toast.LENGTH_SHORT).show();
return;
}

if (TextUtils.isEmpty(phone)) {
Toast.makeText(getApplicationContext(), "Enter your phone!",
Toast.LENGTH_SHORT).show();
return;
}

if (password.length() < 6) {
Toast.makeText(getApplicationContext(), "Password too short,
enter minimum 6 characters!", Toast.LENGTH_SHORT).show();
return;
}
progressDialog.setMessage("Registering ......... ");
progressDialog.show();
auth.createUserWithEmailAndPassword(email, password)
.addOnCompleteListener(Register.this, new
OnCompleteListener<AuthResult>() {
@Override
public void onComplete(@NonNull Task<AuthResult>
task) {
if (!task.isSuccessful()) {
progressDialog.dismiss();
Toast.makeText(Register.this,
"Authentication failed.",
Toast.LENGTH_SHORT).show();
} else {
progressDialog.dismiss();
DatabaseReference databaseReference=
FirebaseDatabase.getInstance().getReference("users");
String id =
databaseReference.push().getKey();
user = new User(id, name, email, phone,
password);
databaseReference.child(id).setValue(user);
startActivity(new Intent(Register.this,
MainActivity.class));
Toast.makeText(getApplicationContext(),"User
Registered Successfully",Toast.LENGTH_SHORT).show();
}
}
});
}
});

HomeActivity
xml
<?xml version="1.0" encoding="utf-8"?>
<ScrollView 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=".Student.Home">
<androidx.constraintlayout.widget.ConstraintLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="#FFFFFF">
<androidx.appcompat.widget.Toolbar
android:id="@+id/toolbar"
android:layout_width="0dp"
android:layout_height="1dp"
android:background="#00008577"
android:minHeight="?attr/actionBarSize"
android:theme="?attr/actionBarTheme"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent" />
<TextView
android:id="@+id/textView"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_marginStart="16dp"
android:layout_marginLeft="16dp"
android:layout_marginTop="24dp"
android:text="eduClass"
android:textStyle="bold"
android:textColor="@color/design_default_color_primary"
android:fontFamily="sans-serif"
android:textSize="26sp"
app:layout_constraintEnd_toStartOf="@+id/imageView"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@+id/toolbar" />
<TextView
android:id="@+id/textView2"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_marginStart="16dp"
android:layout_marginLeft="16dp"
android:text="Start a new career"
android:fontFamily="sans-serif"
app:layout_constraintEnd_toStartOf="@+id/imageView"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@+id/textView" />

<ImageView
android:id="@+id/imageView"
android:layout_width="204dp"
android:layout_height="142dp"
android:layout_marginEnd="16dp"
android:layout_marginRight="16dp"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toEndOf="@+id/textView"
app:layout_constraintTop_toBottomOf="@+id/toolbar"
app:srcCompat="@drawable/college" />
<LinearLayout
android:id="@+id/linearLayout"
android:layout_width="0dp"
android:layout_height="175dp"
android:orientation="horizontal"
android:padding="10dp"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintHorizontal_bias="0.0"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@+id/imageView">
<androidx.cardview.widget.CardView
android:layout_width="0dp"
android:layout_height="match_parent"
android:layout_margin="10dp"
app:cardElevation="20dp"
app:cardCornerRadius="25dp"
android:layout_weight="1">
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="match_parent">
<TextView
android:id="@+id/textView3"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_below="@id/meeting"
android:layout_centerHorizontal="true"
android:layout_marginTop="10dp"
android:text="Meeting"
android:textSize="20sp" />
<ImageView
android:id="@+id/meeting"
android:layout_width="75dp"
android:layout_height="75dp"
android:layout_centerHorizontal="true"
android:layout_marginTop="15dp"
app:srcCompat="@drawable/meeting" />

<!-- <TextView-->
<!-- android:layout_width="30dp"-->
<!-- android:layout_height="30dp"-->
<!-- android:layout_marginLeft="90dp"-->
<!-- android:text="0"-->
<!-- android:textStyle="bold"-->
<!-- android:textAlignment="gravity"-->
<!-- android:padding="4dp"-->
<!-- android:textSize="17dp"-->
<!--
android:textColorHighlight="@color/design_default_color_primary"-->
<!-- android:textColor="#ffff"-->
<!-- android:background="@drawable/rounded_corner"-->
<!-- android:gravity="center_horizontal" />-->
</RelativeLayout>
</androidx.cardview.widget.CardView>
<androidx.cardview.widget.CardView
android:layout_width="0dp"
android:layout_height="match_parent"
android:layout_margin="10dp"
app:cardElevation="20dp"
app:cardCornerRadius="25dp"
android:layout_weight="1">
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="match_parent">
<TextView
android:id="@+id/textView4"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_below="@id/learning"
android:layout_centerHorizontal="true"
android:layout_marginTop="10dp"
android:text="Learning"
android:textSize="20sp" />
<ImageView
android:id="@+id/learning"
android:layout_width="75dp"
android:layout_height="75dp"
android:layout_centerHorizontal="true"
android:layout_marginTop="15dp"
app:srcCompat="@drawable/learn" />
</RelativeLayout>
</androidx.cardview.widget.CardView>
</LinearLayout>
<LinearLayout
android:id="@+id/linearLayout2"
android:layout_width="0dp"
android:layout_height="175dp"
android:orientation="horizontal"
android:padding="10dp"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintHorizontal_bias="0.0"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@+id/linearLayout">
<androidx.cardview.widget.CardView
android:layout_width="0dp"
android:layout_height="match_parent"
android:layout_margin="10dp"
app:cardElevation="20dp"
app:cardCornerRadius="25dp"
android:layout_weight="1">
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="match_parent">
<TextView
android:id="@+id/textView6"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_below="@id/notes"
android:layout_centerHorizontal="true"
android:layout_marginTop="10dp"
android:text="Notes"
android:textSize="20sp" />
<ImageView
android:id="@+id/notes"
android:layout_width="75dp"
android:layout_height="75dp"
android:layout_centerHorizontal="true"
android:layout_marginTop="15dp"
app:srcCompat="@drawable/note" />
</RelativeLayout>
</androidx.cardview.widget.CardView>
<androidx.cardview.widget.CardView
android:layout_width="0dp"
android:layout_height="match_parent"
android:layout_margin="10dp"
app:cardElevation="20dp"
app:cardCornerRadius="25dp"
android:layout_weight="1">
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="match_parent">
<TextView
android:id="@+id/textView7"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_below="@id/syllabus"
android:layout_centerHorizontal="true"
android:layout_marginTop="10dp"
android:text="SYllabus"
android:textSize="20sp"/>
<ImageView
android:id="@+id/syllabus"
android:layout_width="75dp"
android:layout_height="75dp"
android:layout_centerHorizontal="true"
android:layout_marginTop="15dp"
app:srcCompat="@drawable/syllabus" />
</RelativeLayout>
</androidx.cardview.widget.CardView>
</LinearLayout>
<LinearLayout
android:layout_width="0dp"
android:layout_height="175dp"
android:orientation="horizontal"
android:padding="10dp"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintHorizontal_bias="0.0"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@+id/linearLayout2">
<androidx.cardview.widget.CardView
android:layout_width="0dp"
android:layout_height="match_parent"
android:layout_margin="10dp"
app:cardElevation="20dp"
app:cardCornerRadius="25dp"
android:layout_weight="1">
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="match_parent">
<TextView
android:id="@+id/textView8"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_below="@id/doubt"
android:layout_centerHorizontal="true"
android:layout_marginTop="10dp"
android:text="Doubt Hub"
android:textSize="20sp"/>
<ImageView
android:id="@+id/doubt"
android:layout_width="75dp"
android:layout_height="75dp"
android:layout_centerHorizontal="true"
android:layout_marginTop="15dp"
app:srcCompat="@drawable/doubt" />
</RelativeLayout>
</androidx.cardview.widget.CardView>
<androidx.cardview.widget.CardView
android:layout_width="0dp"
android:layout_height="match_parent"
android:layout_margin="10dp"
app:cardElevation="20dp"
app:cardCornerRadius="25dp"
android:layout_weight="1">
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="match_parent">
<TextView
android:id="@+id/textView9"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_below="@id/announ"
android:layout_centerHorizontal="true"
android:layout_marginTop="10dp"
android:text="Announcements"
android:textSize="20sp" />
<ImageView
android:id="@+id/announ"
android:layout_width="75dp"
android:layout_height="75dp"
android:layout_centerHorizontal="true"
android:layout_marginTop="15dp"
app:srcCompat="@drawable/announcements" />
</RelativeLayout>
</androidx.cardview.widget.CardView>
</LinearLayout>
</androidx.constraintlayout.widget.ConstraintLayout>
</ScrollView>

JAVA

package com.example.blooddonation.Student;

import android.content.Intent;
import android.os.Bundle;
import android.view.Menu;
import android.view.MenuItem;
import android.view.View;
import android.widget.ImageView;
import android.widget.Toast;

import androidx.annotation.NonNull;
import androidx.appcompat.app.AppCompatActivity;

import com.example.blooddonation.Admin.AddLearning;
import com.example.blooddonation.R;
import com.google.firebase.auth.FirebaseAuth;
import com.google.firebase.auth.FirebaseUser;

public class Home extends AppCompatActivity {


private FirebaseAuth firebaseAuth;
String email;

ImageView meet, notes, learning, syllabus, doubthub, ann;

@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_home);
meet = findViewById(R.id.meeting);
notes = findViewById(R.id.notes);
learning = findViewById(R.id.learning);
syllabus = findViewById(R.id.syllabus);
doubthub = findViewById(R.id.doubt);
ann = findViewById(R.id.announ);

FirebaseAuth.AuthStateListener mAuthListener;
firebaseAuth = FirebaseAuth.getInstance();

mAuthListener = new FirebaseAuth.AuthStateListener(){


@Override
public void onAuthStateChanged(@NonNull FirebaseAuth
firebaseAuth){
FirebaseUser user = FirebaseAuth.getInstance().getCurrentUser();
email = user.getEmail();

}
};

meet.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
Intent i = new Intent(Home.this, MeetView.class);
startActivity(i);
}
});

notes.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
Intent i = new Intent(Home.this, NotesView.class);
startActivity(i);
}
});

learning.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
Intent i = new Intent(Home.this, ViewLearning.class);
startActivity(i);
}
});
syllabus.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
Intent i = new Intent(Home.this, ViewSyllabus.class);
startActivity(i);
}
});
doubthub.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
if(email==null){
Intent i = new Intent(Home.this, DoubtHub.class);
i.putExtra("email",email);
startActivity(i);
}
else{
Toast.makeText(getApplicationContext(),"Login expired.Please
login",Toast.LENGTH_LONG).show();
}

}
});
ann.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
Intent i = new Intent(Home.this, ViewAnnnouncement.class);
startActivity(i);
}
});
}
@Override
public boolean onCreateOptionsMenu(Menu menu) {
getMenuInflater().inflate(R.menu.menu_main, menu);
return true;
}
@Override
public boolean onOptionsItemSelected(MenuItem item) {
int id = item.getItemId();
if (id == R.id.logout) {
FirebaseAuth.getInstance().signOut();
Intent i = new Intent(getApplicationContext(), MainActivity.class);
i.putExtra("logout","logout");
startActivity(i);
finish();
return true;
}

return super.onOptionsItemSelected(item);
}
}

ViewMeetingsActivity

xml
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout 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:id="@+id/bottom_layout"
android:layout_width="match_parent"
android:background="@color/gray"
android:layout_height="wrap_content"
android:orientation="vertical">
<androidx.cardview.widget.CardView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_margin="10dp">
<TextView
android:textStyle="bold|italic"
android:textColor="@color/black"
android:textAlignment="center"
android:textSize="20dp"
android:fontFamily="serif"
android:gravity="center"
android:text="Meetings"
android:id="@+id/select_btn"
android:layout_width="match_parent"
android:layout_height="wrap_content" />
</androidx.cardview.widget.CardView>
</LinearLayout>

<LinearLayout
android:layout_marginTop="10dp"
android:layout_below="@+id/bottom_layout"
android:layout_width="match_parent"
android:layout_height="match_parent">
<androidx.recyclerview.widget.RecyclerView
android:id="@+id/recyclerview"
android:layout_width="match_parent"
android:layout_height="match_parent">
</androidx.recyclerview.widget.RecyclerView>
</LinearLayout>

</RelativeLayout>

JAVA

package com.example.blooddonation.Student;
import android.content.Intent;
import android.os.Bundle;
import android.view.Menu;
import android.view.MenuItem;

import androidx.annotation.NonNull;
import androidx.appcompat.app.AppCompatActivity;
import androidx.recyclerview.widget.LinearLayoutManager;
import androidx.recyclerview.widget.RecyclerView;

import com.example.blooddonation.Adapter.LinkAdapter;
import com.example.blooddonation.Admin.Link;
import com.example.blooddonation.R;
import com.google.firebase.auth.FirebaseAuth;
import com.google.firebase.database.DataSnapshot;
import com.google.firebase.database.DatabaseError;
import com.google.firebase.database.DatabaseReference;
import com.google.firebase.database.FirebaseDatabase;
import com.google.firebase.database.ValueEventListener;
import org.jetbrains.annotations.NotNull;
import java.util.ArrayList;
import java.util.List;

public class MeetView extends AppCompatActivity {


private List<Link> list_data;
private RecyclerView recyclerView;
private DatabaseReference db;
private LinkAdapter adapter;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_meet_view);

recyclerView = (RecyclerView)findViewById(R.id.recyclerview);
recyclerView.setHasFixedSize(true);
recyclerView.setLayoutManager(new
LinearLayoutManager(getApplicationContext()));
list_data = new ArrayList<>();
db = FirebaseDatabase.getInstance().getReference("meeting_link");

db.addValueEventListener(new ValueEventListener() {
@Override
public void onDataChange(@NonNull @NotNull DataSnapshot snapshot) {
for (DataSnapshot datas:snapshot.getChildren()){
Link listData = datas.getValue(Link.class);
list_data.add(listData);
}
adapter = new LinkAdapter(list_data, getApplicationContext());
recyclerView.setAdapter(adapter);
}

@Override
public void onCancelled(@NonNull @NotNull DatabaseError error) {

}
});
}
@Override
public boolean onCreateOptionsMenu(Menu menu) {
getMenuInflater().inflate(R.menu.menu_main, menu);
return true;
}
@Override
public boolean onOptionsItemSelected(MenuItem item) {
int id = item.getItemId();

//noinspection SimplifiableIfStatement
if (id == R.id.logout) {
FirebaseAuth.getInstance().signOut();
Intent i = new Intent(getApplicationContext(), MainActivity.class);
i.putExtra("logout","logout");
startActivity(i);
finish();
return true;
}

return super.onOptionsItemSelected(item);
}

MeetAdapterClass

package com.example.blooddonation.Adapter;

import android.content.Context;
import android.content.Intent;
import android.graphics.Paint;
import android.net.Uri;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.TextView;

import androidx.annotation.NonNull;
import androidx.recyclerview.widget.RecyclerView;

import com.example.blooddonation.Admin.Link;
import com.example.blooddonation.R;

import java.util.List;

public class LinkAdapter extends RecyclerView.Adapter<LinkAdapter.ViewHolder> {


private List<Link> list_data;
private Context ct;

public LinkAdapter(List<Link> list_data, Context ct) {


this.list_data = list_data;
this.ct = ct;
}

@NonNull
@Override
public ViewHolder onCreateViewHolder(@NonNull ViewGroup parent, int
viewType) {
View view=
LayoutInflater.from(parent.getContext()).inflate(R.layout.row_link,parent,false
);
return new ViewHolder(view);
}

@Override
public void onBindViewHolder(@NonNull final ViewHolder holder, final int
position) {
final Link ld=list_data.get(position);
holder.link.setText(ld.getLink());
holder.date.setText(ld.getMeeting_date());
holder.time.setText(ld.getMeeting_time());
holder.dep.setText(ld.getDepartment());
holder.year.setText(ld.getYear());
holder.link.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
Uri uri = Uri.parse(ld.getLink());
Intent intent = new Intent(Intent.ACTION_VIEW, uri);
intent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
ct.startActivity(intent);

}
});

}
@Override
public int getItemCount() {
return list_data.size();
}

public class ViewHolder extends RecyclerView.ViewHolder{


private TextView link, date, time, dep, year;
public ViewHolder(View itemView)
{
super(itemView);
link = (TextView)itemView.findViewById(R.id.link);
date = (TextView)itemView.findViewById(R.id.date);
time = (TextView)itemView.findViewById(R.id.time);
dep = (TextView)itemView.findViewById(R.id.department);
year = (TextView)itemView.findViewById(R.id.year);

link.setPaintFlags(link.getPaintFlags() |
Paint.UNDERLINE_TEXT_FLAG);
}
}

ViewLearningActivity

xml
package com.example.blooddonation.Student;

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.view.Menu;
import android.view.MenuItem;
import android.view.View;

import com.example.blooddonation.Adapter.LessonsAdapter;
import com.example.blooddonation.Adapter.LinkAdapter;
import com.example.blooddonation.R;
import com.example.blooddonation.table.Lesson;
import com.example.blooddonation.table.Topic;
import com.google.android.material.floatingactionbutton.FloatingActionButton;
import com.google.firebase.auth.FirebaseAuth;
import com.google.firebase.database.DataSnapshot;
import com.google.firebase.database.DatabaseError;
import com.google.firebase.database.DatabaseReference;
import com.google.firebase.database.FirebaseDatabase;
import com.google.firebase.database.ValueEventListener;

import org.jetbrains.annotations.NotNull;

import java.util.ArrayList;
import java.util.List;

public class ViewLearning extends AppCompatActivity {


private List<Topic> list_data;
private RecyclerView recyclerView;
private DatabaseReference db;
private StudentLessonAdapter adapter;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_view_learning);

recyclerView = (RecyclerView)findViewById(R.id.recyclerview);
recyclerView.setHasFixedSize(true);
recyclerView.setLayoutManager(new
LinearLayoutManager(getApplicationContext()));
list_data = new ArrayList<>();
db = FirebaseDatabase.getInstance().getReference("topics");

db.addListenerForSingleValueEvent(new ValueEventListener() {
@Override
public void onDataChange(@NonNull @NotNull DataSnapshot snapshot) {
for (DataSnapshot datas:snapshot.getChildren()){
Topic listData = datas.getValue(Topic.class);
list_data.add(listData);
}
adapter = new StudentLessonAdapter(list_data,
getApplicationContext());
recyclerView.setAdapter(adapter);
adapter.notifyDataSetChanged();
}

@Override
public void onCancelled(@NonNull @NotNull DatabaseError error) {

}
});

}
@Override
public boolean onCreateOptionsMenu(Menu menu) {
getMenuInflater().inflate(R.menu.menu_main, menu);
return true;
}
@Override
public boolean onOptionsItemSelected(MenuItem item) {
int id = item.getItemId();

//noinspection SimplifiableIfStatement
if (id == R.id.logout) {
FirebaseAuth.getInstance().signOut();
Intent i = new Intent(getApplicationContext(), MainActivity.class);
i.putExtra("logout","logout");
startActivity(i);
finish();
return true;
}

return super.onOptionsItemSelected(item);
}
}

LessonAdapterClass
package com.example.blooddonation.Student;

import android.content.Context;
import android.content.Intent;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.TextView;
import androidx.annotation.NonNull;
import androidx.recyclerview.widget.RecyclerView;
import com.example.blooddonation.R;
import com.example.blooddonation.table.Topic;
import com.example.blooddonation.table.View_video;
import com.google.firebase.database.DatabaseReference;

import java.util.List;

public class StudentLessonAdapter extends


RecyclerView.Adapter<StudentLessonAdapter.ViewHolder> {
private List<Topic> list_data;
private Context ct;
DatabaseReference db;

public StudentLessonAdapter(List<Topic> list_data, Context ct) {


this.list_data = list_data;
this.ct = ct;
}

@NonNull
@Override
public ViewHolder onCreateViewHolder(@NonNull ViewGroup parent, int
viewType) {
View view=
LayoutInflater.from(parent.getContext()).inflate(R.layout.activity_row_student_
lessons,parent,false);
return new ViewHolder(view);
}

@Override
public void onBindViewHolder(@NonNull final ViewHolder holder, final int
position) {
final Topic ld=list_data.get(position);
holder.lesson.setText(ld.getLesson());
holder.duration.setText(ld.getDuration());
holder.lesson.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
String video = ld.getVideo_link();
Intent intent = new Intent(ct, View_video.class);
intent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
intent.putExtra("lesson", ld.getLesson());
ct.startActivity(intent);
}
});

}
@Override
public int getItemCount() {
return list_data.size();

public class ViewHolder extends RecyclerView.ViewHolder{


private TextView lesson, duration;
public ViewHolder(View itemView)
{
super(itemView);
lesson = (TextView)itemView.findViewById(R.id.lesson);
duration = (TextView)itemView.findViewById(R.id.duration);
}
}

NotesActivity
xml
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout 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:id="@+id/rl"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="@drawable/gre">

<TextView
android:id="@+id/txt"
android:textStyle="bold"
android:textColor="#110101"
android:background="#ffff"
android:textSize="20sp"
android:gravity="center"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="introduction"
/>

<androidx.recyclerview.widget.RecyclerView
android:id="@+id/recyclerView"
android:layout_below="@id/txt"
android:layout_marginBottom="50dp"
android:layout_width="match_parent"
android:layout_height="match_parent"/>

</RelativeLayout>

JAVA
package com.example.blooddonation.Student;

import android.content.Intent;
import android.os.Bundle;
import android.view.Menu;
import android.view.MenuItem;
import android.view.animation.Animation;
import android.view.animation.AnimationUtils;
import android.widget.RelativeLayout;
import androidx.appcompat.app.AppCompatActivity;
import androidx.recyclerview.widget.LinearLayoutManager;
import androidx.recyclerview.widget.RecyclerView;
import com.example.blooddonation.Adapter.NoteAdapter;
import com.example.blooddonation.R;
import com.example.blooddonation.table.NoteUploadInfo;
import com.google.firebase.auth.FirebaseAuth;
import com.google.firebase.database.DataSnapshot;
import com.google.firebase.database.DatabaseError;
import com.google.firebase.database.DatabaseReference;
import com.google.firebase.database.FirebaseDatabase;
import com.google.firebase.database.ValueEventListener;
import java.util.ArrayList;
import java.util.List;

public class NotesView extends AppCompatActivity {


DatabaseReference databaseReference;
RecyclerView recyclerView;
NoteAdapter adapter;
List<NoteUploadInfo> list = new ArrayList<>();

@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_notes_view);

Animation animation = AnimationUtils.loadAnimation(this,


R.anim.anim_about_card_show);
RelativeLayout relativeLayout = findViewById(R.id.rl);
relativeLayout.startAnimation(animation);
recyclerView = (RecyclerView) findViewById(R.id.recyclerView);
recyclerView.setHasFixedSize(true);
recyclerView.setLayoutManager(new
LinearLayoutManager(getApplicationContext()));

databaseReference =
FirebaseDatabase.getInstance().getReference("notes");
databaseReference.addValueEventListener(new ValueEventListener() {
@Override
public void onDataChange(DataSnapshot snapshot) {
for (DataSnapshot postSnapshot : snapshot.getChildren()) {
NoteUploadInfo noteUploadInfo =
postSnapshot.getValue(NoteUploadInfo.class);
list.add(noteUploadInfo);
}
adapter = new NoteAdapter(getApplicationContext(), list);
recyclerView.setAdapter(adapter);
}

@Override
public void onCancelled(DatabaseError databaseError) {
}

});
}
@Override
public boolean onCreateOptionsMenu(Menu menu) {
getMenuInflater().inflate(R.menu.menu_main, menu);
return true;
}
@Override
public boolean onOptionsItemSelected(MenuItem item) {
int id = item.getItemId();
if (id == R.id.logout) {
FirebaseAuth.getInstance().signOut();
Intent i = new Intent(getApplicationContext(), MainActivity.class);
i.putExtra("logout","logout");
startActivity(i);
finish();
return true;
}
return super.onOptionsItemSelected(item);
}
}

NoteAdapterClass

package com.example.blooddonation.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.cardview.widget.CardView;
import androidx.recyclerview.widget.RecyclerView;
import com.example.blooddonation.R;
import com.example.blooddonation.Student.pdf;
import com.example.blooddonation.table.NoteUploadInfo;
import java.util.List;

public class NoteAdapter extends RecyclerView.Adapter<NoteAdapter.ViewHolder> {


private Context mCtx;
List<NoteUploadInfo> productList;

public NoteAdapter(Context context, List<NoteUploadInfo> TempList) {


this.mCtx = context;
this.productList = TempList;
}

@Override
public ViewHolder onCreateViewHolder(ViewGroup parent, int viewType) {
View view =
LayoutInflater.from(parent.getContext()).inflate(R.layout.row_notes, parent,
false);
ViewHolder viewHolder = new ViewHolder(view);
return viewHolder;
}

@Override
public void onBindViewHolder(ViewHolder holder, int position) {
NoteUploadInfo UploadInfo = productList.get(position);
holder.textViewTitle.setText(UploadInfo.getNoteName());

holder.imageView.setImageDrawable(mCtx.getResources().getDrawable(R.drawable.ic
_baseline_picture_as_pdf_24));

holder.cardView.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
Intent i = new Intent(v.getContext(), pdf.class);
i.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
i.putExtra("link", productList.get(position).getNoteURL());
i.putExtra("productList",
productList.get(position).getSubject());
mCtx.startActivity(i);
}
});
}
@Override
public int getItemCount() {
return productList.size();
}
class ViewHolder extends RecyclerView.ViewHolder {
TextView textViewTitle;
ImageView imageView;
CardView cardView;

public ViewHolder(View itemView) {


super(itemView);
cardView = itemView.findViewById(R.id.cardview);// card intial
textViewTitle = itemView.findViewById(R.id.textViewTitle);
imageView = itemView.findViewById(R.id.imageView);
}
}
}

SyllabusActivity

xml
<ScrollView xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:fillViewport="true">
<TableLayout

android:layout_width="fill_parent"
android:layout_height="match_parent"
android:stretchColumns="0,1,2"
android:gravity="center">

<TextView
android:layout_width="wrap_content"
android:layout_height="48dp"
android:layout_column="0"
android:layout_margin="1dp"
android:background="#FFFFFF"
android:gravity="center"
android:text="BCA First semester"
android:textAppearance="?android:attr/textAppearanceLarge"
android:textStyle="bold" />

<TableRow
android:background="#000000"
android:layout_width="fill_parent"
android:layout_height="0dp"
android:layout_margin="1dp"

>

<TextView
android:layout_width="15dp"
android:layout_height="match_parent"
android:layout_column="0"
android:layout_margin="1dp"
android:background="#FFFFFF"
android:gravity="center"
android:text="Paper No"
android:textAppearance="?android:attr/textAppearanceLarge"
android:textStyle="bold" />

<TextView
android:layout_width="192dp"
android:layout_height="match_parent"
android:layout_column="1"
android:layout_margin="1dp"
android:background="#FFFFFF"
android:gravity="center"
android:text="Paper"
android:textAppearance="?android:attr/textAppearanceLarge"
android:textStyle="bold" />

<TextView
android:layout_width="wrap_content"
android:layout_height="match_parent"
android:textAppearance="?android:attr/textAppearanceLarge"
android:text="Marks"
android:layout_margin="1dp"
android:background="#FFFFFF"
android:gravity="center"
android:textStyle="bold"
android:layout_column="2"
/>
</TableRow>

<TableRow
android:background="#000000"
android:layout_width="fill_parent"
android:layout_height="0dp"
android:layout_margin="1dp"
>

<TextView
android:layout_width="match_parent"
android:layout_height="match_parent"
android:textAppearance="?android:attr/textAppearanceLarge"
android:text="1"
android:layout_margin="1dp"
android:layout_column="0"
android:background="#FFFFFF"
android:gravity="center"
/>

<TextView
android:layout_width="237dp"
android:layout_height="64dp"
android:layout_column="1"
android:layout_margin="1dp"
android:background="#FFFFFF"
android:gravity="center"
android:text="Computer Fundamentals"
android:textAppearance="?android:attr/textAppearanceLarge" />

<TextView
android:layout_width="wrap_content"
android:layout_height="match_parent"
android:textAppearance="?android:attr/textAppearanceLarge"
android:text="75"
android:layout_margin="1dp"
android:background="#FFFFFF"
android:gravity="center"
android:layout_column="2" />
</TableRow>

<TableRow
android:layout_width="309dp"
android:layout_height="0dp"
android:layout_margin="1dp"
android:background="#000000">

<TextView
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_column="0"
android:layout_margin="1dp"
android:background="#FFFFFF"
android:gravity="center"
android:text="2"
android:textAppearance="?android:attr/textAppearanceLarge" />

<TextView
android:layout_width="250dp"
android:layout_height="123dp"
android:layout_column="1"
android:layout_margin="1dp"
android:background="#FFFFFF"
android:gravity="center"
android:text="Mathematical Foundation for Computer Applications"
android:textAppearance="?android:attr/textAppearanceLarge" />

<TextView
android:layout_width="wrap_content"
android:layout_height="match_parent"
android:layout_column="2"
android:layout_margin="1dp"
android:background="#FFFFFF"
android:gravity="center"
android:text="75"
android:textAppearance="?android:attr/textAppearanceLarge" />
</TableRow>

<TableRow
android:background="#000000"
android:layout_width="fill_parent"
android:layout_height="0dp"
android:layout_margin="1dp"
>

<TextView
android:layout_width="match_parent"
android:layout_height="match_parent"
android:textAppearance="?android:attr/textAppearanceLarge"
android:text="3"
android:layout_margin="1dp"
android:layout_column="0"
android:background="#FFFFFF"
android:gravity="center"
/>

<TextView
android:layout_width="250dp"
android:layout_height="76dp"
android:layout_column="1"
android:layout_margin="1dp"
android:background="#FFFFFF"
android:gravity="center"
android:text=" Discrete Mathematics"
android:textAppearance="?android:attr/textAppearanceLarge" />

<TextView
android:layout_width="wrap_content"
android:layout_height="match_parent"
android:textAppearance="?android:attr/textAppearanceLarge"
android:text="75"
android:layout_margin="1dp"
android:background="#FFFFFF"
android:gravity="center"
android:layout_column="2" />
</TableRow>
<TableRow
android:background="#000000"
android:layout_width="fill_parent"
android:layout_height="0dp"
android:layout_margin="1dp"
>

<TextView
android:layout_width="match_parent"
android:layout_height="match_parent"
android:textAppearance="?android:attr/textAppearanceLarge"
android:text="4"
android:layout_margin="1dp"
android:layout_column="0"
android:background="#FFFFFF"
android:gravity="center"
/>

<TextView
android:layout_width="250dp"
android:layout_height="76dp"
android:layout_column="1"
android:layout_margin="1dp"
android:background="#FFFFFF"
android:gravity="center"
android:text="Common Course (English)"
android:textAppearance="?android:attr/textAppearanceLarge" />

<TextView
android:layout_width="wrap_content"
android:layout_height="match_parent"
android:textAppearance="?android:attr/textAppearanceLarge"
android:text="50"
android:layout_margin="1dp"
android:background="#FFFFFF"
android:gravity="center"
android:layout_column="2" />
</TableRow>
<TableRow
android:background="#000000"
android:layout_width="fill_parent"
android:layout_height="0dp"
android:layout_margin="1dp"
>

<TextView
android:layout_width="match_parent"
android:layout_height="match_parent"
android:textAppearance="?android:attr/textAppearanceLarge"
android:text="5"
android:layout_margin="1dp"
android:layout_column="0"
android:background="#FFFFFF"
android:gravity="center"
/>

<TextView
android:layout_width="250dp"
android:layout_height="76dp"
android:layout_column="1"
android:layout_margin="1dp"
android:background="#FFFFFF"
android:gravity="center"
android:text="Second Language (other than English)"
android:textAppearance="?android:attr/textAppearanceLarge" />

<TextView
android:layout_width="wrap_content"
android:layout_height="match_parent"
android:textAppearance="?android:attr/textAppearanceLarge"
android:text="50"
android:layout_margin="1dp"
android:background="#FFFFFF"
android:gravity="center"
android:layout_column="2" />
</TableRow>

<TextView
android:layout_width="wrap_content"
android:layout_height="48dp"
android:layout_column="0"
android:layout_margin="1dp"
android:background="#FFFFFF"
android:gravity="center"
android:text="BCA Second semester"
android:textAppearance="?android:attr/textAppearanceLarge"
android:textStyle="bold" />

<TableRow
android:background="#000000"
android:layout_width="fill_parent"
android:layout_height="0dp"
android:layout_margin="1dp"

>

<TextView
android:layout_width="27dp"
android:layout_height="match_parent"
android:layout_column="0"
android:layout_margin="1dp"
android:background="#FFFFFF"
android:gravity="center"
android:text="Paper No"
android:textAppearance="?android:attr/textAppearanceLarge"
android:textStyle="bold" />

<TextView
android:layout_width="192dp"
android:layout_height="match_parent"
android:layout_column="1"
android:layout_margin="1dp"
android:background="#FFFFFF"
android:gravity="center"
android:text="Paper"
android:textAppearance="?android:attr/textAppearanceLarge"
android:textStyle="bold" />

<TextView
android:layout_width="wrap_content"
android:layout_height="match_parent"
android:textAppearance="?android:attr/textAppearanceLarge"
android:text="Marks"
android:layout_margin="1dp"
android:background="#FFFFFF"
android:gravity="center"
android:textStyle="bold"
android:layout_column="2"
/>
</TableRow>

<TableRow
android:background="#000000"
android:layout_width="fill_parent"
android:layout_height="0dp"
android:layout_margin="1dp"
>

<TextView
android:layout_width="match_parent"
android:layout_height="match_parent"
android:textAppearance="?android:attr/textAppearanceLarge"
android:text="1"
android:layout_margin="1dp"
android:layout_column="0"
android:background="#FFFFFF"
android:gravity="center"
/>

<TextView
android:layout_width="237dp"
android:layout_height="64dp"
android:layout_column="1"
android:layout_margin="1dp"
android:background="#FFFFFF"
android:gravity="center"
android:text="Problem Solving using C"
android:textAppearance="?android:attr/textAppearanceLarge" />

<TextView
android:layout_width="wrap_content"
android:layout_height="match_parent"
android:textAppearance="?android:attr/textAppearanceLarge"
android:text="75"
android:layout_margin="1dp"
android:background="#FFFFFF"
android:gravity="center"
android:layout_column="2" />
</TableRow>

<TableRow
android:layout_width="309dp"
android:layout_height="0dp"
android:layout_margin="1dp"
android:background="#000000">

<TextView
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_column="0"
android:layout_margin="1dp"
android:background="#FFFFFF"
android:gravity="center"
android:text="2"
android:textAppearance="?android:attr/textAppearanceLarge" />

<TextView
android:layout_width="250dp"
android:layout_height="123dp"
android:layout_column="1"
android:layout_margin="1dp"
android:background="#FFFFFF"
android:gravity="center"
android:text="Programming Laboratory I: HTML and Programming in C"
android:textAppearance="?android:attr/textAppearanceLarge" />

<TextView
android:layout_width="wrap_content"
android:layout_height="match_parent"
android:layout_column="2"
android:layout_margin="1dp"
android:background="#FFFFFF"
android:gravity="center"
android:text="75"
android:textAppearance="?android:attr/textAppearanceLarge" />
</TableRow>

<TableRow
android:background="#000000"
android:layout_width="fill_parent"
android:layout_height="0dp"
android:layout_margin="1dp"
>

<TextView
android:layout_width="match_parent"
android:layout_height="match_parent"
android:textAppearance="?android:attr/textAppearanceLarge"
android:text="3"
android:layout_margin="1dp"
android:layout_column="0"
android:background="#FFFFFF"
android:gravity="center"
/>

<TextView
android:layout_width="250dp"
android:layout_height="76dp"
android:layout_column="1"
android:layout_margin="1dp"
android:background="#FFFFFF"
android:gravity="center"
android:text=" Financial and Management Accounting"
android:textAppearance="?android:attr/textAppearanceLarge" />

<TextView
android:layout_width="wrap_content"
android:layout_height="match_parent"
android:textAppearance="?android:attr/textAppearanceLarge"
android:text="75"
android:layout_margin="1dp"
android:background="#FFFFFF"
android:gravity="center"
android:layout_column="2" />
</TableRow>
<TableRow
android:background="#000000"
android:layout_width="fill_parent"
android:layout_height="0dp"
android:layout_margin="1dp"
>

<TextView
android:layout_width="match_parent"
android:layout_height="match_parent"
android:textAppearance="?android:attr/textAppearanceLarge"
android:text="4"
android:layout_margin="1dp"
android:layout_column="0"
android:background="#FFFFFF"
android:gravity="center"
/>

<TextView
android:layout_width="250dp"
android:layout_height="76dp"
android:layout_column="1"
android:layout_margin="1dp"
android:background="#FFFFFF"
android:gravity="center"
android:text="Operations Research"
android:textAppearance="?android:attr/textAppearanceLarge" />

<TextView
android:layout_width="wrap_content"
android:layout_height="match_parent"
android:textAppearance="?android:attr/textAppearanceLarge"
android:text="50"
android:layout_margin="1dp"
android:background="#FFFFFF"
android:gravity="center"
android:layout_column="2" />
</TableRow>
<TableRow
android:background="#000000"
android:layout_width="fill_parent"
android:layout_height="0dp"
android:layout_margin="1dp"
>

<TextView
android:layout_width="match_parent"
android:layout_height="match_parent"
android:textAppearance="?android:attr/textAppearanceLarge"
android:text="5"
android:layout_margin="1dp"
android:layout_column="0"
android:background="#FFFFFF"
android:gravity="center"
/>

<TextView
android:layout_width="250dp"
android:layout_height="76dp"
android:layout_column="1"
android:layout_margin="1dp"
android:background="#FFFFFF"
android:gravity="center"
android:text="Common Course"
android:textAppearance="?android:attr/textAppearanceLarge" />

<TextView
android:layout_width="wrap_content"
android:layout_height="match_parent"
android:textAppearance="?android:attr/textAppearanceLarge"
android:text="50"
android:layout_margin="1dp"
android:background="#FFFFFF"
android:gravity="center"
android:layout_column="2" />
</TableRow>
<TableRow
android:background="#000000"
android:layout_width="fill_parent"
android:layout_height="0dp"
android:layout_margin="1dp"
>

<TextView
android:layout_width="match_parent"
android:layout_height="match_parent"
android:textAppearance="?android:attr/textAppearanceLarge"
android:text="6"
android:layout_margin="1dp"
android:layout_column="0"
android:background="#FFFFFF"
android:gravity="center"
/>

<TextView
android:layout_width="250dp"
android:layout_height="76dp"
android:layout_column="1"
android:layout_margin="1dp"
android:background="#FFFFFF"
android:gravity="center"
android:text="Second Language (other than English)"
android:textAppearance="?android:attr/textAppearanceLarge" />

<TextView
android:layout_width="wrap_content"
android:layout_height="match_parent"
android:textAppearance="?android:attr/textAppearanceLarge"
android:text="50"
android:layout_margin="1dp"
android:background="#FFFFFF"
android:gravity="center"
android:layout_column="2" />
</TableRow>
<TextView
android:layout_width="wrap_content"
android:layout_height="48dp"
android:layout_column="0"
android:layout_margin="1dp"
android:background="#FFFFFF"
android:gravity="center"
android:text="BCA Third semester"
android:textAppearance="?android:attr/textAppearanceLarge"
android:textStyle="bold" />

<TableRow
android:background="#000000"
android:layout_width="fill_parent"
android:layout_height="0dp"
android:layout_margin="1dp"

>

<TextView
android:layout_width="27dp"
android:layout_height="match_parent"
android:layout_column="0"
android:layout_margin="1dp"
android:background="#FFFFFF"
android:gravity="center"
android:text="Paper No"
android:textAppearance="?android:attr/textAppearanceLarge"
android:textStyle="bold" />

<TextView
android:layout_width="192dp"
android:layout_height="match_parent"
android:layout_column="1"
android:layout_margin="1dp"
android:background="#FFFFFF"
android:gravity="center"
android:text="Paper"
android:textAppearance="?android:attr/textAppearanceLarge"
android:textStyle="bold" />

<TextView
android:layout_width="wrap_content"
android:layout_height="match_parent"
android:textAppearance="?android:attr/textAppearanceLarge"
android:text="Marks"
android:layout_margin="1dp"
android:background="#FFFFFF"
android:gravity="center"
android:textStyle="bold"
android:layout_column="2"
/>
</TableRow>

<TableRow
android:background="#000000"
android:layout_width="fill_parent"
android:layout_height="0dp"
android:layout_margin="1dp"
>

<TextView
android:layout_width="match_parent"
android:layout_height="match_parent"
android:textAppearance="?android:attr/textAppearanceLarge"
android:text="1"
android:layout_margin="1dp"
android:layout_column="0"
android:background="#FFFFFF"
android:gravity="center"
/>

<TextView
android:layout_width="237dp"
android:layout_height="64dp"
android:layout_column="1"
android:layout_margin="1dp"
android:background="#FFFFFF"
android:gravity="center"
android:text="Python Programming"
android:textAppearance="?android:attr/textAppearanceLarge" />

<TextView
android:layout_width="wrap_content"
android:layout_height="match_parent"
android:textAppearance="?android:attr/textAppearanceLarge"
android:text="75"
android:layout_margin="1dp"
android:background="#FFFFFF"
android:gravity="center"
android:layout_column="2" />
</TableRow>

<TableRow
android:layout_width="309dp"
android:layout_height="0dp"
android:layout_margin="1dp"
android:background="#000000">

<TextView
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_column="0"
android:layout_margin="1dp"
android:background="#FFFFFF"
android:gravity="center"
android:text="2"
android:textAppearance="?android:attr/textAppearanceLarge" />

<TextView
android:layout_width="250dp"
android:layout_height="123dp"
android:layout_column="1"
android:layout_margin="1dp"
android:background="#FFFFFF"
android:gravity="center"
android:text="Data Structures using C"
android:textAppearance="?android:attr/textAppearanceLarge" />

<TextView
android:layout_width="wrap_content"
android:layout_height="match_parent"
android:layout_column="2"
android:layout_margin="1dp"
android:background="#FFFFFF"
android:gravity="center"
android:text="75"
android:textAppearance="?android:attr/textAppearanceLarge" />
</TableRow>

<TableRow
android:background="#000000"
android:layout_width="fill_parent"
android:layout_height="0dp"
android:layout_margin="1dp"
>

<TextView
android:layout_width="match_parent"
android:layout_height="match_parent"
android:textAppearance="?android:attr/textAppearanceLarge"
android:text="3"
android:layout_margin="1dp"
android:layout_column="0"
android:background="#FFFFFF"
android:gravity="center"
/>

<TextView
android:layout_width="250dp"
android:layout_height="76dp"
android:layout_column="1"
android:layout_margin="1dp"
android:background="#FFFFFF"
android:gravity="center"
android:text="Computer Oriented Numerical and Statistical Methods"
android:textAppearance="?android:attr/textAppearanceLarge" />

<TextView
android:layout_width="wrap_content"
android:layout_height="match_parent"
android:textAppearance="?android:attr/textAppearanceLarge"
android:text="75"
android:layout_margin="1dp"
android:background="#FFFFFF"
android:gravity="center"
android:layout_column="2" />
</TableRow>
<TableRow
android:background="#000000"
android:layout_width="fill_parent"
android:layout_height="0dp"
android:layout_margin="1dp"
>

<TextView
android:layout_width="match_parent"
android:layout_height="match_parent"
android:textAppearance="?android:attr/textAppearanceLarge"
android:text="4"
android:layout_margin="1dp"
android:layout_column="0"
android:background="#FFFFFF"
android:gravity="center"
/>

<TextView
android:layout_width="250dp"
android:layout_height="76dp"
android:layout_column="1"
android:layout_margin="1dp"
android:background="#FFFFFF"
android:gravity="center"
android:text="Theory of Computation"
android:textAppearance="?android:attr/textAppearanceLarge" />

<TextView
android:layout_width="wrap_content"
android:layout_height="match_parent"
android:textAppearance="?android:attr/textAppearanceLarge"
android:text="50"
android:layout_margin="1dp"
android:background="#FFFFFF"
android:gravity="center"
android:layout_column="2" />
</TableRow>
<TableRow
android:background="#000000"
android:layout_width="fill_parent"
android:layout_height="0dp"
android:layout_margin="1dp"
>

<TextView
android:layout_width="match_parent"
android:layout_height="match_parent"
android:textAppearance="?android:attr/textAppearanceLarge"
android:text="5"
android:layout_margin="1dp"
android:layout_column="0"
android:background="#FFFFFF"
android:gravity="center"
/>

<TextView
android:layout_width="250dp"
android:layout_height="76dp"
android:layout_column="1"
android:layout_margin="1dp"
android:background="#FFFFFF"
android:gravity="center"
android:text="Sensors and Transducers"
android:textAppearance="?android:attr/textAppearanceLarge" />

<TextView
android:layout_width="wrap_content"
android:layout_height="match_parent"
android:textAppearance="?android:attr/textAppearanceLarge"
android:text="50"
android:layout_margin="1dp"
android:background="#FFFFFF"
android:gravity="center"
android:layout_column="2" />
</TableRow>
<TextView
android:layout_width="wrap_content"
android:layout_height="48dp"
android:layout_column="0"
android:layout_margin="1dp"
android:background="#FFFFFF"
android:gravity="center"
android:text="BCA Fourth semester"
android:textAppearance="?android:attr/textAppearanceLarge"
android:textStyle="bold" />

<TableRow
android:background="#000000"
android:layout_width="fill_parent"
android:layout_height="0dp"
android:layout_margin="1dp"

>

<TextView
android:layout_width="27dp"
android:layout_height="match_parent"
android:layout_column="0"
android:layout_margin="1dp"
android:background="#FFFFFF"
android:gravity="center"
android:text="Paper No"
android:textAppearance="?android:attr/textAppearanceLarge"
android:textStyle="bold" />

<TextView
android:layout_width="192dp"
android:layout_height="match_parent"
android:layout_column="1"
android:layout_margin="1dp"
android:background="#FFFFFF"
android:gravity="center"
android:text="Paper"
android:textAppearance="?android:attr/textAppearanceLarge"
android:textStyle="bold" />

<TextView
android:layout_width="wrap_content"
android:layout_height="match_parent"
android:textAppearance="?android:attr/textAppearanceLarge"
android:text="Marks"
android:layout_margin="1dp"
android:background="#FFFFFF"
android:gravity="center"
android:textStyle="bold"
android:layout_column="2"
/>
</TableRow>

<TableRow
android:background="#000000"
android:layout_width="fill_parent"
android:layout_height="0dp"
android:layout_margin="1dp"
>

<TextView
android:layout_width="match_parent"
android:layout_height="match_parent"
android:textAppearance="?android:attr/textAppearanceLarge"
android:text="1"
android:layout_margin="1dp"
android:layout_column="0"
android:background="#FFFFFF"
android:gravity="center"
/>

<TextView
android:layout_width="237dp"
android:layout_height="64dp"
android:layout_column="1"
android:layout_margin="1dp"
android:background="#FFFFFF"
android:gravity="center"
android:text="Data Communication and Optical Fibers"
android:textAppearance="?android:attr/textAppearanceLarge" />

<TextView
android:layout_width="wrap_content"
android:layout_height="match_parent"
android:textAppearance="?android:attr/textAppearanceLarge"
android:text="75"
android:layout_margin="1dp"
android:background="#FFFFFF"
android:gravity="center"
android:layout_column="2" />
</TableRow>

<TableRow
android:layout_width="309dp"
android:layout_height="0dp"
android:layout_margin="1dp"
android:background="#000000">

<TextView
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_column="0"
android:layout_margin="1dp"
android:background="#FFFFFF"
android:gravity="center"
android:text="2"
android:textAppearance="?android:attr/textAppearanceLarge" />

<TextView
android:layout_width="250dp"
android:layout_height="123dp"
android:layout_column="1"
android:layout_margin="1dp"
android:background="#FFFFFF"
android:gravity="center"
android:text="Microprocessors-Architecture and Programming"
android:textAppearance="?android:attr/textAppearanceLarge" />

<TextView
android:layout_width="wrap_content"
android:layout_height="match_parent"
android:layout_column="2"
android:layout_margin="1dp"
android:background="#FFFFFF"
android:gravity="center"
android:text="75"
android:textAppearance="?android:attr/textAppearanceLarge" />
</TableRow>

<TableRow
android:background="#000000"
android:layout_width="fill_parent"
android:layout_height="0dp"
android:layout_margin="1dp"
>

<TextView
android:layout_width="match_parent"
android:layout_height="match_parent"
android:textAppearance="?android:attr/textAppearanceLarge"
android:text="3"
android:layout_margin="1dp"
android:layout_column="0"
android:background="#FFFFFF"
android:gravity="center"
/>

<TextView
android:layout_width="250dp"
android:layout_height="76dp"
android:layout_column="1"
android:layout_margin="1dp"
android:background="#FFFFFF"
android:gravity="center"
android:text="Database Management System and RDBMS"
android:textAppearance="?android:attr/textAppearanceLarge" />

<TextView
android:layout_width="wrap_content"
android:layout_height="match_parent"
android:textAppearance="?android:attr/textAppearanceLarge"
android:text="75"
android:layout_margin="1dp"
android:background="#FFFFFF"
android:gravity="center"
android:layout_column="2" />
</TableRow>
<TableRow
android:background="#000000"
android:layout_width="fill_parent"
android:layout_height="0dp"
android:layout_margin="1dp"
>

<TextView
android:layout_width="match_parent"
android:layout_height="match_parent"
android:textAppearance="?android:attr/textAppearanceLarge"
android:text="4"
android:layout_margin="1dp"
android:layout_column="0"
android:background="#FFFFFF"
android:gravity="center"
/>

<TextView
android:layout_width="250dp"
android:layout_height="76dp"
android:layout_column="1"
android:layout_margin="1dp"
android:background="#FFFFFF"
android:gravity="center"
android:text="Programming Laboratory II: Data Structures and RDBMS"
android:textAppearance="?android:attr/textAppearanceLarge" />

<TextView
android:layout_width="wrap_content"
android:layout_height="match_parent"
android:textAppearance="?android:attr/textAppearanceLarge"
android:text="50"
android:layout_margin="1dp"
android:background="#FFFFFF"
android:gravity="center"
android:layout_column="2" />
</TableRow>
<TableRow
android:background="#000000"
android:layout_width="fill_parent"
android:layout_height="0dp"
android:layout_margin="1dp"
>

<TextView
android:layout_width="match_parent"
android:layout_height="match_parent"
android:textAppearance="?android:attr/textAppearanceLarge"
android:text="5"
android:layout_margin="1dp"
android:layout_column="0"
android:background="#FFFFFF"
android:gravity="center"
/>

<TextView
android:layout_width="250dp"
android:layout_height="76dp"
android:layout_column="1"
android:layout_margin="1dp"
android:background="#FFFFFF"
android:gravity="center"
android:text="Computer Graphics"
android:textAppearance="?android:attr/textAppearanceLarge" />

<TextView
android:layout_width="wrap_content"
android:layout_height="match_parent"
android:textAppearance="?android:attr/textAppearanceLarge"
android:text="50"
android:layout_margin="1dp"
android:background="#FFFFFF"
android:gravity="center"
android:layout_column="2" />
</TableRow>
</TableLayout>
</ScrollView>

DoubtHubActivity

xml
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout
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:id="@+id/activity_main"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:paddingBottom="@dimen/activity_vertical_margin"
android:paddingLeft="@dimen/activity_horizontal_margin"
android:paddingRight="@dimen/activity_horizontal_margin"
android:paddingTop="@dimen/activity_vertical_margin">

<com.google.android.material.floatingactionbutton.FloatingActionButton
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:clickable="true"
android:src="@drawable/ic_baseline_send_24"
android:id="@+id/fab"
android:tint="@android:color/white"
android:layout_alignParentBottom="true"
android:layout_alignParentEnd="true"
app:fabSize="mini"
android:layout_alignParentRight="true" />

<com.google.android.material.textfield.TextInputLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_toLeftOf="@id/fab"
android:layout_alignParentBottom="true"
android:layout_alignParentStart="true"
android:layout_alignParentLeft="true">

<EditText
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:hint="Input"
android:id="@+id/input"
/>
</com.google.android.material.textfield.TextInputLayout>

<ListView
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_alignParentTop="true"
android:layout_alignParentStart="true"
android:layout_above="@id/fab"
android:dividerHeight="16dp"
android:divider="@android:color/transparent"
android:id="@+id/list_of_messages"
android:layout_marginBottom="16dp"
android:layout_alignParentLeft="true" />
</RelativeLayout>

JAVA
package com.example.blooddonation.Student;

import androidx.annotation.NonNull;
import androidx.annotation.Nullable;
import androidx.appcompat.app.AppCompatActivity;

import android.content.Intent;
import android.os.Bundle;
import android.text.format.DateFormat;
import android.view.Menu;
import android.view.MenuItem;
import android.view.View;
import android.widget.EditText;
import android.widget.ListView;
import android.widget.TextView;
import android.widget.Toast;

import com.example.blooddonation.R;
import com.example.blooddonation.table.ChatMessage;
import com.facebook.internal.AnalyticsEvents;
import com.firebase.ui.database.FirebaseListAdapter;
import com.google.android.material.floatingactionbutton.FloatingActionButton;
import com.google.firebase.auth.FirebaseAuth;
import com.google.firebase.auth.FirebaseUser;
import com.google.firebase.database.ChildEventListener;
import com.google.firebase.database.DataSnapshot;
import com.google.firebase.database.DatabaseError;
import com.google.firebase.database.DatabaseReference;
import com.google.firebase.database.FirebaseDatabase;
import com.google.firebase.database.ValueEventListener;
import com.google.firebase.ktx.Firebase;
import org.jetbrains.annotations.NotNull;

import java.text.SimpleDateFormat;
import java.util.Calendar;
import java.util.Date;
import java.util.Locale;

public class DoubtHub extends AppCompatActivity {


private FirebaseListAdapter<ChatMessage> adapter;
private DatabaseReference db;
String username,emails;

@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_doubt_hub);
FloatingActionButton fab =
(FloatingActionButton)findViewById(R.id.fab);
Intent j=getIntent();
emails = j.getStringExtra("email");

fab.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View view) {
EditText input = (EditText)findViewById(R.id.input);

String message = input.getText().toString();


String user = FirebaseAuth.getInstance()
.getCurrentUser().getEmail();
db = FirebaseDatabase.getInstance().getReference("users");
if(user!=null) {

db.orderByChild("email").equalTo(user).addValueEventListener(new
ValueEventListener() {
@Override
public void onDataChange(@NonNull @NotNull DataSnapshot
snapshot) {
for (DataSnapshot datas : snapshot.getChildren()) {
User user = datas.getValue(User.class);
SimpleDateFormat sdf = new
SimpleDateFormat("yyyy-MM-dd HH:mm:ss", Locale.getDefault());
String currentDateandTime = sdf.format(new
Date());
username = user.getName().toString();
DatabaseReference databaseReference =
FirebaseDatabase.getInstance().getReference("chat");
Date currentTime =
Calendar.getInstance().getTime();
String id = databaseReference.push().getKey();
String date = currentTime.toString();
ChatMessage chatMessage = new
ChatMessage(message, username, currentDateandTime);

databaseReference.child(id).setValue(chatMessage);
}
}
@Override
public void onCancelled(@NonNull @NotNull DatabaseError
error) {

}
});
}
else{

db.orderByChild("email").equalTo(emails).addValueEventListener(new
ValueEventListener() {
@Override
public void onDataChange(@NonNull @NotNull DataSnapshot
snapshot) {
for (DataSnapshot datas : snapshot.getChildren()) {
User user = datas.getValue(User.class);
SimpleDateFormat sdf = new
SimpleDateFormat("yyyy-MM-dd HH:mm:ss", Locale.getDefault());
String currentDateandTime = sdf.format(new
Date());
username = user.getName().toString();
if (user == null) {

}
DatabaseReference databaseReference =
FirebaseDatabase.getInstance().getReference("chat");
Date currentTime =
Calendar.getInstance().getTime();
String id = databaseReference.push().getKey();
String date = currentTime.toString();
ChatMessage chatMessage = new
ChatMessage(message, username, currentDateandTime);

databaseReference.child(id).setValue(chatMessage);
}
}

@Override
public void onCancelled(@NonNull @NotNull DatabaseError
error) {
}
});

input.setText("");
}
});
ListView listOfMessages = (ListView)findViewById(R.id.list_of_messages);
db = FirebaseDatabase.getInstance().getReference("chat");
adapter = new FirebaseListAdapter<ChatMessage>(this, ChatMessage.class,
R.layout.message_area, db) {
@Override
protected void populateView(View v, ChatMessage model, int position)
{
// Get references to the views of message.xml
TextView messageText =
(TextView)v.findViewById(R.id.message_text);
TextView messageUser =
(TextView)v.findViewById(R.id.message_user);
TextView messageTime =
(TextView)v.findViewById(R.id.message_time);

// Set their text


messageText.setText(model.getMessageText());
messageUser.setText(model.getMessageUser());
messageTime.setText(model.getMessageDate());
}
};

listOfMessages.setAdapter(adapter);
}

@Override
public boolean onCreateOptionsMenu(Menu menu) {
getMenuInflater().inflate(R.menu.student_menu, menu);
return true;
}
@Override
public boolean onOptionsItemSelected(MenuItem item) {
int id = item.getItemId();

//noinspection SimplifiableIfStatement
if (id == R.id.logout) {
FirebaseAuth.getInstance().signOut();
Intent i = new Intent(getApplicationContext(), MainActivity.class);
i.putExtra("logout","logout");
startActivity(i);
finish();
return true;
}

return super.onOptionsItemSelected(item);
}
}

ViewAnnouncementActivity

xml

<?xml version="1.0" encoding="utf-8"?>


<RelativeLayout 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=".Student.ViewAnnnouncement">
<androidx.recyclerview.widget.RecyclerView
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:id="@+id/recyclerView"
android:layout_alignParentTop="true"
android:layout_alignParentLeft="true"
android:layout_alignParentStart="true">
</androidx.recyclerview.widget.RecyclerView>

</RelativeLayout>

Java
package com.example.blooddonation.Student;

import androidx.appcompat.app.AppCompatActivity;
import androidx.recyclerview.widget.LinearLayoutManager;
import androidx.recyclerview.widget.RecyclerView;

import android.app.ProgressDialog;
import android.content.Intent;
import android.os.Bundle;
import android.view.Menu;
import android.view.MenuItem;

import com.example.blooddonation.Adapter.Announcementadapter;
import com.example.blooddonation.R;
import com.example.blooddonation.table.ImageUploadInfo;
import com.google.firebase.auth.FirebaseAuth;
import com.google.firebase.database.DataSnapshot;
import com.google.firebase.database.DatabaseError;
import com.google.firebase.database.DatabaseReference;
import com.google.firebase.database.FirebaseDatabase;
import com.google.firebase.database.ValueEventListener;

import java.util.ArrayList;
import java.util.List;

public class ViewAnnnouncement extends AppCompatActivity {


DatabaseReference databaseReference;
RecyclerView recyclerView;
Announcementadapter adapter ;
ProgressDialog progressDialog;
List<ImageUploadInfo> list = new ArrayList<>();

@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_view_annnouncement);

recyclerView = (RecyclerView) findViewById(R.id.recyclerView);


recyclerView.setHasFixedSize(true);
recyclerView.setLayoutManager(new
LinearLayoutManager(ViewAnnnouncement.this));
progressDialog = new ProgressDialog(ViewAnnnouncement.this);
progressDialog.setMessage("Loading...");
progressDialog.show();

databaseReference =
FirebaseDatabase.getInstance().getReference("announcements");
databaseReference.addValueEventListener(new ValueEventListener() {
@Override
public void onDataChange(DataSnapshot snapshot) {
for (DataSnapshot postSnapshot : snapshot.getChildren()) {
ImageUploadInfo imageUploadInfo =
postSnapshot.getValue(ImageUploadInfo.class);
list.add(imageUploadInfo);
}
adapter = new Announcementadapter(getApplicationContext(),
list);
recyclerView.setAdapter(adapter);
progressDialog.dismiss();
}

@Override
public void onCancelled(DatabaseError databaseError) {
progressDialog.dismiss();
}
});
}
@Override
public boolean onCreateOptionsMenu(Menu menu) {
getMenuInflater().inflate(R.menu.menu_main, menu);
return true;
}
@Override
public boolean onOptionsItemSelected(MenuItem item) {
int id = item.getItemId();
if (id == R.id.logout) {
FirebaseAuth.getInstance().signOut();
Intent i = new Intent(getApplicationContext(), MainActivity.class);
i.putExtra("logout","logout");
startActivity(i);
finish();
return true;
}
return super.onOptionsItemSelected(item);
}
}

AnnouncementAdapterClass

package com.example.blooddonation.Adapter;

import android.content.Context;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.ImageView;
import android.widget.RelativeLayout;
import android.widget.TextView;
import androidx.recyclerview.widget.RecyclerView;
import com.bumptech.glide.Glide;
import com.example.blooddonation.R;
import com.example.blooddonation.table.ImageUploadInfo;

import java.util.List;

public class Announcementadapter extends


RecyclerView.Adapter<Announcementadapter.ViewHolder> {

Context context;
List<ImageUploadInfo> MainImageUploadInfoList;
public Announcementadapter(Context context, List<ImageUploadInfo> TempList)
{
this.MainImageUploadInfoList = TempList;
this.context = context;
}

@Override
public ViewHolder onCreateViewHolder(ViewGroup parent, int viewType) {
View view =
LayoutInflater.from(parent.getContext()).inflate(R.layout.row_announcements,
parent, false);
ViewHolder viewHolder = new ViewHolder(view);
return viewHolder;
}

@Override
public void onBindViewHolder(ViewHolder holder, int position) {
ImageUploadInfo UploadInfo = MainImageUploadInfoList.get(position);
holder.imageNameTextView.setText(UploadInfo.getImageName());
if(UploadInfo.getImageURL().equals("null")){
holder.imageView.getLayoutParams().height = 0;
holder.relative.getLayoutParams().height = 150;
}
else{
holder.imageNameTextView.setText(UploadInfo.getImageName());
}

Glide.with(context).load(UploadInfo.getImageURL()).into(holder.imageView);
}

@Override
public int getItemCount() {
return MainImageUploadInfoList.size();
}

class ViewHolder extends RecyclerView.ViewHolder {

public ImageView imageView;


public TextView imageNameTextView;
public RelativeLayout relative;

public ViewHolder(View itemView) {


super(itemView);
imageView = (ImageView) itemView.findViewById(R.id.imageView);
imageNameTextView = (TextView)
itemView.findViewById(R.id.ImageNameTextView);
relative = (RelativeLayout) itemView.findViewById(R.id.relative);
}
}
}

You might also like