Professional Documents
Culture Documents
On
SCD Notice Board
Submitted To
First of all we would like to thank the almighty,who has always guided us to work
on the right path of the life.We take immense pleasure in thanking everyone who
has helped us to conceive and develop the project.We acknowledge with deep
sense of gratitude and most sincere appreciation,the valueable guidance and
unfailing encouragement rendered to us by Mr.Ishant kumar,”Technical Lead
and director of Auribises Technologies Pvt Ltd” for their proficient and
enthusiastic guidance,useful encouragement and immense help.We express our
heartfelt gratitude to the Principal, Dr. Dharam Singh Sandhu and HOD
Dr.Gursharan Singh sandhu, SCD Govt. College, Ludhiana and the management
for providing the needed infrastructure.We wish to express our deep sense of
gratitude to Our Internal Guide and Project Leader, Mr. Varun Jain and
Mr.Vijay Sehgal for their able guidance and useful suggestions, which helped us
in completing the project work, in time. Without them the project could not have
been materialized.Finally, yet importantly, we would like to express our heartfelt
thanks to our beloved parents for their blessings, friends/classmates for their help
and wishes for the successful completion of this project.
We thank all these people fervently as these were the leaders and we simply
followed them.
Payal
2
Preface
The well planned properly executed and evaluated training helps a lot in including
good culture. It provides linkage between the student and the institution in order to
develop the awareness of approach to problem solving based on broad
understanding of process and mode of operation of an organization.
This report serves the purpose of elaborating the analysis and the implementation
phases of the above-mentioned project. All the features that have been clearly
explained to make the project easy to understand. It has been taken care that this
document elicits the system development process in a clear and well-documented
manner.
In the beginning we have provided an abstract into the general features of the
project. During our stay here we learnt how an actual project progress, what sort of
problems actually occur during the development of such projects, how to produce
quality products and so on.
3
Student Declaration
Payal hereby declare that the project report submitted to the PANJAB
UNIVERSITY in partial fulfillment for the reward of degree in Master of Science
in information Technology entitled “SCD Notice Board” is original piece of
research work carried out by me under the supervision of Mr.Varun Jain and Vijay
Sehgal. I further declare that information has been collected from genuine and
authentic resource. It has not been submitted before for any degree or examination
to any other University
Payal
Place:
4
Certificate
This is to certify that this Project Report entitled“SCD Notice Board”Has been
submitted for the partial fulfillment of the requirement of the degree of Masters of
Computer Science (Information Technology 4th semester) of PANJAB
UNIVERSITY, CHANDIGARH. .
This project is bonafide work ofPayal Under supervision and no part of it has been
submitted for any other degrees.
______________
5
Certificate
This is to certify that this Project Report entitled“SCD Notice Board”Has been
submitted for the partial fulfillment of the requirement of the degree of Masters of
Computer Science (Information Technology 4th semester) of PANJAB
UNIVERSITY, CHANDIGARH. .
This project is bonafide work ofPayal Under supervision and no part of it has been
submitted for any other degrees.
______________
6
Table of Contents
Sr. No Topic Pg. No Rema
rks
1. Introduction to Company 8
3. SDLC 12-13
5. Requirements need 14
6. DFD 15
7. Introduction to Android 16
7
Introduction to Company
Auribises offers a suite of mobile, web and software applications as a solution to
industry. The company was founded in November 2011. With unparalleled domain
competencies in mobile and web, Auribises is poised to take on critical challenges
that the industry manifests. Our culture is values based, and we assure the highest
ethical standards of integrity, transparency and corporate governance. Our value
system is driven by STAR, the acronym for our core values of Share, Time,
Achieve, and Respect. Auribises just not only develop, but also provide
educational services that help students to hone their technical skills. Auribises
offers a unique combination of technical competencies with practical exposure on
ongoing projects to its students. Auribises has a core vision for lightening
thousands of candles with a single candle and hence we believe that it is our
endeavor to continually share our learning’s with the larger world.
Web Development
Mobile Apps
Technical Training
Corporate Training
Training Programs:
8
Introduction To Project
The Android Based college campus application is developed to provide students
information regarding college activities such as events organized at college level
and departmental level as well, curricular activities, general notices, placement
activities etc. This information should be provided to students in an effective way.
Today it is imperative to not only use the traditional forms of communication, but
also newer forms such as mobile technology for quicker and easier communication
among the students.
An android based college campus is an application that can be accessed throughout
the organization and especially by the students in a well manner with proper login
provided when needed. Using this application students will able to stay updated
with their assignments provided in the class, timetables of examinations,
attendance, etc.
An android based college campus to share the college campus activities application
will provide updates to the students of their respective departments, notices
regarding the recruiting company, campus interview date and other placement
activities.
Taking the manual work in the consideration, we can find that the Student has to
interact with the person in Office, brief on the requirements they expect and so on.
All these require more time and labour. The data collected may be inconsistent,
redundant and getting in touch with a remotes student will become impossible.
Instead of manual Notice Board College can use the electronic flow of data, at the
time of manual notice may occurs the errors but in the electronic flow system low
errors are occurs. Now a day’s everybody is using high quality and Android
supported mobiles. So in this project we are using Android for communication
between college and students.
9
Objective
The proposed system’s objectives are to overcome all the limitations and
drawbacks of the existing system. The online GCG application is user-friendly and
application. The main objective of the application is its simplicity of design and
ease of implementation that shows and helps to collect most of the information
about events going on in college premises. The interface will be very user-friendly.
Project Formulation
To develop a mobile application that will help you receiving the notices from the
college, anywhere, anytime. Earlier their problem that notices were pasted on the
notice board. If there is a holiday on the next day, nobody will be able to read it.
Moreover any update on website is also difficult. Everyone feels lazy to go and
update the website data. The more easy way is, just type in message sitting
wherever and post by pressing a button. It will notify all the staff and students,
registered with that application.
10
Identification of Need
As we discussed earlier that manual maintenance of a notice is a tedious job.
So to enhance the ease of working, we go for this package.
Giving the facility to convey message to all the students anytime and
anywhere.
Making students updated about all the events and activities going on the
college.
The student will not require standing in the crowd to see the notice. There
will be no issue of fighting in order to see the notice first. Everyone is first to
see that notice inside their own mobile phone anywhere and anytime.
The least but most important it saves time.
Utilizing less man power. As there are many persons involved in circulating
the message. With this application, only one person is required to post the
notice. Rest of the man power is saved in the entire process.
11
Software Development Life Cycle
Overview:
12
Purpose:
The purpose of a System Development Life Cycle methodology is to provide IT
Project Managers with the tools to help ensure successful implementation of
systems that satisfy Agency strategic and business objectives. The documentation
provides a mechanism to ensure leadership, functional managers and users sign-off
on the requirements and implementation of the system. The process provides
Agency managers and the project manager with the visibility of design,
development and implementation status needed to ensure delivery on-time and
within budget.
Goals:
Deliver quality systems which meet or exceed customer expectations when
promised and within cost estimates.
Provide a framework for developing quality systems using an identifiable,
measureable, and repeatable process.
Establish a project management structure to ensure that each system
development project is effectively managed throughout its life lifecycle.
Identify and assign the roles and responsibilities of all involved parties,
including functional and technical managers, throughout the system
development life cycle.
Ensure that system development requirements are well defined and
subsequently satisfied.
Objectives
The System Development Life Cycle methodology will help to achieve these goals
by:
13
System Analysis need
The software we have on our home computers is very different to that
used on company computers
The software is more complex hence problems that may arise are much
bigger, hence it would be too difficult for one person to manage alone,
we would need team of people
In order to create and maintain a software for a company there would
need to be a formal plan
System analysis is essential, to plan the software and to enable members
of the team to communicate during development and also afterwards.
Requirements Analysis:
When it comes to the success of life there needs to be perfection and the quality
of development and the strength of achievement. Success comes only when we
have all the above factors, and when talking about the software development
you need the analysis. Analysis of what is being introduced in the society, how
is it going to work and how will the market respond to it. This analysis is really
very important if you don't want failure at the first attempt of your introduction
to software. So you need software requirement analysis which will definitely
lead you to the heights of perfection when your software is introduced.
14
DFD
A data flow diagram is a graphical representation of the “flow” of data through an
information system, modeling its process aspects. A Data Flow Diagram is a
structured analysis and design tool that can be used for flowcharting in place of, or
in association with, information-oriented systems flowcharts. A DFD is often used
as a preliminary step to create an overview of the system, which can later be
elaborated. DFDs can also be used for the utilizing of data processing.
A DFD shows what kind of information will be input to and output from the
system, where the data will come from and go to, and where the data will be
stored. It does not show information about the timing of process or information
about whether processes will operate in sequence or in parallel.
Splash
Admin User
Delete notice
Contact us
Update notice
About Us
View all users
Home
Notice
15
Introduction to Android
Android is an open source and Linux-based Operating System for mobile devices
such as smart phones and tablet computers.
Android was developed by the Open Handset Alliance, led by Google, and other
companies.
The first beta version of the Android Software Development Kit(SDK) was released
by Google in 2007 where as the first commercial version ,Android 1.0 was released
in September 2008.
On June 27, 2012, at the Google I/O conference, Google announced the next
Android version 4.1 Jelly Bean. Jelly Bean is an incredible update, with the primary
aim of improving the user interface, both in terms of functionality and performance.
The source code for Android is available under free and open source software
licenses. Google publishes most of the code under the Apache License version 2.0
and the rest, Linux kernel changes, under the GNU General Public License version2.
Features of Android
With Android operating system (OS) Kit Kat version 4.4 rolling out to mobile
devices across the globe, Google is on to something—Android is now more
popular than iOS or the Windows phone. The OS tends to garner rave reviews for
its ease of use and open source, but many iOS or Windows phone users argue that
their preferred operating system can do just as much. In some respects that’s true,
but here are 10 features unique to Android’s OS.
16
2) Alternate Keyboards
Android supports multiple keyboards and makes them easy to install; the Swift
Key, Skype, and 8pen apps all offer ways to quickly change up your keyboard
style. Other mobile operating systems either don’t permit extra keyboards at all, or
the process to install and use them is tedious and time-consuming.
3) Infrared Transmission
The Android operating system supports a built-in infrared transmitter, allowing
you to use your phone or tablet as a remote control.
4) No-Touch Control
Using Android apps such as Wave Control, users can control their phones touch-
free, using only gestures. Have messy hands but need to turn off your screen or
change a song? Simple. This could prove especially useful if you’re driving, so you
can keep both eyes on the road.
5) Automation
The Tasker app lets you not only control app permissions but also automate them.
Do you only want your location services to be active during the day? Want to
create a customized way to start your music—for example, with a voice command
and at a certain volume? Tasker can help.
17
Nova, Apex or Slide and you can add gestures, new shortcuts, or even performance
enhancements for older-model devices.
9) Widgets
Apps are versatile, but sometimes you want information at a glance instead of
having to open an app and wait for it to load. Android widgets let you display just
about any feature you choose, right on the home screen—including weather apps,
music widgets, or productivity tools that helpfully remind you of upcoming
meetings or approaching deadlines.
Android Applications:
Android applications are usually developed in the Java language using the Android
Software Development Kit. Once developed, Android applications can be packaged
easily and sold out either through a store such as Google Play or the Amazon
Appstore. Android powers hundreds of millions of mobile devices in more than 190
countries around the world. It’s the largest installed base of any mobile platform and
growing fast. Every day more than 1 million new Android devices are activated
worldwide.
18
Technology Used
Front End
Android Studio, made by Google and powered by IntelliJ, is the official IDE;
however, developers are free to use others. Additionally, developers may use any
text editor to edit Java and XML files ,then use command line tools(Java
Development Kit and Apache Ant are required) to create ,build and debug Android
applications as well as control attached Android devices
The Android build process depends on a number of tools from the JDK. Check out
the build system overview documentation. The first big piece we need from JDK is
javac all your source code written in Java needs to be completed before it can be
converted to the DEX format.
Once your code has been compiled, dexed, and packaged into an APK, we need jar
signer to sign the APK.
There are some efforts out there to bring Java 8 features to Android, most notably
gradle. Some of these require JDK 8 to compile properly.
19
Back End:
Firebase Connectivity:
Firebase is also a database backend for android, iOS and web applications.
Firebase is Google provided API to create a database and fetch from it in real time
with only a few lines of code. Data is stored as JSON and is accessible from all the
platforms. Firebase is a paid service and you get 200 MB of storage space for free.
Firebase Features: Once firebase API included into android or iOS application,
one can you firebase features with simple lines of code. How to add firebase to the
android application is covered in next section. Firebase provided features are listed
below:
2. Authentication: Auth feature in firebase let you let only authorized users access
your application. Firebase provides login through Gmail, Github, twitter, facebook
and also let the developer create custom authentication.
5. Storage: Firebase also provides storage facility. It can store and retrieve content
like images, videos and audio directly from client SDK. Uploading and
downloading is done in the background. Data stores are safe and the only
authorized user can access it.
6. Hosting: firebase is also used for hosting purposes. Firebase delivers web
content very fast and content is always delivered securely
20
7. Crash reporting: crash reporting feature on firebase creates reports of error in
your app after its release. Errors are grouped into different groups according to
how severe error is. You can also create custom events to catch steps leading to the
crashing of the application.
You can add firebase API to any project intended for Android 2.3 (Gingerbread) or
newer and have Google Play services 9.6.1 or newer. Following steps are followed
next:
1. You have to create a project in firebase console. Enter project name and your
location. Project name under firebase console can be anything and can also be
different from your application name.
2. Click on Add Firebase to your Android app and follow steps mentioned there.
3. You will be prompted with a page asking your package name and optional
SHA-1 certificate. You can get your SHA-1 code from android studio easily.
After adding firebase to your android project you have to integrate Firebase
libraries into your project by following steps:
21
Tools used for project
Android Studio
It was announced on May 16, 2013 at the Google I/O conference. Android Studio
is freely available under the Apache License 2.0.
Android Studio was in early access preview stage starting from version 0.1 in May
2013, then entered beta stage starting from version 0.8 which was released in June
2014.
Based on Jet Brains IntelliJ IDEA software, Android studio is designed specifically
for Android development. It is available for download on Windows, Mac OS X
and Linux, and replaced Eclipse Android Development Tools (ADT) as Google’s
primary IDE for native Android application development
Although Eclipse is not the only Java development environment that can be used to
develop Android applications, it is by far the most popular. This is partially due to
its cost (free) but mostly due the strong integration of the Android tools with
Eclipse. This integration is achieved with the Android Development Tools (ADT)
plug-in for Eclipse, which can be downloaded from the Android website.
22
Android Tool 2: The SDK and AVD Manager
This tool serves a number of important functions. It manages the different versions
of the Android SDKs that you can develop for, as well as third-party add-ons,
tools, devices drivers, and documentation. Its second function is to manage the
Android Virtual Device configuration (AVDs) you use to configure emulator
instances.
The Android Debug Bridge (ADB) connects other tools with the emulator and
devices. Besides being critical for the other tools to function, you can use it
yourself from the command line to upload and download files, install and uninstall
packages, and access many other features via the shell on the device or emulator.
Emulator in Android
An Android emulator is an Android Virtual Device (AVD) that represents a
specific Android device. You can use an Android emulator as a target platform to
run and test your Android applications on your PC.
23
Android Manifest
Every app project must have an AndroidManifest.xml file (with precisely that
name) at the root of the project source set. The manifest file describes essential
information about your app to the Android build tools, the Android operating
system, and Google Play.
Android Studio:
Android Studio replaced Eclipse as the main IDE for Android development in
2014. With this change Google has revamped the way developers can take
advantage of all the Android development tools.
Creating a new application:
24
25
26
Android Layout Types
There are number of Layouts provided by Android which you will use in almost
all the Android applications to provide different view, look and feel.
1 Linear Layout
2 Relative Layout
3 Table Layout
Table Layout is a view that groups views into rows and columns.
4 Absolute Layout
5 List View
27
Layout Attributes
Each layout has a set of attributes which define the visual properties of that layout.
There are few common attributes among all the layouts and their are other
attributes which are specific to that layout. Following are common attributes and
will be applied to all the layouts:
1 android:id
This is the ID which uniquely identifies the view.
2 android:layout_width
This is the width of the layout.
3 android:layout_height
This is the height of the layout
4 android:layout_marginTop
This is the extra space on the top side of the layout.
5 android:layout_marginBottom
This is the extra space on the bottom side of the layout.
6 android:layout_marginLeft
This is the extra space on the left side of the layout.
7 android:layout_marginRight
This is the extra space on the right side of the layout.
28
8 android:layout_gravity
This specifies how child Views are positioned.
9 android:layout_weight
This specifies how much of the extra space in the layout should
be allocated to the View.
10 android:layout_x
This specifies the x-coordinate of the layout.
11 android:layout_y
This specifies the y-coordinate of the layout.
12 android:layout_width
This is the width of the layout.
13 android:layout_width
This is the width of the layout.
14 android:paddingLeft
This is the left padding filled for the layout.
15 android:paddingRight
This is the right padding filled for the layout.
16 android:paddingTop
This is the top padding filled for the layout.
29
Android UI Controls
There are number of UI controls provided by Android that allow you to build the
graphical user interface for your app.
1 TextView
2 EditText
3 AutoCompleteTextView
4 Button
5 ImageButton
6 CheckBox
An on/off switch that can be toggled by the user. You should use
check box when presenting users with a group of selectable options
30
that are not mutually exclusive.
7 ToggleButton
8 RadioButton
9 RadioGroup
10 ProgressBar
11 Spinner
A drop-down list that allows users to select one value from a set.
12 TimePicker
13 DatePicker
31
Additional Components
There are additional components which will be used in the construction of above
mentioned entities, their logic, and wiring between them. These components are –
1 Fragments
Represents a portion of user interface in an Activity.
Views
2
UI elements that are drawn on-screen including buttons, lists forms
etc.
Layouts
3
View hierarchies that control screen format and appearance of the
views.
Intents
4
Messages wiring components together.
Resources
5
External elements, such as strings, constants and drawable pictures.
Manifest
6
Configurations file for the application.
32
CODING:
Notice Adapter
package com.example.scdapp.adapter;
import android.content.Context;
import android.support.annotation.NonNull;
import android.support.v4.app.FragmentActivity;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import com.example.scdapp.R;
import com.example.scdapp.holder.NoticeHolder;
import com.example.scdapp.listener.OnRecyclerItemClickListener;
import com.example.scdapp.listener.RecyclerAdapterClickListener;
import com.example.scdapp.model.Notice;
import com.example.scdapp.model.User;
import com.example.scdapp.ui.NoticeBoard;
import com.firebase.ui.firestore.FirestoreRecyclerAdapter;
import com.firebase.ui.firestore.FirestoreRecyclerOptions;
public class NoticeAdapter extends
FirestoreRecyclerAdapter<Notice,NoticeHolder> implements
OnRecyclerItemClickListener {
RecyclerAdapterClickListener recyclerAdapterClickListener;
public void setRecyclerAdapterClickListener(RecyclerAdapterClickListener
recyclerAdapterClickListener) {
this.recyclerAdapterClickListener = recyclerAdapterClickListener;
}
@Override
protected void onBindViewHolder(NoticeHolder holder, int position, Notice
model) {
holder.txtName.setText(model.title);
holder.txtEmail.setText(model.body);
holder.txtdate.setText(model.date);
33
}
@NonNull
@Override
public NoticeHolder onCreateViewHolder(@NonNull ViewGroup parent, int
viewType) {
View view =
LayoutInflater.from(parent.getContext()).inflate(R.layout.list_item1, parent, false);
return noticeHolder;
}
@Override
public void onRecyclerItemClicked() {
recyclerAdapterClickListener.onRecyclerAdapterClicked(0);
}
}
PrincipalAdapter
package com.example.scdapp.adapter;
import android.content.Context;
import android.support.annotation.NonNull;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.Toast;
34
import com.example.scdapp.R;
import com.example.scdapp.holder.NoticeHolder;
import com.example.scdapp.holder.PrincipalHolder;
import com.example.scdapp.listener.OnRecyclerItemClickListener;
import com.example.scdapp.listener.RecyclerAdapterClickListener;
import com.example.scdapp.model.Notice;
import com.example.scdapp.model.PrincipalNotice;
import com.firebase.ui.firestore.FirestoreRecyclerAdapter;
import com.firebase.ui.firestore.FirestoreRecyclerOptions;
import com.google.android.gms.tasks.OnFailureListener;
import com.google.android.gms.tasks.OnSuccessListener;
import com.google.firebase.firestore.FirebaseFirestore;
/**
* Created by admin on 4/22/2018.
*/
Context context;
PrincipalNotice notice;
FirebaseFirestore firestore;
RecyclerAdapterClickListener recyclerAdapterClickListener;
@Override
protected void onBindViewHolder(PrincipalHolder holder, int position,
PrincipalNotice model) {
35
holder.txtName.setText(model.title);
holder.txtEmail.setText(model.body);
holder.txtdate.setText(model.date);
}
@NonNull
@Override
public PrincipalHolder onCreateViewHolder(@NonNull ViewGroup parent, int
viewType) {
View view =
LayoutInflater.from(parent.getContext()).inflate(R.layout.list_item2, parent, false);
@Override
public void onRecyclerItemClicked() {
firestore.collection("principalnotice").document(String.valueOf(notice)).delete().ad
dOnSuccessListener(new OnSuccessListener<Void>() {
@Override
public void onSuccess(Void aVoid) {
Toast.makeText(context,"deleted
successfully",Toast.LENGTH_LONG).show();
}
}).addOnFailureListener(new OnFailureListener() {
@Override
public void onFailure(@NonNull Exception e) {
Toast.makeText(context,"deleted not
successfully",Toast.LENGTH_LONG).show();
36
}
});
recyclerAdapterClickListener.onRecyclerAdapterClicked(0);
}
}
UserAdapter
package com.example.scdapp.adapter;
import android.support.annotation.NonNull;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import com.example.scdapp.R;
import com.example.scdapp.holder.UserHolder;
import com.example.scdapp.listener.OnRecyclerItemClickListener;
import com.example.scdapp.listener.RecyclerAdapterClickListener;
import com.example.scdapp.model.User;
import com.firebase.ui.firestore.FirestoreRecyclerAdapter;
import com.firebase.ui.firestore.FirestoreRecyclerOptions;
RecyclerAdapterClickListener recyclerAdapterClickListener;
@Override
protected void onBindViewHolder(UserHolder holder, int position, User model)
{
37
holder.txtName.setText(model.name);
holder.txtEmail.setText(model.email);
}
@NonNull
@Override
public UserHolder onCreateViewHolder(@NonNull ViewGroup parent, int
viewType) {
View view =
LayoutInflater.from(parent.getContext()).inflate(R.layout.list_item,parent,false);
return userHolder;
}
@Override
public void onRecyclerItemClicked() {
recyclerAdapterClickListener.onRecyclerAdapterClicked(0);
}
}
NoticeHolder
package com.example.scdapp.holder;
import android.support.annotation.NonNull;
import android.support.v7.widget.RecyclerView;
import android.view.View;
import android.widget.TextView;
38
import com.example.scdapp.R;
import com.example.scdapp.listener.OnRecyclerItemClickListener;
public class NoticeHolder extends RecyclerView.ViewHolder implements
View.OnClickListener {
txtName = itemView.findViewById(R.id.textViewName7);
txtEmail = itemView.findViewById(R.id.textViewEmail7);
txtdate=itemView.findViewById(R.id.textdate);
itemView.setOnClickListener(this);
}
@Override
public void onClick(View v) {
recyclerItemClickListener.onRecyclerItemClicked();
}
}
PrincipalHolder
package com.example.scdapp.holder;
import android.support.annotation.NonNull;
import android.support.v7.widget.RecyclerView;
39
import android.view.View;
import android.widget.TextView;
import com.example.scdapp.R;
import com.example.scdapp.listener.OnRecyclerItemClickListener;
public class PrincipalHolder extends RecyclerView.ViewHolder implements
View.OnClickListener {
public TextView txtName;
public TextView txtEmail;
public TextView txtdate;
txtName = itemView.findViewById(R.id.textViewName8);
txtEmail = itemView.findViewById(R.id.textViewEmail8);
txtdate=itemView.findViewById(R.id.textdate8);
itemView.setOnClickListener(this);
}
@Override
public void onClick(View v) {
recyclerItemClickListener.onRecyclerItemClicked();
}
}
UserHolder
package com.example.scdapp.holder;
import android.support.annotation.NonNull;
import android.support.v7.widget.RecyclerView;
import android.view.View;
40
import android.widget.TextView;
import com.example.scdapp.R;
import com.example.scdapp.listener.OnRecyclerItemClickListener;
import com.example.scdapp.adapter.UserAdapter;
txtName = itemView.findViewById(R.id.textViewName);
txtEmail = itemView.findViewById(R.id.textViewEmail);
itemView.setOnClickListener(this);
}
@Override
public void onClick(View v) {
recyclerItemClickListener.onRecyclerItemClicked();
}
}
OnRecyclerItemClickListener
package com.example.scdapp.listener;
public interface OnRecyclerItemClickListener {
41
void onRecyclerItemClicked();
}
OnRecyclerAdapterClickListener
package com.example.scdapp.listener;
Grid
package com.example.scdapp.model;
public class Grid {
int icon;
String name;
public Grid(){
}
GridAdapter
package com.example.scdapp.model;
import android.content.Context;
import android.support.annotation.NonNull;
import android.support.annotation.Nullable;
42
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.ArrayAdapter;
import com.example.scdapp.R;
import android.widget.ImageView;
import android.widget.TextView;
import java.util.ArrayList;
import java.util.List;
Context context;
int resource;
ArrayList<Grid> gridList;
public GridAdapter(Context context, int resource, ArrayList<Grid> objects) {
super(context, resource, objects);
this.context=context;
this.resource=resource;
this.gridList=objects;
}
@Override
public View getView(int position, @Nullable View convertView, @NonNull
ViewGroup parent) {
View view=null;
view= LayoutInflater.from(context).inflate(resource,parent,false);
ImageView imageView=view.findViewById(R.id.imageView);
TextView textView=view.findViewById(R.id.textName);
Grid grid=gridList.get(position);
imageView.setBackgroundResource(grid.getIcon());
textView.setText(grid.getName());
return view;
}
}
43
ModelClass
package com.example.scdapp.model;
public class ModelClass {
String title,image;
public ModelClass(){
}
public ModelClass(String title, String image) {
this.title = title;
this.image = image;
}
Notice
package com.example.scdapp.model;
public class Notice {
public String title;
public String body;
public String date;
44
public Notice(){
}
public Notice(String title, String body, String date) {
this.title = title;
this.body = body;
this.date = date;
}
}
PrincipalNotice
package com.example.scdapp.model;
public class PrincipalNotice {
}
public PrincipalNotice(String title, String body, String date) {
this.title = title;
this.body = body;
this.date = date;
}
}
User
package com.example.scdapp.model;
public class User {
public User(String email, String password, String city, String class1, String
gender, String name, String phoneno, String rollno) {
this.email = email;
this.password = password;
this.city = city;
this.class1 = class1;
this.gender = gender;
this.name = name;
this.phoneno = phoneno;
this.rollno = rollno;
}
}
MybaseTaskService
package com.example.scdapp.storage;
import android.app.NotificationChannel;
import android.app.NotificationManager;
import android.app.PendingIntent;
import android.app.Service;
import android.content.Context;
import android.content.Intent;
import android.os.Build;
import android.support.v4.app.NotificationCompat;
import android.util.Log;
import com.example.scdapp.R;
public abstract class MyBaseTaskService extends Service {
46
static final int PROGRESS_NOTIFICATION_ID = 0;
static final int FINISHED_NOTIFICATION_ID = 1;
private static final String TAG = "MyBaseTaskService";
private int mNumTasks = 0;
47
/**
* Show notification with a progress bar.
*/
protected void showProgressNotification(String caption, long completedUnits,
long totalUnits) {
int percentComplete = 0;
if (totalUnits > 0) {
percentComplete = (int) (100 * completedUnits / totalUnits);
}
createDefaultChannel();
NotificationCompat.Builder builder = new NotificationCompat.Builder(this,
CHANNEL_ID_DEFAULT)
.setSmallIcon(R.drawable.ic_file_upload_white_24dp)
.setContentTitle(getString(R.string.app_name))
.setContentText(caption)
.setProgress(100, percentComplete, false)
.setOngoing(true)
.setAutoCancel(false);
NotificationManager manager =
(NotificationManager)
getSystemService(Context.NOTIFICATION_SERVICE);
manager.notify(PROGRESS_NOTIFICATION_ID, builder.build());
}
/**
* Show notification that the activity finished.
*/
protected void showFinishedNotification(String caption, Intent intent, boolean
success) {
// Make PendingIntent for notification
PendingIntent pendingIntent = PendingIntent.getActivity(this, 0 /*
requestCode */, intent,
PendingIntent.FLAG_UPDATE_CURRENT);
48
createDefaultChannel();
NotificationCompat.Builder builder = new NotificationCompat.Builder(this,
CHANNEL_ID_DEFAULT)
.setSmallIcon(icon)
.setContentTitle(getString(R.string.app_name))
.setContentText(caption)
.setAutoCancel(true)
.setContentIntent(pendingIntent);
NotificationManager manager =
(NotificationManager)
getSystemService(Context.NOTIFICATION_SERVICE);
manager.notify(FINISHED_NOTIFICATION_ID, builder.build());
}
/**
* Dismiss the progress notification.
*/
protected void dismissProgressNotification() {
NotificationManager manager =
(NotificationManager)
getSystemService(Context.NOTIFICATION_SERVICE);
manager.cancel(PROGRESS_NOTIFICATION_ID);
}
}
MyDownloadService /**
* Copyright 2016 Google Inc. All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express
or implied.
49
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package com.example.scdapp.storage;
import android.content.Intent;
import android.content.IntentFilter;
import android.os.IBinder;
import android.support.annotation.NonNull;
import android.support.annotation.Nullable;
import android.support.v4.content.LocalBroadcastManager;
import android.util.Log;
import com.example.scdapp.R;
import com.example.scdapp.ui.MainActivity;
import com.google.android.gms.tasks.OnFailureListener;
import com.google.android.gms.tasks.OnSuccessListener;
import com.google.firebase.storage.FirebaseStorage;
import com.google.firebase.storage.StorageReference;
import com.google.firebase.storage.StreamDownloadTask;
import java.io.IOException;
import java.io.InputStream;
/**
* Service to handle downloading files from Firebase Storage.
*/
public class MyDownloadService extends MyBaseTaskService {
@Override
public void onCreate() {
super.onCreate();
// Initialize Storage
mStorageRef = FirebaseStorage.getInstance().getReference();
}
@Nullable
@Override
public IBinder onBind(Intent intent) {
return null;
}
@Override
public int onStartCommand(Intent intent, int flags, int startId) {
Log.d(TAG, "onStartCommand:" + intent + ":" + startId);
if (ACTION_DOWNLOAD.equals(intent.getAction())) {
// Get the path to download from the intent
String downloadPath =
intent.getStringExtra(EXTRA_DOWNLOAD_PATH);
downloadFromPath(downloadPath);
}
return START_REDELIVER_INTENT;
}
51
// Download and get total bytes
mStorageRef.child(downloadPath).getStream(
new StreamDownloadTask.StreamProcessor() {
@Override
public void doInBackground(StreamDownloadTask.TaskSnapshot
taskSnapshot,
InputStream inputStream) throws IOException {
long totalBytes = taskSnapshot.getTotalByteCount();
long bytesDownloaded = 0;
showProgressNotification(getString(R.string.progress_downloading),
bytesDownloaded, totalBytes);
}
/**
* Broadcast finished download (success or failure).
* @return true if a running receiver received the broadcast.
*/
private boolean broadcastDownloadFinished(String downloadPath, long
bytesDownloaded) {
boolean success = bytesDownloaded != -1;
String action = success ? DOWNLOAD_COMPLETED :
DOWNLOAD_ERROR;
/**
* Show a notification for a finished download.
*/
private void showDownloadFinishedNotification(String downloadPath, int
bytesDownloaded) {
// Hide the progress notification
dismissProgressNotification();
53
// Make Intent to MainActivity
Intent intent = new Intent(this, MainActivity.class)
.putExtra(EXTRA_DOWNLOAD_PATH, downloadPath)
.putExtra(EXTRA_BYTES_DOWNLOADED, bytesDownloaded)
.addFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP |
Intent.FLAG_ACTIVITY_SINGLE_TOP);
return filter;
}
}
MyUploadService
package com.example.scdapp.storage;
import android.content.Intent;
import android.content.IntentFilter;
import android.net.Uri;
import android.os.IBinder;
import android.support.annotation.NonNull;
import android.support.annotation.Nullable;
import android.support.v4.content.LocalBroadcastManager;
import android.util.Log;
import com.example.scdapp.R;
import com.example.scdapp.ui.MainActivity;
import com.google.android.gms.tasks.OnFailureListener;
import com.google.android.gms.tasks.OnSuccessListener;
import com.google.firebase.storage.FirebaseStorage;
54
import com.google.firebase.storage.OnProgressListener;
import com.google.firebase.storage.StorageReference;
import com.google.firebase.storage.UploadTask;
/**
* Service to handle uploading files to Firebase Storage.
*/
public class MyUploadService extends MyBaseTaskService {
// [START declare_ref]
private StorageReference mStorageRef;
// [END declare_ref]
@Override
public void onCreate() {
super.onCreate();
// [START get_storage_ref]
mStorageRef = FirebaseStorage.getInstance().getReference();
// [END get_storage_ref]
}
@Nullable
@Override
public IBinder onBind(Intent intent) {
return null;
}
@Override
55
public int onStartCommand(Intent intent, int flags, int startId) {
Log.d(TAG, "onStartCommand:" + intent + ":" + startId);
if (ACTION_UPLOAD.equals(intent.getAction())) {
Uri fileUri = intent.getParcelableExtra(EXTRA_FILE_URI);
uploadFromUri(fileUri);
}
return START_REDELIVER_INTENT;
}
// [START upload_from_uri]
private void uploadFromUri(final Uri fileUri) {
Log.d(TAG, "uploadFromUri:src:" + fileUri.toString());
// [START_EXCLUDE]
taskStarted();
showProgressNotification(getString(R.string.progress_uploading), 0, 0);
// [END_EXCLUDE]
// [START get_child_ref]
// Get a reference to store file at photos/<FILENAME>.jpg
final StorageReference photoRef = mStorageRef.child("photos")
.child(fileUri.getLastPathSegment());
// [END get_child_ref]
56
public void onSuccess(UploadTask.TaskSnapshot taskSnapshot) {
// Upload succeeded
Log.d(TAG, "uploadFromUri:onSuccess");
// [START_EXCLUDE]
broadcastUploadFinished(downloadUri, fileUri);
showUploadFinishedNotification(downloadUri, fileUri);
taskCompleted();
// [END_EXCLUDE]
}
})
.addOnFailureListener(new OnFailureListener() {
@Override
public void onFailure(@NonNull Exception exception) {
// Upload failed
Log.w(TAG, "uploadFromUri:onFailure", exception);
// [START_EXCLUDE]
broadcastUploadFinished(null, fileUri);
showUploadFinishedNotification(null, fileUri);
taskCompleted();
// [END_EXCLUDE]
}
});
}
// [END upload_from_uri]
/**
* Broadcast finished upload (success or failure).
* @return true if a running receiver received the broadcast.
*/
private boolean broadcastUploadFinished(@Nullable Uri downloadUrl,
@Nullable Uri fileUri) {
boolean success = downloadUrl != null;
57
Intent broadcast = new Intent(action)
.putExtra(EXTRA_DOWNLOAD_URL, downloadUrl)
.putExtra(EXTRA_FILE_URI, fileUri);
return LocalBroadcastManager.getInstance(getApplicationContext())
.sendBroadcast(broadcast);
}
/**
* Show a notification for a finished upload.
*/
private void showUploadFinishedNotification(@Nullable Uri downloadUrl,
@Nullable Uri fileUri) {
// Hide the progress notification
dismissProgressNotification();
return filter;
}
58
AboutUs
package com.example.scdapp.ui;
import android.os.Bundle;
import android.support.annotation.Nullable;
import android.support.v4.app.Fragment;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import com.example.scdapp.R;
public class AboutUs extends Fragment {
@Nullable
@Override
public View onCreateView(LayoutInflater inflater, @Nullable ViewGroup
container, @Nullable Bundle savedInstanceState) {
return inflater.inflate(R.layout.fragment_about_us,null);
}
@Override
public void onViewCreated(View view, @Nullable Bundle savedInstanceState)
{
super.onViewCreated(view, savedInstanceState);
}
}
AddNoticeActivity
package com.example.scdapp.ui;
import android.content.Intent;
import android.support.v7.app.AppCompatActivity;
import android.os.Bundle;
import android.view.View;
import android.widget.Button;
import android.widget.ImageView;
import com.example.scdapp.R;
public class AddNoticeActivity extends AppCompatActivity {
Button btn1,btn2;
ImageView imgnotice,imgnotice2;
59
void initviews(){
btn1=findViewById(R.id.button9);
imgnotice=findViewById(R.id.imagedailynotice);
imgnotice2=findViewById(R.id.imageView5);
btn1.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View view) {
Intent intent=new Intent(AddNoticeActivity.this,MainActivity.class);
startActivity(intent);
}
});
imgnotice.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View view) {
Intent intent=new
Intent(AddNoticeActivity.this,TextNoticeActivity.class);
startActivity(intent);
}
});
imgnotice2.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View view) {
Intent intent=new
Intent(AddNoticeActivity.this,TextNotice1Activity.class);
startActivity(intent);
}
});
}
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_add_notice);
initviews();
}
}
60
AdminLoginActivity
package com.example.scdapp.ui;
import android.app.ProgressDialog;
import android.content.Intent;
import android.graphics.Paint;
import android.support.annotation.NonNull;
import android.support.v7.app.ActionBar;
import android.support.v7.app.AppCompatActivity;
import android.os.Bundle;
import android.util.Log;
import android.view.View;
import android.widget.Button;
import android.widget.EditText;
import android.widget.TextView;
import android.widget.Toast;
import com.example.scdapp.R;
import com.example.scdapp.model.User;
import com.google.android.gms.tasks.OnCompleteListener;
import com.google.android.gms.tasks.OnFailureListener;
import com.google.android.gms.tasks.Task;
import com.google.firebase.auth.AuthResult;
import com.google.firebase.auth.FirebaseAuth;
import com.google.firebase.firestore.CollectionReference;
import com.google.firebase.firestore.FirebaseFirestore;
Button btn;
TextView textView;
EditText email,password;
FirebaseAuth auth;
User user;
FirebaseFirestore firestore;
CollectionReference userColection;
ProgressDialog progressDialog;
void initview(){
btn=findViewById(R.id.buttonLogin);
email=findViewById(R.id.editTextEmailAdmin);
61
password=findViewById(R.id.editTextPassAdmin);
textView=findViewById(R.id.forgetPassword);
textView.setPaintFlags(textView.getPaintFlags()|
Paint.UNDERLINE_TEXT_FLAG);
btn.setOnClickListener(this);
}
void loginUser(){
progressDialog.show();
auth.signInWithEmailAndPassword(user.email,user.password).addOnCompleteLis
tener(this, new OnCompleteListener<AuthResult>() {
@Override
public void onComplete(@NonNull Task<AuthResult> task) {
if (task.isSuccessful()){
Toast.makeText(AdminLoginActivity.this,"Login Success
!!",Toast.LENGTH_LONG).show();
Intent intent=new Intent(AdminLoginActivity.this,gridActivity.class);
startActivity(intent);
finish();
progressDialog.dismiss();
}
}
}
).addOnFailureListener(this, new OnFailureListener() {
@Override
public void onFailure(@NonNull Exception e) {
Log.i("User","User Login failed:"+e.getMessage());
e.printStackTrace();
progressDialog.dismiss();
}
});
}
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_admin_login);
// ActionBar actionBar=getSupportActionBar();
// actionBar.setDisplayShowHomeEnabled(true);
62
//actionBar.setIcon(R.drawable.admin);
// actionBar.setDisplayShowTitleEnabled(true);
// actionBar.setTitle("Admin Login");
initview();
auth=FirebaseAuth.getInstance();
firestore=FirebaseFirestore.getInstance();
userColection=firestore.collection("admin");
user=new User();
progressDialog=new ProgressDialog(this);
progressDialog.setMessage("Please Wait...");
progressDialog.setCancelable(false);
}
@Override
public void onClick(View view) {
user.email=email.getText().toString().trim();
user.password=password.getText().toString().trim();
loginUser();
}
ContactUs
package com.example.scdapp.ui;
import android.Manifest;
import android.content.Intent;
import android.content.pm.PackageManager;
import android.graphics.Paint;
import android.net.Uri;
import android.os.Bundle;
import android.support.annotation.Nullable;
import android.support.v4.app.ActivityCompat;
import android.support.v4.app.Fragment;
import android.view.LayoutInflater;
import android.view.View;
63
import android.view.ViewGroup;
import android.widget.TextView;
import com.example.scdapp.R;
public class ContactUs extends Fragment {
TextView textView;
@Nullable
@Override
public View onCreateView(LayoutInflater inflater, @Nullable ViewGroup
container, @Nullable Bundle savedInstanceState) {
return inflater.inflate(R.layout.contact_us,null);
}
@Override
public void onViewCreated(View view, @Nullable Bundle savedInstanceState)
{
super.onViewCreated(view, savedInstanceState);
textView=view.findViewById(R.id.textView2);
textView.setPaintFlags(textView.getPaintFlags()|
Paint.UNDERLINE_TEXT_FLAG);
view.findViewById(R.id.imageView9).setOnClickListener(new
View.OnClickListener() {
@Override
public void onClick(View v) {
Intent intent = new Intent(Intent.ACTION_CALL);
intent.setData(Uri.parse("tel:8557039419"));
if (ActivityCompat.checkSelfPermission(getActivity(),
Manifest.permission.CALL_PHONE) !=
PackageManager.PERMISSION_GRANTED) {
return;
}
startActivity(intent);
}
});
}
}
64
DailyNoticeActivity
package com.example.scdapp.ui;
import android.support.v7.app.AppCompatActivity;
import android.os.Bundle;
import android.support.v7.widget.DividerItemDecoration;
import android.support.v7.widget.LinearLayoutManager;
import android.support.v7.widget.RecyclerView;
import com.example.scdapp.R;
import com.example.scdapp.adapter.NoticeAdapter;
import com.example.scdapp.listener.RecyclerAdapterClickListener;
import com.example.scdapp.model.Notice;
import com.firebase.ui.firestore.FirestoreRecyclerOptions;
import com.google.firebase.auth.FirebaseAuth;
import com.google.firebase.firestore.FirebaseFirestore;
import com.google.firebase.firestore.Query;
import java.util.ArrayList;
FirebaseFirestore firestore;
FirebaseAuth auth;
String uid;
RecyclerView recyclerView;
LinearLayoutManager linearLayoutManager;
NoticeAdapter noticeAdapter;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_daily_notice);
firestore = FirebaseFirestore.getInstance();
auth = FirebaseAuth.getInstance();
recyclerView = findViewById(R.id.recyclerView1);
65
linearLayoutManager = new LinearLayoutManager(this);
recyclerView.setLayoutManager(linearLayoutManager);
final ArrayList<Notice> userList = new ArrayList<>();
@Override
public void onRecyclerAdapterClicked(int position) {
}
}
GridActivity
package com.example.scdapp.ui;
import android.content.Intent;
import android.support.v7.app.AppCompatActivity;
import android.os.Bundle;
import android.view.View;
import android.widget.AdapterView;
import android.widget.ListView;
import android.widget.Toast;
66
import com.example.scdapp.R;
import com.example.scdapp.model.Grid;
import com.example.scdapp.model.GridAdapter;
import java.util.ArrayList;
public class gridActivity extends AppCompatActivity {
ListView listView;
ArrayList<Grid> gridList;
GridAdapter adapter;
void initViews(){
listView=findViewById(R.id.listView);
Grid g1=new Grid(R.drawable.add,"Add Notice");
Grid g2=new Grid(R.drawable.delete,"Delete Notice");
Grid g3=new Grid(R.drawable.update,"Update Notice");
Grid g4=new Grid(R.drawable.usersicon,"View All Users");
gridList=new ArrayList<Grid>();
gridList.add(g1);
gridList.add(g2);
gridList.add(g3);
gridList.add(g4);
adapter=new GridAdapter(this,R.layout.grid1,gridList);
listView.setAdapter(adapter);
listView.setOnItemClickListener(new AdapterView.OnItemClickListener() {
@Override
public void onItemClick(AdapterView<?> parent, View view, int position,
long id) {
Grid notice = adapter.getItem(position);
Toast.makeText(gridActivity.this,"you
selected"+notice,Toast.LENGTH_LONG).show();
switch (position){
case 0:
Intent intent=new Intent(gridActivity.this,AddNoticeActivity.class);
startActivity(intent);
Toast.makeText(gridActivity.this,"Add Notice
Selected",Toast.LENGTH_LONG).show();
break;
67
case 1:
Toast.makeText(gridActivity.this,"Delete Notice
Selected",Toast.LENGTH_LONG).show();
break;
case 2:
Toast.makeText(gridActivity.this,"Update Notice
Selected",Toast.LENGTH_LONG).show();
break;
case 3:
Intent intent1=new
Intent(gridActivity.this,ViewAllUsersActivity.class);
startActivity(intent1);
Toast.makeText(gridActivity.this,"View All Users
Selected",Toast.LENGTH_LONG).show();
break;
}
});
}
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_grid);
initViews();
}
HomeFragment
package com.example.scdapp.ui;
import android.os.Bundle;
import android.support.annotation.Nullable;
import android.support.v4.app.Fragment;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
68
import android.webkit.WebSettings;
import android.webkit.WebView;
import android.widget.Toast;
import com.example.scdapp.R;
/**
* Created by admin on 4/17/2018.
*/
WebView webView;
@Nullable
@Override
public View onCreateView(LayoutInflater inflater, @Nullable ViewGroup
container, @Nullable Bundle savedInstanceState) {
return inflater.inflate(R.layout.fragment_home,null);
}
@Override
public void onViewCreated(View view, @Nullable Bundle savedInstanceState)
{
super.onViewCreated(view, savedInstanceState);
webView=view.findViewById(R.id.webview1);
WebSettings webSettings=webView.getSettings();
webSettings.setJavaScriptEnabled(true);
webView.loadUrl("http://www.scdgovtcollege.ac.in/");
}
}
MainActivity
package com.example.scdapp.ui;
import android.app.ProgressDialog;
import android.content.BroadcastReceiver;
import android.content.Context;
import android.content.Intent;
import android.net.Uri;
69
import android.os.Bundle;
import android.support.annotation.NonNull;
import android.support.v4.content.LocalBroadcastManager;
import android.support.v7.app.AlertDialog;
import android.support.v7.app.AppCompatActivity;
import android.util.Log;
import android.view.Menu;
import android.view.MenuItem;
import android.view.View;
import android.widget.TextView;
import android.widget.Toast;
import com.example.scdapp.storage.MyDownloadService;
import com.example.scdapp.storage.MyUploadService;
import com.google.android.gms.tasks.OnFailureListener;
import com.google.android.gms.tasks.OnSuccessListener;
import com.google.firebase.auth.AuthResult;
import com.google.firebase.auth.FirebaseAuth;
import com.google.firebase.auth.FirebaseUser;
import java.util.Locale;
import com.example.scdapp.R;
/**
* Activity to upload and download photos from Firebase Storage.
*
* See {@link MyUploadService} for upload example.
* See {@link MyDownloadService} for download example.
*/
public class MainActivity extends AppCompatActivity implements
View.OnClickListener {
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
// Click listeners
findViewById(R.id.button_camera).setOnClickListener(this);
findViewById(R.id.button_sign_in).setOnClickListener(this);
findViewById(R.id.button_download).setOnClickListener(this);
switch (intent.getAction()) {
case MyDownloadService.DOWNLOAD_COMPLETED:
// Get number of bytes downloaded
long numBytes =
intent.getLongExtra(MyDownloadService.EXTRA_BYTES_DOWNLOADED,
0);
71
// Alert success
showMessageDialog(getString(R.string.success),
String.format(Locale.getDefault(),
"%d bytes downloaded from %s",
numBytes,
intent.getStringExtra(MyDownloadService.EXTRA_DOWNLOAD_PATH)));
break;
case MyDownloadService.DOWNLOAD_ERROR:
// Alert failure
showMessageDialog("Error", String.format(Locale.getDefault(),
"Failed to download from %s",
intent.getStringExtra(MyDownloadService.EXTRA_DOWNLOAD_PATH)));
break;
case MyUploadService.UPLOAD_COMPLETED:
case MyUploadService.UPLOAD_ERROR:
onUploadResultIntent(intent);
break;
}
}
};
}
@Override
public void onNewIntent(Intent intent) {
super.onNewIntent(intent);
@Override
public void onStart() {
super.onStart();
updateUI(mAuth.getCurrentUser());
72
// Register receiver for uploads and downloads
LocalBroadcastManager manager =
LocalBroadcastManager.getInstance(this);
manager.registerReceiver(mBroadcastReceiver,
MyDownloadService.getIntentFilter());
manager.registerReceiver(mBroadcastReceiver,
MyUploadService.getIntentFilter());
}
@Override
public void onStop() {
super.onStop();
LocalBroadcastManager.getInstance(this).unregisterReceiver(mBroadcastReceiver
);
}
@Override
public void onSaveInstanceState(Bundle out) {
super.onSaveInstanceState(out);
out.putParcelable(KEY_FILE_URI, mFileUri);
out.putParcelable(KEY_DOWNLOAD_URL, mDownloadUrl);
}
@Override
protected void onActivityResult(int requestCode, int resultCode, Intent data) {
Log.d(TAG, "onActivityResult:" + requestCode + ":" + resultCode + ":" +
data);
if (requestCode == RC_TAKE_PICTURE) {
if (resultCode == RESULT_OK) {
mFileUri = data.getData();
if (mFileUri != null) {
uploadFromUri(mFileUri);
} else {
Log.w(TAG, "File URI is null");
}
} else {
73
Toast.makeText(this, "Taking picture failed.",
Toast.LENGTH_SHORT).show();
}
}
}
74
private void launchCamera() {
Log.d(TAG, "launchCamera");
updateUI(mAuth.getCurrentUser());
75
}
findViewById(R.id.layout_download).setVisibility(View.VISIBLE);
} else {
((TextView) findViewById(R.id.picture_download_uri))
.setText(null);
findViewById(R.id.layout_download).setVisibility(View.GONE);
}
}
mProgressDialog.setMessage(caption);
mProgressDialog.show();
}
@Override
public boolean onCreateOptionsMenu(Menu menu) {
getMenuInflater().inflate(R.menu.menu_main, menu);
return true;
}
@Override
public boolean onOptionsItemSelected(MenuItem item) {
int i = item.getItemId();
if (i == R.id.action_logout) {
FirebaseAuth.getInstance().signOut();
updateUI(null);
return true;
} else {
return super.onOptionsItemSelected(item);
}
}
@Override
public void onClick(View v) {
int i = v.getId();
if (i == R.id.button_camera) {
launchCamera();
} else if (i == R.id.button_sign_in) {
signInAnonymously();
} else if (i == R.id.button_download) {
beginDownload();
}
77
}
}
NoticeBoard
package com.example.scdapp.ui;
import android.content.Intent;
import android.os.Bundle;
import android.support.annotation.Nullable;
import android.support.v4.app.Fragment;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import com.example.scdapp.R;
import com.example.scdapp.listener.RecyclerAdapterClickListener;
/**
* Created by admin on 4/18/2018.
*/
public class NoticeBoard extends Fragment implements
RecyclerAdapterClickListener {
@Nullable
@Override
public View onCreateView(LayoutInflater inflater, @Nullable ViewGroup
container, @Nullable Bundle savedInstanceState) {
return inflater.inflate(R.layout.boad_notice,null);
}
@Override
public void onViewCreated(View view, @Nullable Bundle savedInstanceState)
{
super.onViewCreated(view, savedInstanceState);
view.findViewById(R.id.imageView4).setOnClickListener(new
View.OnClickListener() {
78
@Override
public void onClick(View v) {
Intent intent=new Intent(getContext(),DailyNoticeActivity.class);
startActivity(intent);
}
});
view.findViewById(R.id.imageView15).setOnClickListener(new
View.OnClickListener() {
@Override
public void onClick(View v) {
Intent intent=new Intent(getContext(),PrincipalNoticeActivity.class);
startActivity(intent);
}
});
}
@Override
public void onRecyclerAdapterClicked(int position) {
}
}
PasswordActivity
package com.example.scdapp.ui;
import android.content.Intent;
import android.support.annotation.NonNull;
import android.support.v7.app.AppCompatActivity;
import android.os.Bundle;
import android.view.View;
import android.widget.Button;
import android.widget.EditText;
import android.widget.Toast;
import com.example.scdapp.R;
import com.example.scdapp.model.User;
import com.google.android.gms.tasks.OnCompleteListener;
import com.google.android.gms.tasks.Task;
import com.google.firebase.auth.FirebaseAuth;
79
public class PasswordActivity extends AppCompatActivity {
EditText resetText;
Button resetPassword;
FirebaseAuth auth;
User user;
void initViews(){
resetText=findViewById(R.id.passwordEmail);
resetPassword=findViewById(R.id.resetPassword);
}
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_password);
initViews();
auth=FirebaseAuth.getInstance();
user=new User();
resetPassword.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
user.email=resetText.getText().toString().trim();
if(user.email.equals("")){
Toast.makeText(PasswordActivity.this,"please enter your registered
email id",Toast.LENGTH_LONG).show();
}else {
auth.sendPasswordResetEmail(user.email).addOnCompleteListener(new
OnCompleteListener<Void>() {
@Override
public void onComplete(@NonNull Task<Void> task) {
if(task.isSuccessful()){
Toast.makeText(PasswordActivity.this,"password reset email
sent! ",Toast.LENGTH_LONG).show();
Intent intent=new
Intent(PasswordActivity.this,UserLoginActivity.class);
startActivity(intent);
finish();
80
}else {
Toast.makeText(PasswordActivity.this," Erroe in sending
password reset email ",Toast.LENGTH_LONG).show();
}
}
});
}
}
});
}
}
PrincipalNoticeActivity
package com.example.scdapp.ui;
import android.support.v7.app.AppCompatActivity;
import android.os.Bundle;
import android.support.v7.widget.DividerItemDecoration;
import android.support.v7.widget.LinearLayoutManager;
import android.support.v7.widget.RecyclerView;
import com.example.scdapp.R;
import com.example.scdapp.adapter.NoticeAdapter;
import com.example.scdapp.adapter.PrincipalAdapter;
import com.example.scdapp.listener.RecyclerAdapterClickListener;
import com.example.scdapp.model.Notice;
import com.example.scdapp.model.PrincipalNotice;
import com.firebase.ui.firestore.FirestoreRecyclerOptions;
import com.google.firebase.auth.FirebaseAuth;
import com.google.firebase.firestore.FirebaseFirestore;
import com.google.firebase.firestore.Query;
import java.util.ArrayList;
FirebaseFirestore firestore;
81
FirebaseAuth auth;
String uid;
RecyclerView recyclerView;
LinearLayoutManager linearLayoutManager;
PrincipalAdapter principalAdapter;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_principal_notice);
firestore = FirebaseFirestore.getInstance();
auth = FirebaseAuth.getInstance();
recyclerView = findViewById(R.id.recyclerView2);
/*firestore.collection("users").document(uid).delete().addOnSuccessListener(new
OnSuccessListener<Void>() {
@Override
public void onSuccess(Void aVoid) {
}
});*/
recyclerView.setLayoutManager(linearLayoutManager);
final ArrayList<PrincipalNotice> userList = new ArrayList<>();
principalAdapter.startListening();
recyclerView.setAdapter(principalAdapter);
@Override
public void onRecyclerAdapterClicked(int position) {
}
}
SelectActivity
package com.example.scdapp.ui;
import android.content.Intent;
import android.graphics.Paint;
import android.support.v7.app.AppCompatActivity;
import android.os.Bundle;
import android.view.View;
import android.widget.Button;
import android.widget.TextView;
import com.example.scdapp.R;
TextView text1,text2;
void initviews(){
text1=findViewById(R.id.text5);
83
text2=findViewById(R.id.text6);
text1.setPaintFlags(text1.getPaintFlags()|
Paint.UNDERLINE_TEXT_FLAG);
text2.setPaintFlags(text2.getPaintFlags()|
Paint.UNDERLINE_TEXT_FLAG);
text1.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View view) {
Intent intent=new Intent(SelectActivity.this,AdminLoginActivity.class);
startActivity(intent);
}
});
text2.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View view) {
Intent intent=new Intent(SelectActivity.this,UserSelectActivity.class);
startActivity(intent);
}
});
}
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_select);
initviews();
}
}
SelectUserActivity
package com.example.scdapp.ui;
import android.support.v7.app.AppCompatActivity;
import android.os.Bundle;
import com.example.scdapp.R;
84
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_select_user);
}
}
SplashActivity
package com.example.scdapp.ui;
import android.content.Intent;
import android.os.Handler;
import android.os.Message;
import android.support.v7.app.AppCompatActivity;
import android.os.Bundle;
import com.example.scdapp.R;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_splash);
// getSupportActionBar().hide();
handler.sendEmptyMessageDelayed(101,3000);
}
Handler handler = new Handler(){
@Override
public void handleMessage(Message msg) {
if(msg.what == 101){
Intent intent = new Intent(SplashActivity.this,SelectActivity.class);
startActivity(intent);
finish();
}
}
85
};
}
TextNotice1Activity
package com.example.scdapp.ui;
import android.app.DatePickerDialog;
import android.app.ProgressDialog;
import android.support.annotation.NonNull;
import android.support.v7.app.AppCompatActivity;
import android.os.Bundle;
import android.view.View;
import android.widget.Button;
import android.widget.DatePicker;
import android.widget.EditText;
import android.widget.Toast;
import com.example.scdapp.R;
import com.example.scdapp.model.Notice;
import com.example.scdapp.model.PrincipalNotice;
import com.google.android.gms.tasks.OnFailureListener;
import com.google.android.gms.tasks.OnSuccessListener;
import com.google.firebase.auth.FirebaseAuth;
import com.google.firebase.firestore.CollectionReference;
import com.google.firebase.firestore.FirebaseFirestore;
import java.util.Calendar;
EditText editText1,editText2,editText3;
Button btnDate,btnPost;
DatePickerDialog datePickerDialog;
String date;
FirebaseAuth auth;
PrincipalNotice notice;
FirebaseFirestore firestore;
CollectionReference usercollection;
ProgressDialog progressDialog;
86
void initViews(){
editText1=findViewById(R.id.editTextTitle1);
editText2=findViewById(R.id.editTextBody1);
editText3=findViewById(R.id.editTextDate1);
btnDate=findViewById(R.id.buttonDate1);
btnPost=findViewById(R.id.buttonPost1);
btnPost.setOnClickListener(this);
btnDate.setOnClickListener(clickListener);
datePickerDialog=new DatePickerDialog(this,dateSetListener,yy,mm,dd);
auth=FirebaseAuth.getInstance();
firestore=FirebaseFirestore.getInstance();
usercollection=firestore.collection("principalnotice");
notice=new PrincipalNotice();
progressDialog=new ProgressDialog(this);
progressDialog.setMessage("Please wait...");
progressDialog.setCancelable(false);
void saveNotice(){
usercollection.document().set(notice).addOnSuccessListener(new
OnSuccessListener<Void>() {
@Override
public void onSuccess(Void aVoid) {
Toast.makeText(TextNotice1Activity.this,"notice saved in
DB",Toast.LENGTH_LONG).show();
}
}).addOnFailureListener(new OnFailureListener() {
@Override
87
public void onFailure(@NonNull Exception e) {
Toast.makeText(TextNotice1Activity.this,"notice not saved in
DB",Toast.LENGTH_LONG).show();
}
});
}
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_text_notice1);
initViews();
}
@Override
public void onClick(View v) {
notice.title=editText1.getText().toString().trim();
notice.body=editText2.getText().toString().trim();
notice.date=editText3.getText().toString().trim();
saveNotice();
}
View.OnClickListener clickListener=new View.OnClickListener() {
@Override
public void onClick(View v) {
datePickerDialog.show();
}
};
DatePickerDialog.OnDateSetListener dateSetListener=new
DatePickerDialog.OnDateSetListener() {
@Override
public void onDateSet(DatePicker view, int y, int m, int d) {
date=d+"/"+(m+1)+"/"+y;
editText3.setText(date);
}
};
}
88
TextNoticeActivity
package com.example.scdapp.ui;
import android.app.DatePickerDialog;
import android.app.ProgressDialog;
import android.support.annotation.NonNull;
import android.support.v7.app.AppCompatActivity;
import android.os.Bundle;
import android.view.View;
import android.widget.Button;
import android.widget.DatePicker;
import android.widget.EditText;
import android.widget.Toast;
import com.example.scdapp.R;
import com.example.scdapp.model.Notice;
import com.google.android.gms.tasks.OnFailureListener;
import com.google.android.gms.tasks.OnSuccessListener;
import com.google.firebase.auth.FirebaseAuth;
import com.google.firebase.firestore.CollectionReference;
import com.google.firebase.firestore.FirebaseFirestore;
import java.util.Calendar;
editText1=findViewById(R.id.editTextTitle);
editText2=findViewById(R.id.editTextBody);
editText3=findViewById(R.id.editTextDate);
btnDate=findViewById(R.id.buttonDate);
89
btnPost=findViewById(R.id.buttonPost);
btnPost.setOnClickListener(this);
btnDate.setOnClickListener(clickListener);
datePickerDialog=new DatePickerDialog(this,dateSetListener,yy,mm,dd);
auth=FirebaseAuth.getInstance();
firestore=FirebaseFirestore.getInstance();
usercollection=firestore.collection("notice");
notice=new Notice();
progressDialog=new ProgressDialog(this);
progressDialog.setMessage("Please wait...");
progressDialog.setCancelable(false);
void saveNotice(){
usercollection.document().set(notice).addOnSuccessListener(new
OnSuccessListener<Void>() {
@Override
public void onSuccess(Void aVoid) {
Toast.makeText(TextNoticeActivity.this,"notice saved in
DB",Toast.LENGTH_LONG).show();
}
}).addOnFailureListener(new OnFailureListener() {
@Override
public void onFailure(@NonNull Exception e) {
Toast.makeText(TextNoticeActivity.this,"notice not saved in
DB",Toast.LENGTH_LONG).show();
}
});
}
@Override
90
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_text_notice);
initViews();
}
}
};
DatePickerDialog.OnDateSetListener dateSetListener=new
DatePickerDialog.OnDateSetListener() {
@Override
public void onDateSet(DatePicker view, int y, int m, int d) {
date=d+"/"+(m+1)+"/"+y;
editText3.setText(date);
}
};
@Override
public void onClick(View v) {
notice.title=editText1.getText().toString().trim();
notice.body=editText2.getText().toString().trim();
notice.date=editText3.getText().toString().trim();
saveNotice();
}
}
UpdateNoticeActivity
package com.example.scdapp.ui;
import android.support.v7.app.AppCompatActivity;
import android.os.Bundle;
91
import com.example.scdapp.R;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_update_notice);
}
}
UserHomeActivity
package com.example.scdapp.ui;
import android.app.ProgressDialog;
import android.content.Intent;
import android.os.Bundle;;
import android.support.v4.app.Fragment;
import android.support.v4.app.FragmentManager;
import android.support.v4.app.FragmentTransaction;
import android.support.design.widget.NavigationView;
import android.support.v4.view.GravityCompat;
import android.support.v4.widget.DrawerLayout;
import android.support.v7.app.ActionBarDrawerToggle;
import android.support.v7.app.AppCompatActivity;
import android.support.v7.widget.Toolbar;
import android.view.Menu;
import android.view.MenuItem;
import android.webkit.WebSettings;
import android.webkit.WebView;
import com.example.scdapp.R;
import com.google.firebase.auth.FirebaseAuth;
HomeFragment homeFragment;
NoticeBoard noticeBoard;
ContactUs contactUs;
AboutUs aboutUs;
92
Fragment fragment;
FragmentTransaction fragmentTransaction;
FragmentManager fragmentManager;
FirebaseAuth auth;
WebView webView;
ProgressDialog progressDialog;
void initViews(){
homeFragment=new HomeFragment();
noticeBoard=new NoticeBoard();
contactUs=new ContactUs();
aboutUs=new AboutUs();
auth=FirebaseAuth.getInstance();
webView=findViewById(R.id.webView);
WebSettings webSettings=webView.getSettings();
webSettings.setJavaScriptEnabled(true);
webView.loadUrl("http://www.scdgovtcollege.ac.in/");
}
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_user_home);
progressDialog=new ProgressDialog(this);
progressDialog.setMessage("Please Wait... ");
progressDialog.setCancelable(false);
Toolbar toolbar = (Toolbar) findViewById(R.id.toolbar);
setSupportActionBar(toolbar);
DrawerLayout drawer = (DrawerLayout) findViewById(R.id.drawer_layout);
ActionBarDrawerToggle toggle = new ActionBarDrawerToggle(
this, drawer, toolbar, R.string.navigation_drawer_open,
R.string.navigation_drawer_close);
drawer.addDrawerListener(toggle);
toggle.syncState();
NavigationView navigationView = (NavigationView)
findViewById(R.id.nav_view);
navigationView.setNavigationItemSelectedListener(this);
initViews();
}
@Override
public void onBackPressed() {
DrawerLayout drawer = (DrawerLayout) findViewById(R.id.drawer_layout);
93
if (drawer.isDrawerOpen(GravityCompat.START)) {
drawer.closeDrawer(GravityCompat.START);
} else {
super.onBackPressed();
}
}
void Logout(){
progressDialog.show();
auth.signOut();
finish();
if (id == R.id.user_home) {
setFragment(homeFragment);
getSupportActionBar().setTitle("Home");
UserLoginActivity
package com.example.scdapp.ui;
import android.app.ProgressDialog;
import android.content.Intent;
import android.graphics.Paint;
import android.support.annotation.NonNull;
import android.support.v7.app.AppCompatActivity;
import android.os.Bundle;
import android.util.Log;
95
import android.view.View;
import android.widget.Button;
import android.widget.CompoundButton;
import android.widget.EditText;
import android.widget.RadioButton;
import android.widget.TextView;
import android.widget.Toast;
import com.example.scdapp.R;
import com.example.scdapp.model.User;
import com.google.android.gms.tasks.OnCompleteListener;
import com.google.android.gms.tasks.OnFailureListener;
import com.google.android.gms.tasks.Task;
import com.google.firebase.auth.AuthResult;
import com.google.firebase.auth.FirebaseAuth;
import com.google.firebase.auth.FirebaseUser;
import com.google.firebase.firestore.CollectionReference;
import com.google.firebase.firestore.FirebaseFirestore;
TextView signUp,forgetPass;
FirebaseAuth auth;
User user;
EditText editemail,editpassword;
FirebaseFirestore firestore;
CollectionReference userCollection;
ProgressDialog progressDialog;
Button btn;
void initViews(){
btn=findViewById(R.id.button3);
btn.setOnClickListener(this);
editemail=findViewById(R.id.editTextEmail11);
editpassword=findViewById(R.id.editTextPass11);
signUp=findViewById(R.id.signUp);
signUp.setPaintFlags(signUp.getPaintFlags()|
Paint.UNDERLINE_TEXT_FLAG);
forgetPass=findViewById(R.id.forgetPass);
forgetPass.setPaintFlags(forgetPass.getPaintFlags()|
Paint.UNDERLINE_TEXT_FLAG);
96
signUp.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
Intent intent=new
Intent(UserLoginActivity.this,UserRegistrationActivity.class);
startActivity(intent);
}
});
forgetPass.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
Intent intent=new Intent(UserLoginActivity.this,PasswordActivity.class);
startActivity(intent);
}
});
}
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_user_login);
// getSupportActionBar().setTitle("User Login");
initViews();
auth=FirebaseAuth.getInstance();
firestore=FirebaseFirestore.getInstance();
userCollection=firestore.collection("users");
user=new User();
progressDialog=new ProgressDialog(this);
progressDialog.setMessage("Please Wait...");
progressDialog.setCancelable(false);
}
void loginUser(){
progressDialog.show();
auth.signInWithEmailAndPassword(user.email,user.password).addOnCompleteLis
tener(this, new OnCompleteListener<AuthResult>() {
97
@Override
public void onComplete(@NonNull Task<AuthResult> task) {
if(task.isSuccessful()){
//Toast.makeText(UserLoginActivity.this,"Login
Successfully",Toast.LENGTH_LONG).show();
chechEmailVerification();
progressDialog.dismiss();
}
}
}).addOnFailureListener(this, new OnFailureListener() {
@Override
public void onFailure(@NonNull Exception e) {
Log.i("User","User Login Failed"+e.getMessage());
e.printStackTrace();
progressDialog.dismiss();
}
});
}
@Override
public void onClick(View v) {
user.email=editemail.getText().toString().trim();
user.password=editpassword.getText().toString().trim();
loginUser();
void chechEmailVerification(){
FirebaseUser firebaseUser=auth.getInstance().getCurrentUser();
boolean emailflag=firebaseUser.isEmailVerified();
if(emailflag){
Toast.makeText(UserLoginActivity.this,"Login
Successfully",Toast.LENGTH_LONG).show();
Intent intent=new Intent(UserLoginActivity.this,UserHomeActivity.class);
startActivity(intent);
finish();
}else {
98
Toast.makeText(this,"Verify your Email",Toast.LENGTH_LONG).show();
auth.signOut();
}
}
}
UserRegistrationActivity
package com.example.scdapp.ui;
import android.app.ProgressDialog;
import android.content.Intent;
import android.graphics.Paint;
import android.support.annotation.NonNull;
import android.support.v7.app.AppCompatActivity;
import android.os.Bundle;
import android.util.Log;
import android.view.View;
import android.widget.AdapterView;
import android.widget.ArrayAdapter;
import android.widget.Button;
import android.widget.CompoundButton;
import android.widget.EditText;
import android.widget.RadioButton;
import android.widget.Spinner;
import android.widget.TextView;
import android.widget.Toast;
import com.example.scdapp.R;
import com.example.scdapp.model.User;
import com.google.android.gms.tasks.OnCompleteListener;
import com.google.android.gms.tasks.OnFailureListener;
import com.google.android.gms.tasks.OnSuccessListener;
import com.google.android.gms.tasks.Task;
import com.google.firebase.FirebaseException;
import com.google.firebase.auth.AuthResult;
import com.google.firebase.auth.FirebaseAuth;
import com.google.firebase.auth.FirebaseUser;
import com.google.firebase.auth.PhoneAuthCredential;
import com.google.firebase.auth.PhoneAuthProvider;
import com.google.firebase.firestore.CollectionReference;
99
import com.google.firebase.firestore.FirebaseFirestore;
import java.util.concurrent.TimeUnit;
EditText editname,editemail,editpassword,editrollno,editphone;
TextView login;
Button btn;
FirebaseAuth auth;
User user;
FirebaseFirestore firestore;
CollectionReference userCollection;
ProgressDialog progressDialog;
String uid;
RadioButton rMale,rFemale;
Spinner spClass,spCity;
ArrayAdapter<String> adapter,adapterCity;
void initViews(){
editname=findViewById(R.id.editTextName12);
editemail=findViewById(R.id.editTextEmail12);
editpassword=findViewById(R.id.editTextPassword12);
editrollno=findViewById(R.id.editTextRollNo12);
editphone=findViewById(R.id.editTextPhoneNo12);
btn=findViewById(R.id.button4);
login=findViewById(R.id.loggedIn);
login.setPaintFlags(login.getPaintFlags()|
Paint.UNDERLINE_TEXT_FLAG);
rMale=findViewById(R.id.radioMale);
rFemale=findViewById(R.id.radioFemale);
rMale.setOnCheckedChangeListener(this);
rFemale.setOnCheckedChangeListener(this);
spClass=findViewById(R.id.spinClass);
spCity=findViewById(R.id.selectCity);
adapter=new
100
ArrayAdapter<String>(this,android.R.layout.simple_spinner_dropdown_item);
adapter.add("--Select Class--");
adapter.add("BCA");
adapter.add("BCom");
adapter.add("Ba");
adapter.add("BTech");
adapter.add("MA");
adapter.add("BBA");
adapter.add("PGDCA");
adapter.add("Msc.IT");
spClass.setAdapter(adapter);
adapterCity=new
ArrayAdapter<String>(this,android.R.layout.simple_spinner_dropdown_item);
adapterCity.add("--Select City--");
adapterCity.add("Ludhiana");
adapterCity.add("Phillur");
adapterCity.add("Jalandhar");
adapterCity.add("Chandigarh");
spCity.setAdapter(adapterCity);
spClass.setOnItemSelectedListener(new
AdapterView.OnItemSelectedListener() {
@Override
public void onItemSelected(AdapterView<?> parent, View view, int
position, long id) {
user.class1=adapter.getItem(position);
}
@Override
public void onNothingSelected(AdapterView<?> parent) {
}
});
spCity.setOnItemSelectedListener(new
AdapterView.OnItemSelectedListener() {
@Override
public void onItemSelected(AdapterView<?> parent, View view, int
101
position, long id) {
user.city=adapterCity.getItem(position);
}
@Override
public void onNothingSelected(AdapterView<?> parent) {
}
});
btn.setOnClickListener(this);
login.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
Intent intent=new
Intent(UserRegistrationActivity.this,UserLoginActivity.class);
startActivity(intent);
}
});
}
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_user_registration);
initViews();
auth=FirebaseAuth.getInstance();
firestore=FirebaseFirestore.getInstance();
userCollection=firestore.collection("users");
user=new User();
progressDialog=new ProgressDialog(this);
progressDialog.setMessage("Please Wait... ");
progressDialog.setCancelable(false);
}
@Override
public void onCheckedChanged(CompoundButton buttonView, boolean
isChecked) {
int id=buttonView.getId();
if(isChecked){
if(id==R.id.radioMale){
102
user.gender="Male";
}else {
user.gender="Female";
}
}
}
void saveUser(){
userCollection.document(uid).set(user).addOnSuccessListener(this, new
OnSuccessListener<Void>() {
@Override
public void onSuccess(Void aVoid) {
Toast.makeText(UserRegistrationActivity.this,"User Saved in
DB",Toast.LENGTH_LONG).show();
Intent intent=new
Intent(UserRegistrationActivity.this,UserHomeActivity.class);
startActivity(intent);
finish();
progressDialog.dismiss();
}
}).addOnFailureListener(this, new OnFailureListener() {
@Override
public void onFailure(@NonNull Exception e) {
Toast.makeText(UserRegistrationActivity.this,"Error While Saving
User",Toast.LENGTH_LONG).show();
progressDialog.dismiss();
}
});
}
void registerUser(){
progressDialog.show();
auth.createUserWithEmailAndPassword(user.email,user.password).addOnComplet
eListener(this, new OnCompleteListener<AuthResult>() {
@Override
public void onComplete(@NonNull Task<AuthResult> task) {
if(task.isSuccessful()){
uid=task.getResult().getUser().getUid();
sendEmailverification();
103
// Toast.makeText(UserRegistrationActivity.this,user.name+"Registere
Successfully",Toast.LENGTH_LONG).show();
Log.i("User","User Registered: "+uid);
}
}
}).addOnFailureListener(this, new OnFailureListener() {
@Override
public void onFailure(@NonNull Exception e) {
Log.i("User","User Registration Failed: "+e.getMessage());
e.printStackTrace();
progressDialog.dismiss();
}
});
}
boolean validateFields(){
boolean flag=true;
if(user.name.isEmpty()){
flag=false;
}
if(user.email.isEmpty()){
flag=false;
}
if(user.password.isEmpty()){
flag=false;
}else {
if(user.password.length()!=6){
flag=false;
}
}
if(user.rollno.isEmpty()){
flag=false;
}
if(user.phoneno.isEmpty()){
flag=false;
}else {
if(user.phoneno.length()!=10){
flag=false;
}
104
}
if(user.gender.isEmpty()){
flag=false;
}
if(user.class1.isEmpty()){
flag=false;
}
if(user.city.isEmpty()){
flag=false;
}
return flag;
}
@Override
public void onClick(View v) {
user.name=editname.getText().toString().trim();
user.email=editemail.getText().toString().trim();
user.password=editpassword.getText().toString().trim();
user.phoneno=editphone.getText().toString().trim();
user.rollno=editrollno.getText().toString().trim();
if(validateFields()){
registerUser();
}
else {
Toast.makeText(this,"Please Enter Correct
Details..",Toast.LENGTH_LONG).show();
}
}
void sendEmailverification(){
FirebaseUser firebaseUser=auth.getCurrentUser();
if(firebaseUser!=null){
firebaseUser.sendEmailVerification().addOnCompleteListener(new
OnCompleteListener<Void>() {
@Override
public void onComplete(@NonNull Task<Void> task) {
if(task.isSuccessful()){
saveUser();
Toast.makeText(UserRegistrationActivity.this,"successfully
105
registered,verfication mail sent",Toast.LENGTH_LONG).show();
auth.signOut();
Intent intent=new
Intent(UserRegistrationActivity.this,UserLoginActivity.class);
startActivity(intent);
finish();
}else {
Toast.makeText(UserRegistrationActivity.this,"verification email
has not been sent",Toast.LENGTH_LONG).show();
}
}
});
}
}
}
UserSelectActivity
package com.example.scdapp.ui;
import android.content.Intent;
import android.graphics.Paint;
import android.support.v7.app.AppCompatActivity;
import android.os.Bundle;
import android.view.View;
import android.widget.Button;
import android.widget.ImageView;
import android.widget.TextView;
import com.example.scdapp.R;
106
Paint.UNDERLINE_TEXT_FLAG);
imageView1=findViewById(R.id.imageLogin);
imageView2=findViewById(R.id.imageRegistration);
textView1.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
Intent intent=new Intent(UserSelectActivity.this,UserLoginActivity.class);
startActivity(intent);
}
});
textView2.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View view) {
Intent intent=new
Intent(UserSelectActivity.this,UserRegistrationActivity.class);
startActivity(intent);
}
});
}
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_user_select);
initviews();
}
}
ViewAllUserActivity
package com.example.scdapp.ui;
import android.os.Bundle;
import android.support.v7.app.AppCompatActivity;
import android.support.v7.widget.DividerItemDecoration;
import android.support.v7.widget.LinearLayoutManager;
import android.support.v7.widget.RecyclerView;
import com.example.scdapp.R;
import com.example.scdapp.adapter.UserAdapter;
import com.example.scdapp.listener.RecyclerAdapterClickListener;
import com.example.scdapp.model.User;
import com.firebase.ui.firestore.FirestoreRecyclerOptions;
107
import com.google.firebase.auth.FirebaseAuth;
import com.google.firebase.firestore.FirebaseFirestore;
import com.google.firebase.firestore.Query;
import java.util.ArrayList;
FirebaseFirestore firestore;
FirebaseAuth auth;
String uid;
RecyclerView recyclerView;
LinearLayoutManager linearLayoutManager;
UserAdapter userAdapter;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_view_all_users);
firestore = FirebaseFirestore.getInstance();
auth = FirebaseAuth.getInstance();
uid = auth.getCurrentUser().getUid();
recyclerView = findViewById(R.id.recyclerView);
recyclerView.setLayoutManager(linearLayoutManager)
final ArrayList<User> userList = new ArrayList<>();
userAdapter.startListening();
recyclerView.setAdapter(userAdapter);
DividerItemDecoration dividerItemDecoration = new
DividerItemDecoration(recyclerView.getContext(),linearLayoutManager.getOrient
ation());
recyclerView.addItemDecoration(dividerItemDecoration);
}
@Override
public void onRecyclerAdapterClicked(int position) {
}
}
Xml Coding
Activity_add_notice.xml
<android.support.v7.widget.Toolbar
android:layout_width="match_parent"
android:layout_height="57dp"
android:background="@drawable/back">
<TextView
android:layout_width="wrap_content"
109
android:layout_height="wrap_content"
android:gravity="center"
android:paddingLeft="10dp"
android:text="ADD NOTICE ACTIVITY"
android:textColor="@color/white"
android:textSize="30dp"
android:textStyle="bold" />
</android.support.v7.widget.Toolbar>
<Button
android:id="@+id/button9"
android:layout_width="match_parent"
android:layout_height="63dp"
android:layout_marginTop="10dp"
android:text="Add Image" />
<LinearLayout
android:layout_width="184dp"
android:layout_height="149dp"
android:layout_gravity="center"
android:layout_marginTop="10dp"
android:background="@color/colorLavanderDark"
android:orientation="vertical">
<ImageView
android:id="@+id/imagedailynotice"
android:layout_width="268dp"
android:layout_height="match_parent"
android:layout_gravity="center"
app:srcCompat="@drawable/logo" />
</LinearLayout>
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textSize="30dp"
android:textStyle="bold"
android:layout_marginTop="10dp"
android:textColor="@color/white"
110
android:layout_gravity="center"
android:text="DAILY NOTICE" />
<LinearLayout
android:layout_width="184dp"
android:layout_height="149dp"
android:layout_gravity="center"
android:layout_marginTop="10dp"
android:background="@color/colorPinkRoseDark"
android:orientation="vertical">
<ImageView
android:id="@+id/imageView5"
android:layout_width="268dp"
android:layout_height="match_parent"
android:layout_gravity="center"
app:srcCompat="@drawable/logo" />
</LinearLayout>
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textSize="30dp"
android:layout_marginTop="10dp"
android:textStyle="bold"
android:textColor="@color/white"
android:layout_gravity="center"
android:text="PRINCIPAL NOTICE" />
</LinearLayout>
Activity_Admin_Login.xml
111
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="@drawable/back">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical"
android:padding="16dp"
tools:context="com.example.scdapp.ui.AdminLoginActivity">
<android.support.v7.widget.Toolbar
android:layout_width="match_parent"
android:layout_height="59dp"
android:background="@drawable/back">
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginLeft="90dp"
android:gravity="center"
android:text="ADMIN LOGIN "
android:textColor="@color/white"
android:textSize="30dp"
android:textStyle="bold" />
</android.support.v7.widget.Toolbar>
<ImageView
android:id="@+id/imageView2"
android:layout_width="wrap_content"
android:layout_height="131dp"
android:layout_gravity="center"
android:layout_marginTop="5dp"
app:srcCompat="@drawable/logo" />
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:layout_marginTop="15dp"
112
android:text="@string/admin"
android:textColor="@color/white"
android:textSize="40dp"
android:textStyle="bold" />
<EditText
android:id="@+id/editTextEmailAdmin"
android:layout_width="match_parent"
android:layout_height="45dp"
android:layout_marginTop="15dp"
android:background="@drawable/round_edittext"
android:ems="10"
android:hint="@string/admin_email"
android:inputType="textPersonName"
android:paddingLeft="10dp" />
<EditText
android:id="@+id/editTextPassAdmin"
android:layout_width="match_parent"
android:layout_height="45dp"
android:layout_marginTop="15dp"
android:background="@drawable/round_edittext"
android:ems="10"
android:hint="@string/admin_password"
android:inputType="textPassword"
android:paddingLeft="10dp" />
<Button
android:id="@+id/buttonLogin"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:layout_marginTop="20dp"
android:background="@drawable/rounded_button"
android:text="@string/admin_login"
android:textColor="@color/white"
android:textSize="20dp"
android:textStyle="bold" />
<TextView
113
android:id="@+id/forgetPassword"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:layout_marginTop="25dp"
android:text="@string/admin_forget_password"
android:textSize="20dp" />
</LinearLayout>
</ScrollView>
Activity_daily_notice.xml
<android.support.v7.widget.Toolbar
android:layout_width="match_parent"
android:layout_height="57dp"
android:background="@drawable/back">
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:gravity="center"
android:paddingLeft="70dp"
android:text="DAILY NOTICE"
android:textColor="@color/white"
android:textSize="30dp"
android:textStyle="bold" />
</android.support.v7.widget.Toolbar>
<android.support.v7.widget.RecyclerView
android:layout_width="match_parent"
android:layout_height="match_parent"
114
android:id="@+id/recyclerView1"
android:padding="5dp"
android:orientation="vertical"
android:background="@drawable/back"
tools:context="com.example.scdapp.ui.DailyNoticeActivity">
</android.support.v7.widget.RecyclerView>
</LinearLayout>
Activity_grid.xml
<android.support.v7.widget.Toolbar
android:layout_width="match_parent"
android:layout_height="70dp"
android:background="@drawable/back">
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginLeft="95dp"
android:gravity="center"
android:text="ADMIN LEVEL "
android:textColor="@color/white"
android:textSize="30dp"
android:textStyle="bold" />
</android.support.v7.widget.Toolbar>
<ListView
android:layout_width="match_parent"
android:layout_height="match_parent"
android:padding="16dp"
android:id="@+id/listView"
android:background="@drawable/back"
115
tools:context="com.example.scdapp.ui.gridActivity">
</ListView>
</LinearLayout>
Activity_main.xml
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:paddingBottom="@dimen/activity_vertical_margin"
android:paddingLeft="@dimen/activity_horizontal_margin"
android:paddingRight="@dimen/activity_horizontal_margin"
android:paddingTop="@dimen/activity_vertical_margin"
android:orientation="vertical">
<ImageView
android:id="@+id/firebase_logo"
android:layout_width="196dp"
android:layout_height="143dp"
android:layout_gravity="center_horizontal"
android:layout_marginBottom="@dimen/margin_2"
android:src="@drawable/logo" />
<LinearLayout
android:id="@+id/layout_signin"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:orientation="vertical"
tools:visibility="gone">
<TextView
116
android:id="@+id/status_sign_in"
style="@style/TextAppearance.AppCompat.Medium"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginBottom="@dimen/margin_1"
android:text="@string/sign_in_prompt" />
<Button
android:id="@+id/button_sign_in"
android:layout_width="@dimen/standard_field_width"
android:layout_height="wrap_content"
android:text="@string/sign_in_anonymously" />
</LinearLayout>
<LinearLayout
android:id="@+id/layout_storage"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:orientation="vertical"
android:visibility="gone"
tools:visibility="visible">
<TextView
style="@style/TextAppearance.AppCompat.Medium"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginBottom="@dimen/margin_1"
android:text="@string/take_photo_prompt" />
<Button
android:id="@+id/button_camera"
android:layout_width="@dimen/standard_field_width"
android:layout_height="wrap_content"
android:text="@string/camera_button_text" />
</LinearLayout>
<LinearLayout
android:id="@+id/layout_download"
117
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:orientation="vertical"
android:visibility="gone"
tools:visibility="visible">
<TextView
style="@style/TextAppearance.AppCompat.Medium"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginBottom="@dimen/margin_1"
android:layout_marginTop="@dimen/margin_2"
android:text="@string/label_link" />
<TextView
android:id="@+id/picture_download_uri"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:autoLink="web"
<TextView
style="@style/TextAppearance.AppCompat.Medium"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginBottom="@dimen/margin_1"
android:layout_marginTop="@dimen/margin_2"
android:text="@string/label_download" />
<Button
android:id="@+id/button_download"
android:layout_width="@dimen/standard_field_width"
android:layout_height="wrap_content"
android:text="@string/download" />
</LinearLayout>
</LinearLayout>
</ScrollView>
118
Activity_password.xml
<android.support.v7.widget.Toolbar
android:layout_width="match_parent"
android:layout_height="59dp"
android:background="@drawable/back">
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginLeft="65dp"
android:gravity="center"
android:text="FORGET PASSWORD "
android:textColor="@color/white"
android:textSize="25dp"
android:textStyle="bold" />
</android.support.v7.widget.Toolbar>
<EditText
android:id="@+id/passwordEmail"
android:layout_width="263dp"
android:layout_height="35dp"
android:layout_marginBottom="8dp"
android:layout_marginEnd="8dp"
android:layout_marginStart="8dp"
android:layout_marginTop="8dp"
android:background="@drawable/round_edittext"
android:ems="10"
android:paddingLeft="10dp"
android:inputType="textEmailAddress"
119
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintHorizontal_bias="0.504"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent"
app:layout_constraintVertical_bias="0.414" />
<Button
android:id="@+id/resetPassword"
android:layout_width="185dp"
android:layout_height="51dp"
android:layout_marginBottom="8dp"
android:layout_marginEnd="8dp"
android:layout_marginStart="8dp"
android:background="@drawable/rounded_button"
android:text="RESET PASSWORD"
android:textColor="@color/white"
android:textSize="20dp"
android:textStyle="bold"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintHorizontal_bias="0.502"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@+id/passwordEmail"
app:layout_constraintVertical_bias="0.354" />
</android.support.constraint.ConstraintLayout>
Activity_principal_notice.xml
120
android:background="@drawable/back">
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:gravity="center"
android:paddingLeft="43dp"
android:text="PRINCIPAL NOTICE"
android:textColor="@color/white"
android:textSize="30dp"
android:textStyle="bold" />
</android.support.v7.widget.Toolbar>
<android.support.v7.widget.RecyclerView
android:layout_width="match_parent"
android:layout_height="match_parent"
android:padding="5dp"
android:id="@+id/recyclerView2"
android:background="@drawable/back">
</android.support.v7.widget.RecyclerView>
</LinearLayout>
Activity_select.xml
<android.support.v7.widget.Toolbar
android:layout_width="match_parent"
android:layout_height="59dp"
android:background="@drawable/back">
121
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginLeft="90dp"
android:gravity="center"
android:text="SELECT USER"
android:textColor="@color/white"
android:textSize="30dp"
android:textStyle="bold" />
</android.support.v7.widget.Toolbar>
<ImageView
android:id="@+id/imageView6"
android:layout_width="251dp"
android:layout_height="136dp"
android:layout_marginTop="40dp"
android:layout_gravity="center"
app:srcCompat="@drawable/admin" />
<TextView
android:id="@+id/text5"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="10dp"
android:layout_gravity="center"
android:textSize="30dp"
android:textStyle="bold"
android:textColor="@color/white"
android:text="@string/admin_level" />
<ImageView
android:id="@+id/imageView7"
android:layout_width="251dp"
android:layout_height="136dp"
android:layout_gravity="center"
android:layout_marginTop="40dp"
app:srcCompat="@drawable/usergroup" />
122
<TextView
android:id="@+id/text6"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textColor="@color/white"
android:layout_gravity="center"
android:textStyle="bold"
android:textSize="30dp"
android:layout_marginTop="10dp"
android:text="@string/user_level" />
</LinearLayout>
Activity_select_user.xml
Activity_splash.xml
123
Activity_text_notice.xml
<TextView
android:id="@+id/textView3"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textSize="40dp"
android:layout_gravity="center"
android:text="Add Notice" />
<EditText
android:id="@+id/editTextTitle"
android:layout_marginTop="30dp"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:ems="10"
android:inputType="textMultiLine"
android:hint="Title" />
<EditText
android:id="@+id/editTextBody"
android:layout_marginTop="10dp"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:ems="10"
android:inputType="textPersonName"
android:hint="Body" />
124
<EditText
android:id="@+id/editTextDate"
android:layout_marginTop="10dp"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:ems="10"
android:inputType="textPersonName"
android:hint="01/01/2018" />
<Button
android:id="@+id/buttonDate"
android:layout_marginTop="10dp"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="Select Date" />
<Button
android:id="@+id/buttonPost"
android:layout_marginTop="10dp"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="Post Notice" />
</LinearLayout>
Activity_text_notice1.xml
125
<TextView
android:id="@+id/textView1"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textSize="40dp"
android:layout_gravity="center"
android:text="Add Notice" />
<EditText
android:id="@+id/editTextTitle1"
android:layout_marginTop="30dp"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:ems="10"
android:inputType="textMultiLine"
android:hint="Title" />
<EditText
android:id="@+id/editTextBody1"
android:layout_marginTop="10dp"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:ems="10"
android:inputType="textPersonName"
android:hint="Body" />
<EditText
android:id="@+id/editTextDate1"
android:layout_marginTop="10dp"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:ems="10"
android:inputType="textPersonName"
android:hint="01/01/2018" />
<Button
android:id="@+id/buttonDate1"
android:layout_marginTop="10dp"
126
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="Select Date" />
<Button
android:id="@+id/buttonPost1"
android:layout_marginTop="10dp"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="Post Notice" />
</LinearLayout>
Activity_user_home.xml
<include
layout="@layout/app_bar_user_home"
android:layout_width="match_parent"
android:layout_height="match_parent" />
<android.support.design.widget.NavigationView
android:id="@+id/nav_view"
android:layout_width="wrap_content"
android:layout_height="match_parent"
android:layout_gravity="start"
android:fitsSystemWindows="true"
app:headerLayout="@layout/nav_header_user_home"
app:menu="@menu/activity_user_home_drawer" />
</android.support.v4.widget.DrawerLayout>
127
Activity_user_login.xml
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginLeft="95dp"
android:gravity="center"
android:text="USER LOGIN "
android:textColor="@color/white"
android:textSize="30dp"
android:textStyle="bold" />
</android.support.v7.widget.Toolbar>
<ImageView
android:id="@+id/imageView3"
android:layout_width="wrap_content"
android:layout_height="131dp"
android:layout_gravity="center"
android:layout_marginTop="40dp"
app:srcCompat="@drawable/logo" />
<EditText
128
android:id="@+id/editTextEmail11"
android:layout_width="match_parent"
android:layout_height="45dp"
android:layout_marginTop="20dp"
android:paddingLeft="10dp"
android:background="@drawable/rounded_edittext"
android:ems="10"
android:hint="@string/user_email"
android:inputType="textEmailAddress" />
<EditText
android:id="@+id/editTextPass11"
android:layout_marginTop="20dp"
android:layout_width="match_parent"
android:layout_height="45dp"
android:ems="10"
android:paddingLeft="10dp"
android:background="@drawable/rounded_edittext"
android:hint="@string/user_password"
android:inputType="textPassword" />
<Button
android:id="@+id/button3"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:textColor="@color/white"
android:layout_marginTop="20dp"
android:background="@drawable/rounded_button2"
android:text="@string/user_signin"
android:textSize="20dp"
android:textStyle="bold" />
<LinearLayout
android:layout_width="match_parent"
android:layout_height="94dp"
android:orientation="horizontal"
android:padding="10dp">
<TextView
129
android:id="@+id/signUp"
android:layout_width="112dp"
android:layout_marginLeft="15dp"
android:layout_height="wrap_content"
android:layout_marginTop="25dp"
android:text="@string/user_signup"
android:textStyle="bold"
android:textSize="20dp" />
<TextView
android:id="@+id/forgetPass"
android:layout_width="200dp"
android:layout_height="wrap_content"
android:layout_marginLeft="5dp"
android:paddingLeft="8dp"
android:layout_marginTop="25dp"
android:layout_weight="1"
android:textStyle="bold"
android:text="@string/user_forget_password"
android:textSize="20dp" />
</LinearLayout>
</LinearLayout>
</ScrollView>
Activity_user_registration.xml
130
<android.support.v7.widget.Toolbar
android:layout_width="match_parent"
android:layout_height="59dp"
android:background="@drawable/back">
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginLeft="23dp"
android:gravity="center"
android:text="USER REGISTRATION "
android:textColor="@color/white"
android:textSize="30dp"
android:textStyle="bold" />
</android.support.v7.widget.Toolbar>
<ImageView
android:id="@+id/imageView5"
android:layout_width="wrap_content"
android:layout_height="131dp"
android:layout_gravity="center"
android:layout_marginTop="20dp"
app:srcCompat="@drawable/logo" />
<EditText
android:id="@+id/editTextName12"
android:layout_marginTop="15dp"
android:layout_width="match_parent"
android:layout_height="40dp"
android:ems="10"
android:background="@drawable/rounded_edittext"
android:paddingLeft="10dp"
android:inputType="textPersonName"
android:hint="Enter Your Name" />
<EditText
android:id="@+id/editTextEmail12"
android:layout_marginTop="10dp"
android:layout_width="match_parent"
android:layout_height="40dp"
android:ems="10"
android:paddingLeft="10dp"
131
android:background="@drawable/rounded_edittext"
android:inputType="textPersonName"
android:hint="Enter Your Email" />
<EditText
android:id="@+id/editTextPassword12"
android:layout_marginTop="10dp"
android:layout_width="match_parent"
android:layout_height="40dp"
android:ems="10"
android:paddingLeft="10dp"
android:background="@drawable/rounded_edittext"
android:hint="Enter Your Password"
android:inputType="textPassword" />
<EditText
android:id="@+id/editTextRollNo12"
android:layout_marginTop="10dp"
android:layout_width="match_parent"
android:layout_height="40dp"
android:ems="10"
android:background="@drawable/rounded_edittext"
android:paddingLeft="10dp"
android:inputType="number"
android:hint="Enter Your RollNo" />
<EditText
android:id="@+id/editTextPhoneNo12"
android:layout_marginTop="10dp"
android:layout_width="match_parent"
android:layout_height="40dp"
android:ems="10"
android:background="@drawable/rounded_edittext"
android:paddingLeft="10dp"
android:inputType="textPersonName"
android:hint="Enter Your Phone Number" />
<RadioGroup
android:layout_width="wrap_content"
android:layout_height="40dp"
android:orientation="horizontal"
132
android:layout_marginTop="10dp">
<RadioButton
android:id="@+id/radioMale"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="@string/male"
android:textColor="@color/white"
android:textSize="20dp"
android:layout_marginTop="10dp"/>
<RadioButton
android:id="@+id/radioFemale"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="@string/female"
android:textColor="@color/white"
android:textSize="20dp"
android:layout_marginTop="10dp"/>
</RadioGroup>
<Spinner
android:id="@+id/spinClass"
android:layout_width="match_parent"
android:layout_height="40dp"
android:background="@drawable/rounded_edittext"
android:layout_marginTop="10dp" />
<Spinner
android:id="@+id/selectCity"
android:layout_marginTop="10dp"
android:background="@drawable/rounded_edittext"
android:layout_width="match_parent"
android:layout_height="40dp" />
<Button
android:id="@+id/button4"
android:layout_marginTop="10dp"
android:background="@drawable/rounded_button2"
133
android:layout_width="match_parent"
android:textSize="20dp"
android:layout_gravity="center"
android:textStyle="bold"
android:textColor="@color/white"
android:layout_height="wrap_content"
android:text="Register" />
<TextView
android:id="@+id/loggedIn"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:textStyle="bold"
android:textSize="20dp"
android:layout_marginTop="10dp"
android:text="Already Have An Account?Login" />
</LinearLayout>
</ScrollView>
Activity_user_select.xml
<android.support.v7.widget.Toolbar
android:layout_width="match_parent"
android:layout_height="59dp"
android:background="@drawable/back">
<TextView
android:layout_width="wrap_content"
134
android:layout_height="wrap_content"
android:layout_marginLeft="95dp"
android:gravity="center"
android:text="USER LOGIN "
android:textColor="@color/white"
android:textSize="30dp"
android:textStyle="bold" />
</android.support.v7.widget.Toolbar>
<ImageView
android:id="@+id/imageLogin"
android:layout_width="177dp"
android:layout_height="138dp"
android:layout_marginTop="50dp"
android:layout_gravity="center"
app:srcCompat="@drawable/login" />
<TextView
android:id="@+id/userlogin"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="10dp"
android:textStyle="bold"
android:layout_gravity="center"
android:textColor="@color/white"
android:textSize="30dp"
android:text="LOGIN" />
<ImageView
android:id="@+id/imageRegistration"
android:layout_width="177dp"
android:layout_height="138dp"
android:layout_marginTop="30dp"
android:layout_gravity="center"
app:srcCompat="@drawable/registration" />
<TextView
android:id="@+id/userregiter"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="10dp"
135
android:textStyle="bold"
android:layout_gravity="center"
android:textColor="@color/white"
android:textSize="30dp"
android:text="REGISTRATION" />
</LinearLayout>
Activity_view_all_user.xml
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:gravity="center"
android:paddingLeft="60dp"
android:text="VIEW ALL USERS"
android:textColor="@color/white"
android:textSize="30dp"
android:textStyle="bold" />
</android.support.v7.widget.Toolbar>
<android.support.v7.widget.RecyclerView
android:layout_width="match_parent"
android:layout_height="match_parent"
android:id="@+id/recyclerView"
android:padding="16dp"
android:background="@drawable/back"
tools:context="com.example.scdapp.ui.ViewAllUsersActivity">
136
</android.support.v7.widget.RecyclerView>
</LinearLayout>
Board_notice.xml
<LinearLayout
android:layout_width="184dp"
android:layout_height="149dp"
android:layout_gravity="center"
android:layout_marginTop="40dp"
android:background="@color/colorLavanderDark"
android:orientation="vertical">
<ImageView
android:id="@+id/imageView4"
android:layout_width="268dp"
android:layout_height="match_parent"
android:layout_gravity="center"
app:srcCompat="@drawable/logo" />
</LinearLayout>
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textSize="30dp"
android:layout_marginTop="10dp"
android:textStyle="bold"
android:textColor="@color/white"
android:layout_gravity="center"
137
android:text="DAILY NOTICE" />
<LinearLayout
android:layout_width="184dp"
android:layout_height="149dp"
android:layout_gravity="center"
android:layout_marginTop="30dp"
android:background="@color/colorPinkRoseDark"
android:orientation="vertical">
<ImageView
android:id="@+id/imageView15"
android:layout_width="268dp"
android:layout_height="match_parent"
android:layout_gravity="center"
app:srcCompat="@drawable/logo" />
</LinearLayout>
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textSize="30dp"
android:textStyle="bold"
android:layout_marginTop="10dp"
android:textColor="@color/white"
android:layout_gravity="center"
android:text="PRINCIPAL NOTICE" />
</LinearLayout>
Contact_us.xml
138
android:background="@drawable/back">
<TextView
android:id="@+id/textView2"
android:layout_marginTop="30dp"
android:layout_width="wrap_content"
android:layout_gravity="center"
android:textColor="@color/white"
android:textSize="22dp"
android:textStyle="bold"
android:layout_height="wrap_content"
android:text="GCG GOVT.COLLEGE,LUDHIANA" />
<ImageView
android:id="@+id/imageView8"
android:layout_width="156dp"
android:layout_height="133dp"
android:layout_gravity="center"
android:layout_marginTop="30dp"
app:srcCompat="@drawable/logo" />
<TextView
android:id="@+id/textView4"
android:layout_marginTop="50dp"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:textColor="@color/white"
android:textSize="20dp"
android:text="Civil Lines, Ludhiana" />
<TextView
android:id="@+id/textView5"
android:layout_marginTop="10dp"
android:textSize="20dp"
android:textColor="@color/white"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="Website: www.scdgovtcollege.ac.in" />
<TextView
android:id="@+id/textView6"
android:textColor="@color/white"
139
android:textSize="20dp"
android:layout_marginTop="10dp"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="Email: scdldhhelp@gmail.com" />
<TextView
android:id="@+id/textView7"
android:layout_marginTop="10dp"
android:textColor="@color/white"
android:textSize="20dp"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="Contact Us: 0161-2448899,2444988" />
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="horizontal">
<ImageView
android:id="@+id/imageView9"
android:layout_width="50dp"
android:layout_height="68dp"
android:layout_gravity="center"
android:layout_margin="30dp"
android:layout_marginTop="10dp"
app:srcCompat="@drawable/callnow" />
<TextView
android:id="@+id/call"
android:layout_width="157dp"
android:layout_height="wrap_content"
android:layout_marginTop="40dp"
android:text="call now"
android:textColor="@color/black"
android:textSize="30dp" />
</LinearLayout>
</LinearLayout>
140
Fragment_about_us.xml
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:padding="16dp"
android:background="@drawable/back"
android:orientation="vertical">
<EditText
android:id="@+id/editText"
android:layout_marginTop="5dp"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:ems="10"
android:textColor="@color/white"
android:text="This App is Based on college campus application that provide
infromation regarding college activies such as events,gernral notices, placement
activites etc.
This information should be provided to student in an effective way."
android:inputType="textMultiLine" />
<TextView
android:id="@+id/textView5"
android:layout_width="wrap_content"
android:textSize="25dp"
android:layout_gravity="center"
android:textColor="@color/black"
android:layout_height="wrap_content"
141
android:text="App Objective" />
<EditText
android:id="@+id/editText6"
android:layout_width="340dp"
android:layout_height="wrap_content"
android:ems="10"
android:inputType="textMultiLine"
android:text="The proposed system objective are to overcome all the
limitations and drwabacks of the exiting system.
The online GCG application is user friendly.
The main obhective of the application is its simplicity of design and ease of
implementation that shows and helps to collect the information about events going
on in the college."
android:textColor="@color/white" />
</LinearLayout>
Grid1.xml
List_item.xml
<TextView
android:id="@+id/textViewEmail"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:textSize="18dp"
android:textColor="@color/colorAccent"
android:text="Email" />
</LinearLayout>
List_item1.xml
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical">
<TextView
android:id="@+id/textViewName7"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="title"
android:textColor="@color/colorPrimaryDark"
android:textSize="25dp" />
<TextView
android:id="@+id/textViewEmail7"
android:layout_width="match_parent"
android:layout_height="41dp"
android:text="body"
android:textColor="@color/colorAccent"
android:textSize="18dp" />
<TextView
android:id="@+id/textdate"
android:layout_width="match_parent"
android:layout_height="31dp"
android:text="01/01/2018" />
</LinearLayout>
</LinearLayout>
144
List_item2.xml
<ImageView
android:layout_width="57dp"
android:layout_height="101dp"
android:layout_gravity="center"
app:srcCompat="@drawable/logo" />
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical">
<TextView
android:id="@+id/textViewName8"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="title"
android:textColor="@color/colorPrimaryDark"
android:textSize="25dp" />
<TextView
android:id="@+id/textViewEmail8"
android:layout_width="match_parent"
android:layout_height="41dp"
android:text="body"
android:textColor="@color/colorAccent"
android:textSize="18dp" />
145
<TextView
android:id="@+id/textdate8"
android:layout_width="match_parent"
android:layout_height="31dp"
android:text="01/01/2018" />
</LinearLayout>
</LinearLayout>
Nav_header_user_home.xml
<ImageView
android:id="@+id/imageView"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:paddingTop="@dimen/nav_header_vertical_spacing"
app:srcCompat="@mipmap/ic_launcher_round" />
<TextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:paddingTop="@dimen/nav_header_vertical_spacing"
android:text="Android Studio"
android:textAppearance="@style/TextAppearance.AppCompat.Body1" />
146
<TextView
android:id="@+id/textView"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="android.studio@android.com" />
</LinearLayout>
Activity_user_home_drawer.xml
<group android:checkableBehavior="single">
<item
android:id="@+id/user_home"
android:icon="@drawable/ic_menu_camera"
android:title="Home" />
<item
android:id="@+id/nav_gallery"
android:icon="@drawable/ic_menu_gallery"
android:title="About Us" />
<item
android:id="@+id/user_notice"
android:icon="@drawable/ic_menu_slideshow"
android:title="Notice Board" />
<item
android:id="@+id/contact_us"
android:icon="@drawable/ic_menu_manage"
android:title="Contact Us" />
</group>
</menu>
Menu_home.xml
Navigation.xml
<item
android:id="@+id/navigation_home"
android:icon="@drawable/ic_home_black_24dp"
android:title="@string/title_home" />
<item
android:id="@+id/navigation_dashboard"
android:icon="@drawable/ic_dashboard_black_24dp"
android:title="@string/title_dashboard" />
<item
android:id="@+id/navigation_notifications"
android:icon="@drawable/ic_notifications_black_24dp"
android:title="@string/title_notifications" />
</menu>
user_home.xml
148
<?xml version="1.0" encoding="utf-8"?>
<menu xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto">
<item
android:id="@+id/action_settings"
android:orderInCategory="100"
android:icon="@drawable/logout"
android:title="@string/action_signout"
app:showAsAction="always" />
</menu>
AndroidManifest.xml
<application
android:allowBackup="true"
android:icon="@mipmap/logo"
android:label="@string/app_name"
android:roundIcon="@mipmap/logo"
android:supportsRtl="true"
android:theme="@style/AppTheme">
<activity android:name=".ui.SplashActivity">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
</activity>
<activity android:name=".ui.gridActivity" />
<activity android:name=".ui.AddNoticeActivity" />
<activity android:name=".ui.MainActivity" />
<service
android:name=".storage.MyDownloadService"
android:exported="false" />
<service
android:name=".storage.MyUploadService"
android:exported="false" />
</manifest>
Color.xml
Dimens.xml
<resources>
<!-- Default screen margins, per the Android Design guidelines. -->
<dimen name="activity_horizontal_margin">16dp</dimen>
<dimen name="activity_vertical_margin">16dp</dimen>
<dimen name="fab_margin">16dp</dimen>
<dimen name="appbar_padding_top">8dp</dimen>
151
<dimen name="nav_header_vertical_spacing">8dp</dimen>
<dimen name="nav_header_height">176dp</dimen>
<dimen name="standard_field_width">160dp</dimen>
<dimen name="margin_1">8dp</dimen>
<dimen name="margin_2">16dp</dimen>
</resources>
Drawables.xml
<resources xmlns:android="http://schemas.android.com/apk/res/android">
<item name="ic_menu_camera"
type="drawable">@android:drawable/ic_menu_camera</item>
<item name="ic_menu_gallery"
type="drawable">@android:drawable/ic_menu_gallery</item>
<item name="ic_menu_slideshow"
type="drawable">@android:drawable/ic_menu_slideshow</item>
<item name="ic_menu_manage"
type="drawable">@android:drawable/ic_menu_manage</item>
<item name="ic_menu_share"
type="drawable">@android:drawable/ic_menu_share</item>
<item name="ic_menu_send"
type="drawable">@android:drawable/ic_menu_send</item>
</resources>
Strings.xml
<resources>
<string name="app_name">ScdApp</string>
<string name="admin">Admin Login</string>
<string name="admin_email">Enter Your Email</string>
<string name="admin_password">Enter Your Password</string>
<string name="admin_login">Login</string>
<string name="admin_forget_password">Forget Password?</string>
<string name="admin_level">Admin Level</string>
<string name="user_level">User Level</string>
<string name="user_login">User Login</string>
<string name="user_email">Enter Your Email</string>
<string name="user_password">Enter Your Password</string>
<string name="user_signin">Sign In</string>
<string name="user_signup">Sign Up?</string>
152
<string name="user_forget_password">Forget Password?</string>
<string name="male">Male</string>
<string name="female">Female</string>
<string name="title_activity_user_home">UserHomeActivity</string>
<string name="action_signout">Sign Out</string>
<string name="section_format">Hello World from section: %1$d</string>
<string name="navigation_drawer_open">Open navigation drawer</string>
<string name="navigation_drawer_close">Close navigation drawer</string>
<string name="hello_blank_fragment">Hello blank fragment</string>
<string name="title_activity_user_home1">UserHome1Activity</string>
<string name="camera_button_text">Upload</string>
<string name="sign_in_prompt">Sign In to begin</string>
<string name="take_photo_prompt">Upload a Photo</string>
<string name="download">Download</string>
<string name="sign_in_anonymously">Sign In</string>
<string name="label_link">Link to Uploaded File</string>
<string name="label_download">Download File</string>
<string name="log_out">Log out</string>
<string name="success">Success</string>
<string name="progress_downloading">Downloading…</string>
<string name="progress_uploading">Uploading…</string>
<string name="progress_auth">Signing In…</string>
<string name="upload_success">Upload finished</string>
<string name="upload_failure">Upload failed</string>
<string name="download_success">Download finished</string>
<string name="download_failure">Download failure</string>
<string name="login">Log In</string>
<string name="action_settings">Settings</string>
<string name="title_activity_bottom">BottomActivity</string>
<string name="title_home">Home</string>
<string name="title_dashboard">Dashboard</string>
<string name="title_notifications">Notifications</string>
</resources>
Styles.xml
<resources>
<style name="AppTheme.NoActionBar">
<item name="windowActionBar">false</item>
<item name="windowNoTitle">true</item>
</style>
<style name="AppTheme.AppBarOverlay"
parent="ThemeOverlay.AppCompat.Dark.ActionBar" />
<style name="AppTheme.PopupOverlay"
parent="ThemeOverlay.AppCompat.Light" />
</resources>
Build.Gradle
android {
compileSdkVersion 26
defaultConfig {
applicationId "com.example.scdapp"
minSdkVersion 19
targetSdkVersion 26
versionCode 1
versionName "1.0"
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
multiDexEnabled true
vectorDrawables.useSupportLibrary = true
}
buildTypes {
release {
minifyEnabled false
154
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-
rules.pro'
}
}
}
dependencies {
implementation fileTree(dir: 'libs', include: ['*.jar'])
implementation 'com.android.support:appcompat-v7:26.1.0'
implementation 'com.android.support.constraint:constraint-layout:1.0.2'
implementation 'com.android.support:design:26.1.0'
implementation 'com.android.support:support-vector-drawable:26.1.0'
testImplementation 'junit:junit:4.12'
androidTestImplementation 'com.android.support.test:runner:1.0.1'
androidTestImplementation 'com.android.support.test.espresso:espresso-
core:3.0.1'
implementation 'de.hdodenhof:circleimageview:2.2.0'
implementation 'com.android.support:multidex:1.0.3'
implementation 'com.jakewharton:butterknife:8.8.1'
annotationProcessor 'com.jakewharton:butterknife-compiler:8.8.1'
implementation 'com.google.firebase:firebase-auth:11.4.2'
implementation 'com.firebaseui:firebase-ui-auth:3.0.0'
implementation 'com.google.firebase:firebase-storage:11.4.2'
implementation 'com.google.firebase:firebase-firestore:11.4.2'
implementation 'com.firebaseui:firebase-ui-firestore:3.0.0'
implementation 'com.android.support:recyclerview-v7:26.1.0'
implementation 'com.android.support:cardview-v7:26.1.0'
}
apply plugin: 'com.google.gms.google-services'
155
Screenshots
156
157
158
159
160
161
162
163
164
165
166
Hardware and Software Requirements:
167
Bibliography:
www.Google.com
www.Wikipedia.com
www.Tutorialpoint.com
www.stackoverflow.com
www.github.com
168