Download as pdf or txt
Download as pdf or txt
You are on page 1of 70

`

Rising Star App


A Project Report
Submitted for the partial fulfillment for the award of the degree of
Bachelor of Technology
(Computer Science Engineering)

Department of Mathematics & Computing


Banasthali Vidyapith
Banasthali - 304022
Session: 2016-2020

Submitted by

Rashi Chandna (10606)


Richika Varshney (10613)
Sadhana Tripathi (10627)
Shivani Narang (10652)
Vaishali Chaudhary(10688)

Under the supervision of

Coordinator Internal Guide


Dr. Saurabh Mukherjee Dr. Kuldeep Yogi
(Associate Professor) (Assistant Professor)

Ms. Kirti Pandey


(Assistant Professor)
ABSTRACT

Our Objective for this project was to learn how to create an application in android, Rising Star app for mobile
devices. The design of such an application is made in slightly modified java. The Rising star app is a talent
showcase app which is built for common people to showcase their talent. Contestant can upload videos and
Viewer can like their videos.
Department of Mathematics & Computing
Banasthali Vidyapith
Banasthali - 304022
Session: 2016-2020

CERTIFICATE

This is to certify that Rashi Chandna, Richika Varshney, Sadhana Tripathi, Shivani Narang and
Vaishali Chaudhary have carried out the project work titled “Rising Star App” from Jan 2019 to April 2019
for the award of the degree of Bachelor Of Technology(B.Tech) in Android Application Development .
The thesis embodies result of original work and studies carried out by Students themselves and the contents of
the thesis do not form the basis for the award of any other degree to the candidate or to anybody else.
ACKNOWLEDGEMENT

We take this opportunity to express our gratitude towards all those people who have helped in various ways in
successful completion of our project. We express gratitude to our coordinators, Dr Saurabh Mukherjee and Ms
Kirti Pandey ,their inspiration, suggestion and invaluable guidance helped us to develop the present application.
There are no adequate words, which can express our sincere gratitude to our respected Mentor, Dr Kuldeep
Yogi. He gave us indispensible guidance, moral support and encouragement throughout the project work
without him our project wouldn’t have been possible. We hereby our sincere compliment to all our friends for
their useful suggestion and cooperation. Last but not the least we owe our debtness towards our revered parents
for their moral support and constant encouragement that has made it possible for us to complete this project.

Closing with regard,

Rashi Chandna
Richika Varshney
Sadhana Tripathi
Shivani Narang
Vaishali Chaudhary

TABLE OF CONTENTS
S.NO TOPIC PAGE NO

1 LIST OF FIGURES -

2 LIST OF TABLES -

3 INTRODUCTION 1

4 SOFTWARE REQUIREMENT 1
SPECIFICATION

5 SOFTWARE DESIGN 18
SPECIFICATION

6 CODING 29

7 TESTING 54

8 USER INTERFACES 59

9 REFERENCES 68
LIST OF FIGURES

S.NO FIGURES PAGE NO

1 USE CASE DIAGRAM 3

2 ACTIVITY DIAGRAM 20

3 SEQUENCE DIAGRAM 21

4 ER DIAGRAM 28
LIST OF TABLES

S.NO TABLE NAME PAGE NO.

1 USERS 25

2 VIDEO SUBMIT 25

3 COMMENT 26

4 LIKES 26

5 RATE US 26
PROBLEM STATEMENT :

To create an android application which will provide opportunity to each and everyone. It’s a known fact that
everyone has an inborn talent, but not everyone gets the chance to showcase it to the outer world due to various
reasons. So everyone needs modern technologies which can serve for them and help them to outshine others
and showcase their talent. The android application should be easy to use and efficient to manage all the
activities of the user. Due to unavailability of such application few people are not able to show their talent.
Sometimes, people do not get justice on big platforms according to the talent they actuallydeserves. Many
people are there who are not allowed to go on stages to show their talent due to orthodox thinking and narrow
mentality of their family. There is no application available to provide any kind of opportunity to all these
suffering but talented people. This problem can be solved by the development of the system which will provide
equal opportunity and give fair result on the basis of public voting. A concise explanation of some of the major
challenges are given below:

OBJECTIVES

 The aim is to design and develop the project “Rising Star” Application for common people. The
application is user friendly over android operating system. Nowadays people prefer to use android
application due to easy and conveyance usage.

 To change the concept of decision made by few judges to the decision made through public voting.This
application will provide a platform for common people to show their talent at the national level and will
be felicitated by various awards like “Star of the Year”, “Star of the Week” or “Star of the Month” on
the basis of public voting.
1
Software Requirement Specification

Introduction

Purpose

The Purpose of this document is to present a detailed description of the Android Application- “RISING
STAR”. It will explain the purpose and features of the system, the interfaces of the system, what the
system will do, the constraints under which it must operate and how the system will react to external
stimuli. All of the required features of the software project are expressed by the client and agreed upon by
the development team shall be expressed in this document. Additional requirement of the client shall first
be agreed upon by the development team. The formal release version of the project shall meet every
requirement listed in this document.

Scope of Project

The RISING STAR is an Android based application. This application will provide a platform for
common people to show their talent at the national level and will be felicitated by various awards like
“Star of the Year”, “Star of the Week” or “Star of the Month”. The viewers will be able to view the
videos and according to number of votes the awards will be decided. The application offers various
operations like uploading videos, viewing the videos, calling, searching and rating. This application will
help users to like, comment on the particular video. All the operations can be performed when the
internet connection is available.

Glossary

Term Definition
Android The Operating System developed by Google made to run
on mobile phones.
GUI(Graphical User The part of the application that the user sees and interacts
Interface) with.
Set of tools that makes it possible to create software for a
SDK(Software
particular piece of software or hardware, in our case the
Development Kit)
android 3.2 operating system.
IP Address The unique number given to every computer on a
network to uniquely identify it.
A Desktop or laptop running the Microsoft windows
PC(Personal Computer)
operating system
A widely used type of text data organization and storage
XML(Extensible Markup
language that use ‘<’ and ‘>’ to label and distinguish
Language)
sections of data or instruction from each other

1
Software Requirements A document that completely describes all of the functions
Specification of a proposed system and the constraints under which it
must operate. For example, this document.
Stakeholder Any person with an interest in the project who is not a
developer.
User Contestant and Viewer.

References

IEEE . IEEE Std 830-1998 IEEE Recommended Practice for Software Requirement Specifications. IEEE

Computer Society, 1998.

Overview of Document

This application is specifically designed for the android. India is full of talented people, but not everyone
gets the opportunity to show it to the masses. The android application “Rising Star” will act as a platform
for the people to showcase their talent. This application has three active actors and two cooperating
system. The Contestants can upload their videos .The Admin has the authority to grant permission to
publish only appropriate videos. The viewers can search and view the videos and according to number of
votes, the decision will be taken, so that transparent decision can be made to select the “Star of the
week”, ”Star of the month” and “Star of the year”.

2
Overall Description

SystemEnvironment

Figure 1 - System Environment

Functional Requirements Specification

This section outlines the use cases for each of the active actor of this app separately. The Contestants and
the Viewers have various use cases while the admin is main actor in this system with only one use case.

3
Viewer UseCase :

The Viewer has the following sets of use cases:

Use case: Search Videos Diagram:

Viewer

Brief Description
The Viewer accesses the Rising Star app, search for a video and can view it.

Initial Step-By-Step Description


Before this use case can be initiated, the Viewer has already registered to the Rising Star app.

1. The app displays the choices to the Viewer.


2. The app presents the abstract of the search to the viewer.
3. The Viewer selects the desired video.
4. The app provides the requested videos.

Xref: Section 3.2.1, Search Video

4
Use case: Result
Diagram:

Result

Viewer

Brief Description
The Viewer accesses the app, view videos according to his interest and through the no. of
votes star of the week, months, years will be selected.
Initial Step-By-Step Description
Before this use case can be initiated, the Viewer has already registered to the Rising Star app.

1. TheViewer view the video accordingly and can like, comment, votes on them.
2. According to the no of votes,the highest rated video will be selected.
3. The highest rated video will be rewarded by the rewards theStar of the week,month or
year accordingly.

Xref: Section 3.2.2,Result

Use case: Contact the Contestant


Diagram:

Contact the Contestant

Viewer

BriefDescription
The Viewers accesses the app, view videos and if they want, they can contact the contestant
by calling.
Initial Step-By-Step Description
Before this use case can be initiated, the Viewer has already registered to the Rising Star app
and the respective video.

1. The Viewer views the video.


2. If he liked the video, he can contact the contestant.
3. The viewer can go to the image option of calling.
4. Now he presses the calling option and contacts the contestant.

5
Xref: Section 3.2.3, Contact the contestant

Contestant UseCase :

The Contestant has the following sets of use cases:

Use case: Uploading

Videos. Diagram:

Upload Videos

Contestant

Brief Description
The Contestant uploads the video.

Initial Step-By-Step Description


Before this use case can be initiated, the Contestant has already connected to the Internet.

1. The Contestant selects the Upload button.


2. The Contestant selects the video from his media files or records the video.
3. The video will then go to admin for verification.

Xref: Section 3.2.4, Uploading videos

6
Use case: My

Dashboard Diagram:

My Dashboard

Contestant

Brief Description
This activity shows the uploaded videos and performance of the contestant with the help of
Bar Graph.
Initial Step-By-Step Description
Before this use case can be initiated, the Contestant has already connected to the internet.

1. The Contestant selects the My Dashboard option and press on it.


2. The performance of the contestant is shown with the help of bar graph in My Dashboard.
3. The uploaded videos are also visible on My Dashboard.

Xref: Section 3.2.10, My Dashboard

Admin UseCases :

Use case: Publishing Videos

Publishing Videos

Admin

Figure 2 - Admin Use Cases

7
Brief Description
The Contestants/Viewers enters the registration page and video will be published after approval
from admin.

Initial Step-By-Step Description


Before this use case can be initiated, the Admin has already accessed the main page of the app.

1. The Admin checks the video to be uploaded.


2. The Admin will then decide whether the video to be uploaded or not.

Xref: Section 3.2.5, Publishing video

User UseCases :

The User has the following sets of use cases:

Use case: Create Profile Diagram:

Create Profile

User

Figure 3 - User Use Cases

Brief Description
The User (Contestant/Viewer) enters into his profile after registration.

Initial Step-By-Step Description


Before this use case can be initiated, the User has already accessed the main page .

1. The User fills the asked details and selects the ‘Register’option.
2. The User can also register directly with Google+.
3. The User then uploads the profile picture.

Xref: Section 3.2.6, Create profile

Use case: Notification


Diagram:

Notification

User
8
Brief Description

The users will be provided with the notifications of videos such as latest videos which are
being uploaded (for the viewers) and likes and comments on these videos (for the
contestants).

Initial Step-By-Step Description


Before this use case can be initiated, the User has already login in the app.

1. The user accessing the app can check hisnotifications.


2. Hecandothisbyclickingonthenotificationbuttonandwillbeprovidedwithallthenotification.

Xref: Section 3.2.7, Notification

9
Use case: Contact Us
Diagram:

Calling

User

Brief Description

Initial Step-By-Step Description


Before this use case can be initiated, the User has already accessed the main page of the app.

1. The user will get a navigation drawer where he will find contact us option.
2. The user will get all the information about the app offices by Google map.
3. The user canal so contact with the help of calling option.

Xref: Section 3.2.8,Contact us

Use case: Rate Us


Diagram:

Brief Description
The user can rate the app.

Rating

User

Initial Step-By-Step Description


Before this use case can be initiated, the User has already logged it into the app.
1. The user will go to the navigation drawer.
2. Then he/she will click on the Rate Us option.
3. By clicking on it, a page will open asking for the rating.
4. The user will give their ratings and submit it.

Xref: Section 3.2.9, Rate us

10
User Characteristics

The Viewer and Contestant are expected to be an Internet literate and are able to use a
search engine. The main screen of the Application will have the search function and it will
link to “the videos”. The Admin is expected to be Windows literate and is able to use
button, pull-down menus, and similar tools.

Non-Functional Requirements

The “Rising Star” database will be on firebase which is a real-time database with high speed
Internet capability. The software developed here assumes the use of a tool such as Android
Studio for connection between the activity and the database. The speed of the video uploading
and viewing will depend upon the internet connection.

Hardware Requirements

 CPU Type: Inteli3


 RAM Size: 8 GB
 Hard Disk Capacity: 40GB
 Monitor Type: 15 Inch color Monitor
 Mobile: Android Phone

Software Requirements

 Operating System : Android


 Tool: Java SDK , Android Studio IDE (with SDK bundle)
 Language: Android SDK 2.3 or above
 Database : Firebase

Dependency/Limitations

 As Android is world of applications we continuously need to connect with internet


which is not possible for all the users to access easily.
 It needs high usage of battery as compared to other mobile phones.
 User should have an android smart phone to access this app.

11
3.0. Requirements Specification

External Interface Requirements

The only link to an external system is the link to the User database to verify the membership
of a User (Contestant/Viewer). The Admin believes that a viewer is much more likely to take
an effective and transparent decision and has imposed a membership requirement for a
Viewer. The User Database fields of interest to the Rising Star app are user id, password,
user’s name, photo, mobile no, dob (an optional field for User Database).
The Profile Creation use case sends the User id to the User database and the Admin user
case returns a Boolean value which tells that video is accepted or not. The Upload video
use case uploads the video after selecting the video to be uploaded from the phone media
and correspondingly the video id and video name is allotted to it and get stored into the
Video Submission Database.

Functional Requirements

The Logical Structure of the Data is contained in Section 3.3.1.

Search Video
Use Case Name Search Video
XRef Section 2.2.1, Viewer use case
Trigger The Viewer login the Rising Star app.
Precondition The App is displayed with grids for searching.
Basic Path 1. The Viewer chooses to search the video. The choices are
by the name of Contestant, by Category, or by Keyword.
2. If the search is by Contestant, the app creates and presents
an alphabetical list of all videos belonging to that contestant
in the database.
3. The Viewer selects the Contestant.
4. The system creates and presents a list of all videos by that
contestant from the database.
5. The Viewer selects a video.
6. The Viewer selects to view the video or return to the
video list or to the previous list.
Alternative In step 2, if the Viewer selects to search by category, the app
Paths creates and presents a list of all categories in the database.
In step 2, if the Viewer selects to search by keyword, the app
presents a dialog box to enter the keyword or phrase.
1. The Viewer enters a keyword or phrase.
2. The app searches the abstracts for all videos with that
keyword or phrase and creates and presents a list of all such
videos in the database. Return to step5.

12
Post condition The selected video is available to be viewed by the viewer.
Exception Paths The Viewer may abandon the search at any time.
Other The categories list is generated from the information provided
when video are published and not predefined in the app
database.

Result
Use Case Name Result
XRef Section 2.2.1, Viewer Use case
Trigger The user selects a video and clicks it to view.
Pre condition The user viewed the video.
Basic Path According to the number of votes, the rating is given to the
video and star of the week, month or year accordingly chosen.
Alternative No alternative path
Paths
Post condition The rating is given and star of the week, month or year is
chosen.
Exception Paths The viewing process may be abandoned at any time.
Other None

Contact the contestant


Use Case Name Contact the Contestant
Xref Section 2.2.1, Viewer Use case
Trigger The Viewer click on the contestant name to view his/her
profile.
Pre condition The Viewer is on the Contestant profile.
Basic Path 1. The system presents a image of calling button on the
profile of contestant.
2. The Viewer will click on the calling button.
3. The system then connect the app with the call and
calling will be performed.
Alternative No Alternative path.
Paths
Post condition The viewer is in the contact with the contestant which will
enhance contestant business.
Exception Paths The Viewer may abandon the operation at any time.
Other The contestant profile contains the information like phone no.,
email id etc.

Uploading Videos
Use Case Name Uploading Videos
Xref Section 2.2.2, Contestant use case
Trigger The Contestant click on the upload video option present in the
navigation drawer.
Pre condition The Contestant is on the page of uploading video.

13
Basic Path 1. The System will provide two options to the contestant: select
video or record video.
2. If the contestant press the select video option, the transfer
will got to the media of the mobile, viewer will select a
video.
3. If the contestant press the record video option, the
contestant will record the video.
4. Now the contestant will press the upload button.
5. The video will go to admin, he’ll verify if the video will be
published or not.
Alternative No Alternative Paths
Paths
Post condition The Video may be uploaded.
Exception Paths The Contestant may abandon the operation at any time.
Other No other option.

Publishing Video
Use Case Name Publishing Video
XRef Sec 2.2.3 Admin Use case
Trigger The Admin has logged into the app.
Pre condition The Admin is at the home page of admin interface of the app.
Basic Path 1. The Admin will view a particular video.
2. The Admin will check if the video contain any slang content.
3. If there is no slang content in the video admin will press
the grant button and video will be published on the app.
4. If there is slang content in the video admin will press the
delete button and video will be deleted from the database.
Alternative No Alternative Path.
Paths
Post condition The database have been updated if the permission is granted,
accepted attribute will change to “yes” and if press the delete
button the video will be deleted from the database. And will
not show on the admin page.
Exception Paths If the admin is not able to decide whether it should be
published at the point, he may not press any of the buttons.
Other The page must contain the videos not viewed and the
information of the contestant such as name.

Create Profile
Use Case Name Create Profile
XRef Section 2.2.4, User use case
Trigger The User will go to the Registration button.
Precondition The User is at the Registration page.
Basic Path 1. The system creates a page to fill entries need to register
on the app.
2. The User will fill the entries and press the Submit button.

14
The system will check the information and register the user
on the app.
3. Now the user can log in into the app and can add additional
information such as upload profile photo.
Alternative The User can go for the other options like Register using
Paths Google, Register using Facebook.
Post condition The database has been updated with a new user.
Exception Paths The User may abandon the operation at any time.
Other The user must add the all the valid information.

Notification
Use Case Name Notification
XRef Section 2.2.4, User use case
Trigger The User will go to the Notification button.
Precondition The User is at the Main page.
Basic Path 1. The User is at main page of the app.
2. The User will fill click the notification option.
3. Now the user can check his notifications.
Alternative No Alternative Path.
Paths
Post condition The user has viewed his notification.
Exception Paths The User may abandon the operation at any time.
Other No Other option.

Rate Us

Use Case Name Rate Us


Xref Section 2.2.4, User use case
Trigger The User will click the Rate Us option in Navigation drawer
Precondition The User is on the Navigation drawer.
Basic Path 1. The User is at main activity of the app.
2. The User will click the Rate Us option.
3. Now the users will rate the app accordingly.
4. The rating will be submitted and aggregate rating
will become the rating of the app.
Alternative No Alternative Path.
Paths
Post condition Rating is submitted.
Exception Paths The User may abandon the operation at any time.
Other No Other option.

15
Contact Us

Use Case Name Rate Us


XRef Section 2.2.4, User use case
Trigger The User will click the Contact Us option in Navigation
Drawer
Precondition The User is on the Navigation drawer.
Basic Path 1. The User is at main activity of the app.
2. The User will fill click the Contact Us option.
3. Now the users can contact by calling option.
4. User can also see the different offices address through
Google Map.
Alternative No Alternative Path.
Paths
Post condition User can contact.
Exception Paths The User may abandon the operation at any time.
Other No Other option.

MyDashboard
Use Case Name My Dashboard
XRef Section 2.2.2, Contestant use case
Trigger The Contestant clicks the My Dashboard option present in the
navigation drawer.
Precondition The Contestant is on the Navigation drawer.
Basic Path 1. The System will provide the option of MyDashboard in the
Navigation drawer.
2. Contestant will click on the option and will be directed
to the My Dashboard activity.
3. The app will show their uploaded videos and performance
with the help of bar graph.
Alternative No Alternative Paths.
Paths
Postcondition The contestant can analyze their performance with the help of
bar graph.
Exception Paths The Contestant may abandon the operation at any time.
Other No other option.

Detailed Non-Functional Requirements

The data descriptions of each data entities are


16 asfollows:
User Entity

17
Data Item Type Description Comment
Name Text Name of user -
Password Text Password of user for -
Register
UserId Text Email ID of user -
Photo Pointer Photo entity -
Mobno Integer Mobile no of user -
DOB Date Date of Birth -

Video_Submit Entity
Data Item Type Description Comment
UserId Text Email Id of user -
Video Pointer Video entity May be several
VideoId Integer Increment automatically -
DateOf Text Date at which video is -
Submission Uploaded
Views Integer No. of viewers of a video -
Category Text Area of content May be several and used
for keyword search for
Viewers
Accepted Boolean Video has been accepted Video is accepted or not.
by admin for uploaded or
Not
VName Text Description of video -
Votes Integer To count no of votes -

Comments Entity
Data Item Type Description Comment
VideoId Integer - -
UserId Text Used to count the -
Comments
Comment Text Reviews of user -

Likes Entity
Data Item Type Description Comment
VideoId Integer Video Entity -

UsedId Text User_Info entity -

RateUs Entity
Data Item Type Description Comment
UserId Text -
Rating Integer Used to count the May be several

18
Comments

Star_Of_The_Week Entity
Data Item Type Description Comment
VideoId Integer - -
UserId Text - -
VotesW Integer - -
DateW Date - -

Star_Of_The_Month Entity
Data Item Type Description Comment
VideoId Integer - -
UserId Text - -
VotesM Integer - -
DateM Date - -

Star_Of_The_Year Entity
Data Item Type Description Comment
VideoId Integer - -
UserId Text - -
VotesY Integer - -
DateY Date - -

Admin Entity
Data Item Type Description Comment
Id Text - -
Name Text - -
Password Text - -
Contact_us Integer - -

Security

The server on which the uploaded videos resides will have its own security to prevent
unauthorized upload/remove access. The viewers must be registered for accessing app. The
use of email by the Contestants/Viewers is on the server and thus is external to the app.
The android/mobile on which the Video uploader resides will have its own security. Only
the Admin have physical access to grant permission for uploading the video. There is no
special protection built into this app other than to provide the Contestants with uploading
the video.

19
Index

Contestant 3,6,11,14,15,16,17,20
Viewer 5,6,9,15,16,17,20
"Rising Star" 5,6,7,9
Showcase 6,7
Admin 10,11
Calling 13,16
Star of the week, monthor year
5,9,16 Video
9,16,19
Notification17,18
Rate 9,13,14
Contact 9,12,16
Profile 17

20
SDS
Introduction

Software Development Specification tells us how our software is going to built. It includes
various diagrams to show the entire database and relationship among all database tables. The
project “Rising Star”, talent showcase application which gives chance to people to showcase
their inner talent to the outer world, and also provides transparent and fair decision. As the
name suggests this projects provides the opportunity to those who do not get justice on big
platforms according to the talent they actually deserves.

Our project is one-step solution for providing opportunity to those who either had not got
transparent and fair result or those who are not able to showcase their talent due to various
reasons. The software allows the sculpting of the database based on the number of users
who ever register on the app and then provides an easy interface to access/modify
uploaded videos, dashboards and the likes.

Purpose

The Purpose of this document is to present a detailed description of the Android Application-
“RISING STAR”. It will explain the purpose and features of the system, the interfaces of the
system, what the system will do, the constraints under which it must operate and how the
system will react to external stimuli. All of the required feature of the software project
expressed by the client and agreed upon by the development team shall be expressed in this
document. Additional requirement of the client shall first be agreed upon by the development
team. The formal release version of the project shall meet every requirement listed in this
document.

Scope

The RISING STAR is an Android based application. This application will provide a platform
for common people to show their talent at the national level and will be felicitated by various
awards like “Star of the Year”, “Star of the Week” or “Star of the Month”. The viewers will be
able to view the videos and according to number of views the awards will be decided. The
application offers various operations like uploading videos, viewing the videos, calling,
searching and rating. This application will help users to like, comment on the particular video.
All the operations can be performed when the internet connection is available.

Overview

Section 2: Specifies detailed description of application using Sequence diagram, Activity


diagram, and Class diagram.

21
Section 3: Specifies data designing (all database tables).

Section 4: Specifies user interface design including screen images.

DETAILED DESCRIPTION OFCOMPONENTS

ActivityDiagram

Activity diagrams are graphical representation of workflows of stepwise activities and actions
with support for choice, iteration and concurrency. In the UML, activity diagrams are intended
to model both computational and application process.

22
SequenceDiagram

A sequence diagram is an interaction diagram that shows how processes operate with one
another and in what order. It is a construct of message sequence chart. A sequence diagram
shows object interaction arranged in time system.

A) Sequence Diagram forAdmin

B) Sequence Diagram forContestant

C) Sequence Diagram forViewers

A)

23
B)

----

24
C)

Class Diagram

A class diagram in UML is a type of static structure diagram that describes the structure of a
system by showing the system’s classes, their attributes, operations (or methods), and the
relationships among objects.

Classes are:
1. Admin
2. User
3. VideoSubmit
4. Likes
5. Comments
6. Star_of_the_week
7. Star_of_the_month
8. Star_of_the_year
9. Rate_Us

25
26
2.2- Component Interface Description

Admin
I/P- Login and password
O/P- Logged in, admin can handle all the database updating .He has the authority to grant the
permission for the videos to be uploaded by the contestants, announce star of the week, star of
the month and star of the year, can view the results, and view the feedback of the viewers
regarding videos.

Registration
I/P- Email id, Name, Password, Dob, Mobile No, Photo.
O/P- Registered, User can register and all the data will go to firebase database.

Event
I/P-Click on particular event for which you want to get
information. O/P- Information displayed.

Results
I/P- The votes are counted
O/P:-The result is displayed and the “Star of the week”, “Star of the month” and “Star of
the year” is chosen.

3. Data Design

User Entity
Data Item Type Description Comment
Name Text Name of user -
Password Text Password of user for -
Register
UserId Text Email ID of user -
Photo Pointer Photo entity -
Mobno Integer Mobile no of user -
DOB Date Date of Birth -

Video_Submit Entity
Data Item Type Description Comment
UserId Text Email Id of user -
Video Pointer Video entity May be several

27
VideoId Integer Increment automatically -
DateOf Text Date at which video is -
Submission Uploaded
Views Integer No. of viewers of a video -
Category Text Area of content May be several and used
for keyword search for
viewers
Accepted Boolean Video has been accepted Video is accepted or not.
by admin for uploaded or
Not
VName Text Description of video -
Votes Integer To count no of votes -

Comments Entity
Data Item Type Description Comment
VideoId Integer - -
UserId Text Used to count the -
Comments
Comment Text Reviews of user -

Likes Entity
Data Item Type Description Comment
VideoId Integer Video Entity -

UsedId Text User_Info entity -

RateUs Entity
Data Item Type Description Comment
UserId Text -
Rating Integer Used to count the May be several
Comments

Star_Of_The_Week Entity

Data Item Type Description Comment


VideoId Integer - -
UserId Text - -
VotesY Integer - -
DateY Date - -

28
Star_Of_The_Year Entity

Data Item Type Description Comment


VideoId Integer - -
UserId Text - -
VotesM Integer - -
DateM Date - -

Star_Of_The_Month Entity

Data Item Type Description Comment


VideoId Integer - -
UserId Text - -
VotesY Integer - -
DateY Date - -

Admin Entity

Data Item Type Description Comment


Id Text - -
Name Text - -
Password Text - -
*Contact_u Integer - -
s

29
ER Diagram:

30
Coding
Splash Screen
package com.shubhi.firebaseauth;

import android.content.Intent;
import android.os.Handler;
import android.support.v7.app.AppCompatActivity;
import android.os.Bundle;

public class splash_scrren extends AppCompatActivity {


private static int SPLASH_TIME_OUT=5000;

@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_splash_scrren);
new Handler().postDelayed(new Runnable() {
@Override
public void run() {
Intent i=new Intent(splash_scrren.this,home_activity.class);
startActivity(i);
finish();

}
},SPLASH_TIME_OUT);
}
}

Registration Activity
package com.shubhi.firebaseauth;

import android.app.ProgressDialog;
import android.content.Intent;
import android.media.MediaCodec;
import android.support.annotation.NonNull;
import android.support.v4.text.TextUtilsCompat;
import android.support.v7.app.AppCompatActivity;
import android.os.Bundle;
import android.text.TextUtils;
import android.util.Patterns;
import android.view.View;
import android.widget.Button;
import android.widget.EditText;
import android.widget.ProgressBar;
import android.widget.TextView;
import android.widget.Toast;

import com.google.android.gms.tasks.OnCompleteListener;
import com.google.android.gms.tasks.Task;
import com.google.firebase.auth.AuthResult;
import com.google.firebase.auth.FirebaseAuth;
import com.google.firebase.auth.FirebaseUser; 31
import com.google.firebase.database.DatabaseReference;
import com.google.firebase.database.FirebaseDatabase;
import java.util.Date;
import java.util.regex.Pattern;

public class MainActivity extends AppCompatActivity {


private static final Pattern PASSWORD_PATTERN= Pattern.compile("^"+
"(?=.*[0-9])"+
"(?=.*[a-z])"+
"(?=.*[A-Z])"+
"(?=.*[a-zA-Z])"+
"(?=.*[@#$%^&+=])"+
"(?=\\S+$)"+
".{6,20}"+
"$");
private Button buttonRegister;
private EditText editTextEmail;
private EditText editTextPassword;
private EditText editUserName;
private EditText editTextMobNo;
private EditText editdob;
private TextView textViewSignin;
private TextView tv1;
private ProgressBar progressBar;
public FirebaseAuth firebaseAuth;
User user;

//FirebaseDatabase database;
private DatabaseReference myRef;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
firebaseAuth=FirebaseAuth.getInstance();
progressBar=(ProgressBar)findViewById(R.id.progressBar);
buttonRegister=(Button) findViewById(R.id.buttonRegister);
editTextEmail=(EditText)findViewById(R.id.editTextEmail);
editTextPassword=(EditText)findViewById(R.id.editTextPassword);
editTextMobNo=(EditText)findViewById(R.id.editTextMobNo);
editUserName=(EditText)findViewById(R.id.editUserName);
editdob=(EditText)findViewById(R.id.editdob);
tv1=(TextView)findViewById(R.id.tv1);
textViewSignin=(TextView)findViewById(R.id.textViewSignin);
myRef = FirebaseDatabase.getInstance().getReference("User");
progressBar.setVisibility(View.INVISIBLE);
buttonRegister.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
final String email=editTextEmail.getText().toString().trim();
String password=editTextPassword.getText().toString().trim();
String dob=editdob.getText().toString();
String phno=editTextMobNo.getText().toString();
String name=editUserName.getText().toString();
user=new User(); 32
user.setDob(dob);
user.setEmail(email);
user.setName(name);
user.setPassword(password);
user.setPhno(phno);
user.setImage(null);

if(TextUtils.isEmpty(email))
{
Toast.makeText(MainActivity.this, "please enter email", Toast.LENGTH_SHORT).show();
return;
}
if(!Patterns.EMAIL_ADDRESS.matcher(email).matches())
{
editTextEmail.setError("Please enter a valid Email Address");
}
if(!PASSWORD_PATTERN.matcher(password).matches())
{
editTextPassword.setError("Password too weak");
}

if(TextUtils.isEmpty(password))
{
Toast.makeText(MainActivity.this, "please enter password", Toast.LENGTH_SHORT).show();
return;
}
progressBar.setVisibility(View.VISIBLE);
firebaseAuth.createUserWithEmailAndPassword(email,password).addOnCompleteListener(new
OnCompleteListener<AuthResult>() {
@Override

public void onComplete(@NonNull Task<AuthResult> task) {


if(task.isSuccessful())
{
progressBar.setVisibility(View.INVISIBLE);

//FirebaseUser users = firebaseAuth.getInstance().getCurrentUser();


String key=myRef.push().getKey();
user.setKey(email);
// myRef.setValue(email);
myRef.child(key).setValue(user);
Toast.makeText(MainActivity.this,"Registered
Successfully",Toast.LENGTH_SHORT).show();
startActivity(new Intent(MainActivity.this,LoginActivity.class));

}
else
{
progressBar.setVisibility(View.INVISIBLE);
Toast.makeText(MainActivity.this,"Registration Error",Toast.LENGTH_SHORT).show();
}
}
} 33
);

}
});
textViewSignin.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
Toast.makeText(MainActivity.this,"aashish",Toast.LENGTH_SHORT).show();
Intent i=new Intent(MainActivity.this,LoginActivity.class);
startActivity(i);

}
});

}
Login Activity

package com.shubhi.firebaseauth;

import android.app.ProgressDialog;
import android.content.Intent;
import android.support.annotation.NonNull;
import android.support.v4.text.TextUtilsCompat;
import android.support.v7.app.AppCompatActivity;
import android.os.Bundle;
import android.text.TextUtils;
import android.view.View;
import android.widget.Button;
import android.widget.EditText;
import android.widget.ProgressBar;
import android.widget.TextView;
import android.widget.Toast;

import com.google.android.gms.tasks.OnCompleteListener;
import com.google.android.gms.tasks.Task;
import com.google.firebase.auth.AuthResult;
import com.google.firebase.auth.FirebaseAuth;

public class LoginActivity extends AppCompatActivity {


private Button buttonSignIn;
private EditText editTextEmail;
private EditText editTextPassword;
private TextView textViewSignup,tv2;
private ProgressBar progressBar2;
private FirebaseAuth firebaseAuth;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_login);
firebaseAuth=FirebaseAuth.getInstance(); 34
/*if(firebaseAuth.getCurrentUser()!=null)
{
finish();
startActivity(new Intent(getApplicationContext(),ProfileActivity.class));

}*/
progressBar2=(ProgressBar)findViewById(R.id.progressBar2);
progressBar2.setVisibility(View.INVISIBLE);
buttonSignIn=(Button) findViewById(R.id.buttonSignin);
editTextEmail=(EditText)findViewById(R.id.editTextEmail);
editTextPassword=(EditText)findViewById(R.id.editTextPassword);
textViewSignup=(TextView)findViewById(R.id.textViewSignup);
tv2=(TextView)findViewById(R.id.tv2);
buttonSignIn.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {

String email=editTextEmail.getText().toString().trim();
String password=editTextPassword.getText().toString().trim();
if(TextUtils.isEmpty(email))
{
Toast.makeText(LoginActivity.this, "please enter email", Toast.LENGTH_SHORT).show();
return;
}

if(TextUtils.isEmpty(password))
{
Toast.makeText(LoginActivity.this, "please enter password", Toast.LENGTH_SHORT).show();
return;
}

firebaseAuth.signInWithEmailAndPassword(email,password).addOnCompleteListener(new
OnCompleteListener<AuthResult>() {
@Override
public void onComplete(@NonNull Task<AuthResult> task) {
progressBar2.setVisibility(View.VISIBLE);
if(task.isSuccessful())
{
finish();
startActivity(new Intent(getApplicationContext(),Main.class));
//Toast.makeText(LoginActivity.this,"Registered
Successfully",Toast.LENGTH_SHORT).show();
}
else
{

Toast.makeText(LoginActivity.this,"Could not Login Please try


again",Toast.LENGTH_SHORT).show();
progressBar2.setVisibility(View.INVISIBLE);
}
}
});
} 35
});
textViewSignup.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
startActivity(new Intent(getApplicationContext(),MainActivity.class));
}
});

Profile Activity
package com.shubhi.firebaseauth;

import android.content.Intent;
import android.net.Uri;
import android.os.Bundle;
import android.support.v7.app.AppCompatActivity;
import android.util.Log;
import android.widget.ImageView;
import android.widget.TextView;

import com.google.firebase.auth.FirebaseAuth;
import com.google.firebase.auth.FirebaseUser;
import com.google.firebase.database.DataSnapshot;
import com.google.firebase.database.DatabaseError;
import com.google.firebase.database.DatabaseReference;
import com.google.firebase.database.FirebaseDatabase;
import com.google.firebase.database.ValueEventListener;
import com.squareup.picasso.Picasso;

public class UserProfile extends AppCompatActivity


{

private TextView userName,userDOB,userEmail,userPhoneno;


private ImageView imageview;
private DatabaseReference profileUserRef;
private FirebaseAuth firebaseAuth;

protected void onCreate(Bundle savedInstanceState)


{
super.onCreate(savedInstanceState);
setContentView(R.layout.user_profile);

firebaseAuth=FirebaseAuth.getInstance();

firebaseAuth = FirebaseAuth.getInstance();
if(firebaseAuth.getCurrentUser()==null)
{
finish();
startActivity(new Intent(this,ProfileActivity.class));
}
final FirebaseUser currentUser=firebaseAuth.getCurrentUser();
36

// currentUserId=mAuth.getCurrentUser().getUid();
profileUserRef= FirebaseDatabase.getInstance().getReference("User");
userName =(TextView)findViewById(R.id.tv_name);
userDOB=(TextView)findViewById(R.id.tv_dob);
userEmail=(TextView)findViewById(R.id.tv_email);
userPhoneno=(TextView)findViewById(R.id.tv_phno);
imageview=(ImageView)findViewById(R.id.tv_profile);
profileUserRef.addValueEventListener(new ValueEventListener() {
@Override
public void onDataChange(DataSnapshot snapshot) {
Log.e("Count " ,""+snapshot.getChildrenCount());
for (DataSnapshot postSnapshot: snapshot.getChildren()) {
User post = postSnapshot.getValue(User.class);
if(post.getEmail().equals(currentUser.getEmail()))
{
userName.setText(post.getName().toUpperCase());
userDOB.setText(post.getDob());
userEmail.setText(post.getEmail());
userPhoneno.setText(post.getPhno());

Picasso.with(UserProfile.this).load(Uri.parse(post.getImage())).placeholder(R.drawable.ic_user).into(imagev
iew);

}
}

@Override
public void onCancelled(DatabaseError databaseError) {

}
});
}

}
Contact Us
package com.shubhi.firebaseauth;

import android.Manifest;
import android.content.Intent;
import android.content.pm.PackageManager;
import android.net.Uri;
import android.os.Build;
import android.os.Bundle;
import android.support.v4.app.ActivityCompat;
import android.support.v4.content.ContextCompat;
import android.support.v7.app.AppCompatActivity;
import android.text.TextUtils;
import android.util.Log;
import android.view.View;
import android.widget.Button;
import android.widget.Toast;
37
public class ContactUs extends AppCompatActivity implements View.OnClickListener{

private static final int PERMISSION_REQUEST_CODE = 1;


Button callButton,emailbutton;

@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.contact_us);
if (Build.VERSION.SDK_INT >= 23) {
if (checkPermission()) {
Log.e("permission", "Permission already granted.");
} else {

//If the app doesn’t have the CALL_PHONE permission, request it//

requestPermission();
}
}
emailbutton=(Button)findViewById(R.id.email);
emailbutton.setOnClickListener(ContactUs.this);

public boolean checkPermission() {

int CallPermissionResult = ContextCompat.checkSelfPermission(getApplicationContext(),


Manifest.permission.CALL_PHONE);

return CallPermissionResult == PackageManager.PERMISSION_GRANTED;

private void requestPermission() {

ActivityCompat.requestPermissions(ContactUs.this, new String[]


{
Manifest.permission.CALL_PHONE
}, PERMISSION_REQUEST_CODE);

@Override
public void onRequestPermissionsResult(int requestCode, String permissions[], int[] grantResults) {
switch (requestCode) {

case PERMISSION_REQUEST_CODE:
callButton = (Button) findViewById(R.id.Call);

if (grantResults.length > 0) {

boolean CallPermission = grantResults[0] == PackageManager.PERMISSION_GRANTED;


38
if (CallPermission) {

Toast.makeText(ContactUs.this,
"Permission accepted", Toast.LENGTH_LONG).show();

//If the permission is denied….//

} else {
Toast.makeText(ContactUs.this,

//...display the following toast...//

"Permission denied", Toast.LENGTH_LONG).show();

//...and disable the call button.//

callButton.setEnabled(false);

}
break;
}
}
}

public void call(View view) {


String phoneNum = "9027080283";
if (!TextUtils.isEmpty(phoneNum)) {
String dial = "tel:" + phoneNum;

//Make an Intent object of type intent.ACTION_CALL//

if (ActivityCompat.checkSelfPermission(this, Manifest.permission.CALL_PHONE) !=
PackageManager.PERMISSION_GRANTED) {
// TODO: Consider calling
// ActivityCompat#requestPermissions
// here to request the missing permissions, and then overriding
// public void onRequestPermissionsResult(int requestCode, String[] permissions,
// int[] grantResults)
// to handle the case where the user grants the permission. See the documentation
// for ActivityCompat#requestPermissions for more details.
return;
}
startActivity(new Intent(Intent.ACTION_CALL,

//Extract the telephone number from the URI//

Uri.parse(dial)));
}else {
Toast.makeText(ContactUs.this, "Please enter a valid telephone number",
Toast.LENGTH_SHORT).show();
}

@Override 39
public void onClick(View v) {
if(v==emailbutton)
{
sendemail();
}
}

private void sendemail() {


Log.i("send email", "");
String[] TO={"richika1999@gmail.com"};
String[] CC={"vaishalichaudhary1998@gmail.com"};
Intent emailintent=new Intent(Intent.ACTION_SEND);
emailintent.setData(Uri.parse("mailto:"));
emailintent.setType("text/plain");
emailintent.putExtra(Intent.EXTRA_EMAIL,TO);
emailintent.putExtra(Intent.EXTRA_CC,CC);
emailintent.putExtra(Intent.EXTRA_SUBJECT,"hEY");
emailintent.putExtra(Intent.EXTRA_TEXT,"ITS ME VAISHALI");
try{
startActivity(Intent.createChooser(emailintent,"send mail..."));
finish();
Log.i("Finished sending email...", "");
}catch (android.content.ActivityNotFoundException ex){
Toast.makeText(ContactUs.this,"there is no email client installed",Toast.LENGTH_LONG).show();
}

Upload Profile Image

package com.shubhi.firebaseauth;

import android.content.Intent;
import android.database.Cursor;
import android.net.Uri;
import android.os.Bundle;
import android.provider.OpenableColumns;
import android.support.annotation.NonNull;
import android.support.v7.app.AppCompatActivity;
import android.text.format.DateFormat;
import android.util.Log;
import android.view.View;
import android.widget.AdapterView;
import android.widget.ArrayAdapter;
import android.widget.Button;
import android.widget.ProgressBar;
import android.widget.Spinner;
import android.widget.TextView;
import android.widget.Toast;

import com.google.android.gms.tasks.OnFailureListener;
import com.google.android.gms.tasks.OnSuccessListener; 40
import com.google.firebase.auth.FirebaseAuth;
import com.google.firebase.auth.FirebaseUser;
import com.google.firebase.database.DataSnapshot;
import com.google.firebase.database.DatabaseError;
import com.google.firebase.database.DatabaseReference;
import com.google.firebase.database.FirebaseDatabase;
import com.google.firebase.database.ValueEventListener;
import com.google.firebase.storage.FirebaseStorage;
import com.google.firebase.storage.OnProgressListener;
import com.google.firebase.storage.StorageReference;
import com.google.firebase.storage.UploadTask;
import com.squareup.picasso.Picasso;

import java.io.File;
import java.util.Date;

public class UploadImage extends AppCompatActivity implements View.OnClickListener {

private Button choose,pause,cancel;


private TextView filename,percentage,progress1;
private final static int FILE_SELECT_CODE=1;

private StorageReference mStorageRef;


private ProgressBar mProgress;

FirebaseDatabase database;

private DatabaseReference myRef;


Spinner dropdown;
Video video;
String displayname=null;
String category;

FirebaseAuth firebaseAuth1;

@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.upload_img);
choose= (Button)findViewById(R.id.choosebtn);
pause=(Button)findViewById(R.id.pausebtn);
cancel=(Button)findViewById(R.id.cancelbtn);

filename=(TextView)findViewById(R.id.filename);
percentage=(TextView)findViewById(R.id.percentage);
progress1=(TextView)findViewById(R.id.progress);

mProgress=(ProgressBar)findViewById(R.id.prgrs) ;
choose.setOnClickListener(this);
pause.setOnClickListener(this);
cancel.setOnClickListener(this);
41
mStorageRef = FirebaseStorage.getInstance().getReference();
// category=dropdown.getSelectedItem().toString();
database = FirebaseDatabase.getInstance();
myRef = database.getReference("User");

firebaseAuth1 = FirebaseAuth.getInstance();
// dropdown= (Spinner) findViewById(R.id.spinner1);
// String[] items = new String[]{"dance", "music", "shayri","miscellaneous","cooking","weeving"};
//create an adapter to describe how the items are displayed, adapters are used in several places in android.
//There are multiple variations of this, but this is the basic variant.
// ArrayAdapter<String> adapter = new ArrayAdapter<>(this,
android.R.layout.simple_spinner_dropdown_item, items);
//set the spinners adapter to the previously created one.
// dropdown.setAdapter(adapter);
//category=dropdown.getSelectedItem().toString();

// videoref = myRef.child("video");
}

@Override
public void onClick(View v) {
if(v==choose)
{

openFileSelector();

}
if(v==pause)
{

}
}

private void openFileSelector() {


Intent intent =new Intent(Intent.ACTION_GET_CONTENT);
intent.setType("*/*");

intent.addCategory(Intent.CATEGORY_OPENABLE);
try {
startActivityForResult(
Intent.createChooser(intent, "Select the Image to Upload"),
FILE_SELECT_CODE);
}catch(android.content.ActivityNotFoundException ex)
{
Toast.makeText(UploadImage.this,"Please install a File Manager",Toast.LENGTH_SHORT).show();
}

}
protected void onActivityResult(int requestcode,int resultcode, Intent data)
{
if(requestcode==FILE_SELECT_CODE && resultcode==RESULT_OK)
42
{
Uri fileuri= data.getData();
// Toast.makeText(this,"You have selected a file",Toast.LENGTH_LONG).show();
String uriString =fileuri.toString();
File myfile=new File(uriString);
String path=myfile.getAbsolutePath();
Toast.makeText(UploadImage.this,"me",Toast.LENGTH_SHORT).show();

if(uriString.startsWith("content://"))
{
Cursor cursor=null;
try{
cursor= UploadImage.this.getContentResolver().query(fileuri,null,null,null,null);
if(cursor!=null & cursor.moveToFirst())
{

displayname=cursor.getString(cursor.getColumnIndex(OpenableColumns.DISPLAY_NAME));
}
}finally {
cursor.close();
Toast.makeText(UploadImage.this,"Please",Toast.LENGTH_SHORT).show();
}

}
else if(uriString.startsWith("Files://"))
{
displayname=myfile.getName();
Toast.makeText(UploadImage.this,displayname,Toast.LENGTH_SHORT).show();
}

filename.setText(displayname);
final StorageReference riversRef = mStorageRef.child("files/"+displayname);

riversRef.putFile(fileuri)
.addOnSuccessListener(new OnSuccessListener<UploadTask.TaskSnapshot>() {
@Override
public void onSuccess(UploadTask.TaskSnapshot taskSnapshot) {
Toast.makeText(UploadImage.this, "finish", Toast.LENGTH_SHORT).show();
// Get a URL to the uploaded content
final Uri downloadUrl = taskSnapshot.getDownloadUrl();
Toast.makeText(UploadImage.this, "file uploaded", Toast.LENGTH_LONG).show();

if (firebaseAuth1.getCurrentUser() == null) {
finish();
startActivity(new Intent(UploadImage.this, ProfileActivity.class));
}
final FirebaseUser user = firebaseAuth1.getCurrentUser();
myRef.addValueEventListener(new ValueEventListener() {
@Override
public void onDataChange(DataSnapshot snapshot) {
Log.e("Count ", "" + snapshot.getChildrenCount());
for (DataSnapshot postSnapshot : snapshot.getChildren()) {
User post = postSnapshot.getValue(User.class);
if (post.getEmail().equals(user.getEmail())) {
post.setImage(downloadUrl.toString());
43

postSnapshot.getRef().child("image").setValue(downloadUrl.toString());
}

}
}

@Override
public void onCancelled(DatabaseError databaseError) {

}
// String id="vaishalichaudhary1998@gmail.com";
// myRef.setValue(id);
// myRef.child(id).setValue(video);

}
);
}
} )
.addOnFailureListener(new OnFailureListener() {
@Override
public void onFailure(@NonNull Exception exception) {

// Handle unsuccessful uploads


Toast.makeText(UploadImage.this,"Error",Toast.LENGTH_LONG).show();
// ...
}
}

).addOnProgressListener(new OnProgressListener<UploadTask.TaskSnapshot>() {
@Override
public void onProgress(UploadTask.TaskSnapshot taskSnapshot) {
double progress= (100*taskSnapshot.getBytesTransferred())/taskSnapshot.getTotalByteCount();
mProgress.setProgress((int)progress);

percentage.setText(taskSnapshot.getBytesTransferred()/1024+"/"+taskSnapshot.getTotalByteCount()/1024+
"kb");
progress1.setText((int)progress+"%");

}
});

}
// super.onActivityResult(requestcode,resultcode,data);
}
}

Upload Videos

package com.shubhi.firebaseauth;

import android.content.Intent; 44
import android.database.Cursor;
import android.net.Uri;
import android.os.Bundle;
import android.provider.OpenableColumns;
import android.support.annotation.NonNull;
import android.support.v7.app.AppCompatActivity;
import android.text.format.DateFormat;
import android.view.View;
import android.widget.AdapterView;
import android.widget.ArrayAdapter;
import android.widget.Button;
import android.widget.ProgressBar;
import android.widget.Spinner;
import android.widget.TextView;
import android.widget.Toast;

import com.google.android.gms.tasks.OnFailureListener;
import com.google.android.gms.tasks.OnSuccessListener;
import com.google.firebase.database.DatabaseReference;
import com.google.firebase.database.FirebaseDatabase;
import com.google.firebase.storage.FirebaseStorage;
import com.google.firebase.storage.OnProgressListener;
import com.google.firebase.storage.StorageReference;
import com.google.firebase.storage.UploadTask;

import java.io.File;
import java.util.Date;

public class UploadVideo extends AppCompatActivity implements View.OnClickListener {

private Button choose,pause,cancel;


private TextView filename,percentage,progress1;
private final static int FILE_SELECT_CODE=1;

private StorageReference mStorageRef;


private ProgressBar mProgress;

private FirebaseDatabase database;

private DatabaseReference myRef;


Spinner dropdown;
Video video;
String displayname=null;
String category;

Date d;
CharSequence s;

@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.upload_video);
choose= (Button)findViewById(R.id.choosebtn);
pause=(Button)findViewById(R.id.pausebtn);
cancel=(Button)findViewById(R.id.cancelbtn); 45

filename=(TextView)findViewById(R.id.filename);
percentage=(TextView)findViewById(R.id.percentage);
progress1=(TextView)findViewById(R.id.progress);

mProgress=(ProgressBar)findViewById(R.id.prgrs) ;
choose.setOnClickListener(this);
pause.setOnClickListener(this);
cancel.setOnClickListener(this);

mStorageRef = FirebaseStorage.getInstance().getReference();
// category=dropdown.getSelectedItem().toString();
database = FirebaseDatabase.getInstance();
myRef = database.getReference("Video");

d = new Date();
s=DateFormat.format("MMMM d, yyyy ", d.getTime());

dropdown= (Spinner) findViewById(R.id.spinner1);


String[] items = new String[]{"dance", "music", "shayri","miscellaneous","cooking","weeving"};
//create an adapter to describe how the items are displayed, adapters are used in several places in android.
//There are multiple variations of this, but this is the basic variant.
ArrayAdapter<String> adapter = new ArrayAdapter<>(this,
android.R.layout.simple_spinner_dropdown_item, items);
//set the spinners adapter to the previously created one.
dropdown.setAdapter(adapter);
//category=dropdown.getSelectedItem().toString();

dropdown.setOnItemSelectedListener(new AdapterView.OnItemSelectedListener() {
public void onItemSelected(
AdapterView<?> adapterView, View view,
int i, long l) {
category = dropdown.getItemAtPosition(i).toString();
}

public void onNothingSelected(


AdapterView<?> adapterView) {

}
});

// videoref = myRef.child("video");
}

@Override
public void onClick(View v) {
if(v==choose)
{

openFileSelector();

}
if(v==pause)
{
46
}
}
private void openFileSelector() {
Intent intent =new Intent(Intent.ACTION_GET_CONTENT);
intent.setType("*/*");

intent.addCategory(Intent.CATEGORY_OPENABLE);
try {
startActivityForResult(
Intent.createChooser(intent, "Select the File to Upload"),
FILE_SELECT_CODE);
}catch(android.content.ActivityNotFoundException ex)
{
Toast.makeText(UploadVideo.this,"Please install a File Manager",Toast.LENGTH_SHORT).show();
}

}
protected void onActivityResult(int requestcode,int resultcode, Intent data)
{
if(requestcode==FILE_SELECT_CODE && resultcode==RESULT_OK)
{
Uri fileuri= data.getData();
// Toast.makeText(this,"You have selected a file",Toast.LENGTH_LONG).show();
String uriString =fileuri.toString();
File myfile=new File(uriString);
String path=myfile.getAbsolutePath();
Toast.makeText(UploadVideo.this,"me",Toast.LENGTH_SHORT).show();

if(uriString.startsWith("content://"))
{
Cursor cursor=null;
try{
cursor= UploadVideo.this.getContentResolver().query(fileuri,null,null,null,null);
if(cursor!=null & cursor.moveToFirst())
{

displayname=cursor.getString(cursor.getColumnIndex(OpenableColumns.DISPLAY_NAME));
}
}finally {
cursor.close();
Toast.makeText(UploadVideo.this,"Please",Toast.LENGTH_SHORT).show();
}

}
else if(uriString.startsWith("Files://"))
{
displayname=myfile.getName();
Toast.makeText(UploadVideo.this,displayname,Toast.LENGTH_SHORT).show();
}

filename.setText(displayname);
final StorageReference riversRef = mStorageRef.child("files/"+displayname);
47
riversRef.putFile(fileuri)
.addOnSuccessListener(new OnSuccessListener<UploadTask.TaskSnapshot>() {
@Override
public void onSuccess(UploadTask.TaskSnapshot taskSnapshot) {
Toast.makeText(UploadVideo.this,"finish",Toast.LENGTH_SHORT).show();
// Get a URL to the uploaded content
Uri downloadUrl = taskSnapshot.getDownloadUrl();
Toast.makeText(UploadVideo.this,"file uploaded",Toast.LENGTH_LONG).show();
String uploadId = myRef.push().getKey();
video=new
Video("No",category,s.toString(),"vaishalichaudhary@gmail.com",uploadId,"vaishali"
,downloadUrl.toString(),"hey im vaishali","0");
//String accepted, String category, String date, String email,String id, String name , String
reference, String text, String votes
// myRef.setValue(video);
myRef.child(uploadId).setValue(video);
// String id="vaishalichaudhary1998@gmail.com";
// myRef.setValue(id);
// myRef.child(id).setValue(video);

})
.addOnFailureListener(new OnFailureListener() {
@Override
public void onFailure(@NonNull Exception exception) {

// Handle unsuccessful uploads


Toast.makeText(UploadVideo.this,"Error",Toast.LENGTH_LONG).show();
// ...
}
}

).addOnProgressListener(new OnProgressListener<UploadTask.TaskSnapshot>() {
@Override
public void onProgress(UploadTask.TaskSnapshot taskSnapshot) {
double progress= (100*taskSnapshot.getBytesTransferred())/taskSnapshot.getTotalByteCount();
mProgress.setProgress((int)progress);

percentage.setText(taskSnapshot.getBytesTransferred()/1024+"/"+taskSnapshot.getTotalByteCount()/1024+
"kb");
progress1.setText((int)progress+"%");

}
});

}
// super.onActivityResult(requestcode,resultcode,data);
}
}

48
Testing

Methodology used for testing


Introduction
Software testing is a critical element of software quality assurance and it represents the ultimate
view of specification, design and coding.
Verification
Set of activities to decide that “Are we building the product right?”
Validation
Set of activities to decide that “Are we building the right product?”

Testing Objectives:
A number of rules that can serve well as testing objectives.
1. Testing shows presence of Defects
2. Exhaustive Testing is Impossible!
3. Early Testing
4. Defect Clustering
5. The Pesticide Paradox
6. Testing is Context Dependent
7. Absence of Errors Fallacy

1. Testing shows the presence of Defects


• We test to find Faults (as known as Defects)
• As we find more defects, the probability of undiscovered defects remaining in a system reduces (
decreasing nature).
• However Testing cannot prove that there are no defects present.

2. Exhaustive Testing is Impossible!


• We have learned that we cannot test everything (i.e. all combinations of inputs and pre-conditions).
• That is we must Prioritise our testing effort using a Risk Based Approach.

3. Early testing
• Testing activities should start as early as possible in the development life cycle
• These activities should be focused on defined objectives – outlined in the Test Strategy
• Remember from our Definition of Testing, that Testing doesn’t start once the code has been written!

4. Defect Clustering
• Defects are not evenly distributed in a system
• They are ‘clustered’ 49
• In other words, most defects found during testing are usually confined to a small number of modules
( 80% of uncovered errors focused in 20% modules of the whole application) “Pareto law”
• Similarly, most operational failures of a system are usually confined to a small number of modules
• An important consideration in test prioritisation!

5. The Pesticide Paradox


• Testing identifies bugs, and programmers respond to fix them
• As bugs are eliminated by the programmers, the software improves
• As software improves the effectiveness of previous tests erodes
Therefore we must learn, create and use new tests based on new techniques to catch new bugs ( i.e.
it is not a matter of repetition. It is a matter of learning and improving)

6. Testing is Context (background)Dependent


• Testing is done differently in different contexts
• For example, safety-critical software is tested differently from an e-commerce site
• Whilst, Testing can be 50% of development costs, in NASA's Apollo program (it was 80% testing)
• 3 to 10 failures per thousand lines of code (KLOC) typical for commercial software
• 1 to 3 failures per KLOC typical for industrial software
• 0.01 failures per KLOC for NASA Shuttle code!
• Also different industries impose different testing standards

7. Absence of Errors Fallacy


• If we build a system and, in doing so, find and fix defects ...
It doesn’t make it a good system
• Even after defects have been resolved, it may still be unusable and/or does not fulfil the users’ needs
and expectations.

Testing Strategies
These are the testing strategies:

1 .Unit Testing:-This test is applied on each of the module to find whether or not each module is
properly working or not.
• Interfaces tested for proper information flow.
• Local data are examined to ensure that integrity is maintained.
• Boundary conditions are tested.
• Basis path testing should be used.
• All error handling paths should be tested.
• Drivers and/or stubs need to be developed to test incomplete software.

2. Integration Testing:- After each module cleared the unit testing then modules is tested for
their working all together in the integrated testing phase.
 Bottom - up testing (test harness).
 Top - down testing (stubs).
 Modified top - down testing - test levels independently.
 Big Bang.
 Sandwich testing
50
3. Acceptance Testing: - This testing provides the final assurance that the application needed
all behavioral and performance requirements.
4. Black-box: This testing methodology looks at what are the available inputs for an application and
what the expected outputs are that should result from each input. It is not concerned with the inner
workings of the application, the process that the application undertakes to achieve a particular output
or any other internal aspect of the application that may be involved in the transformation of an input
into an output. Most black-box testing tools employ either coordinate based interaction with the
applications graphical user interface (GUI) or image recognition. An example of a black-box system
would be a search engine. You enter text that you want to search for in the search bar, press “Search”
and results are returned to you. In such a case, you do not know or see the specific process that is
being employed to obtain your search results, you simply see that you provide an input – a search
term – and you receive an output – your search results.

5. White-box:This testing methodology looks under the covers and into the subsystem of an
application. Whereas black-box testing concerns itself exclusively with the inputs and outputs of an
application, white-box testing enables you to see what is happening inside the application. White-box
testing provides a degree of sophistication that is not available with black-box testing as the tester is
able to refer to and interact with the objects that comprise an application rather than only having
access to the user interface. An example of a white-box system would be in-circuit testing where
someone is looking at the interconnections between each component and verifying that each internal
connection is working properly. Another example from a different field might be an auto-mechanic
who looks at the inner-workings of a car to ensure that all
of the individual parts are working correctly to ensure the car drives.

Testing Reports

User Login Form


Test Case Id Input Description Input data Output result Expected Result
1. To verify User Email Id Login Successful Login successful or
Email Id an error message
“In valid login id”
must be displayed
2. To verify User Password Login Successful Login successful or
Password an error message
“In valid password
“ must be displayed

User Registration Form


Test Case Id Input Description Input data Output Result Expected Result
1 To verify that Entered data and Registered Registration
whether any field is click on Register Successfully successful or an
empty or not button error message
“Enter this field”
must be displayed
2 To verify Email Id Email Id Correct Pattern successful or an
Pattern error message “In
valid email pattern”
must be displayed
3 To verify Password Password Correct Pattern successful or an
Pattern error message “In
51
valid password
pattern” must be
displayed
4 To verify Phone Phone number Correct Phone successful or an
number number error message “In
valid phone
number” must be
displayed
5 To verify date of DOB Correct DOB successful or an
birth error message “In
valid dob” must be
displayed

USER INTERFACE

Input Screen
Input Design is the process of the converting user oriented inputs to a computer based format. Inaccurate Inputted data
have the most common sense of error in data processing. Any ambiguity conceiving at input leads to a total fault in
output. The goal of designing the input data is to make the data entry easy, logical and error free as possible, Inputs
are made using forms and data validations is done at the time of inputing data.

Splash Screen:

52

Registration Screen:
Login Screen:

53
Navigation Drawer:
Home Page:

Profile Screen:

54
Rate Our App:

Streaming Videos:

55
Video Playing:

56
Searching:
57
About Us:

Contact Us:

Upload Video Screen :


58
Admin Login:

Accepting/Discarding Videos:

59
60
REFERENCES

 https://developer.android.com/studio/
 https://www.androidauthority.com/android-studio-tutorial-beginnersz-637571/
 https://www.tutorialspoint.com/software_testing/index.htm
 https://www.softwaretestinghelp.com/types-of-software-testing/
 https://www.lucidchart.com/blog/data-flow-diagram-tutorial
 https://www.ofnisystems.com/services/validation/design-specification/
 https://www.lucidchart.com/blog/er-diagram-tutorial/
 https://www.lucidchart.com/blog/sequence-diagram-tutorial/
 https://www.lucidchart.com/blog/activity-diagram-tutorial/

61

You might also like