Sie sind auf Seite 1von 91

ANDROID APP ON STUDENT FACULTY INTERACTION

A project Report Submitted in partial fulfillment of the


requirement for the
Award of the degree of
BACHELOR OF TECHNOLOGY
in

COMPUTER SCIENCE AND ENGINEERING

Under the Esteemed Guidence of


CH.KODANDA RAMU M.Tech,(Ph.D.)
(Assistant Professor )
Avanthi Institute of Engineering and Technology

DEPARTMENT OF COMPUTER SCIENCE AND ENGINEERING


AVANTHI INSTITUTE OF ENGINEERING & TECHNOLOGY
(Approved by AICTE, Recognised bythe Govt. of A.P. & Affiliated to JNTU Kakinada)

Cherukupally (V), Bhogapuram (M), Vizianagaram (A.P)


(2011-2015)

DECLARATION
We hereby declare that this project report entitled ANDROID APP ON STUDENT
FACULTY INTERACTION has been prepared by us during the period January 2015
March 2015, in partial fulfillment of the requirements for the award of degree of
CSE(COMPUTER SCIENCE AND ENGINEERING).

G.K.S.SARMA
K.SSSSDVPRASAD
K.BHARADWAJ
G.SHIVA
B.BHANU CHANDAR

11Q71A0529
11Q71A0554
11Q71A0552
11Q71A0530
11Q71A0506

ACKNOWLEDGEMENT
Isaac Newton says, If I have seen a little further, it is by standing on the shoulders of
giants. I'm not Isaac Newton, but the same is true for me.
We are very much thankful to our principal Prof. P. Krishna Rao garu, for permitting
and encouraging me in doing this project.

At the outset, with great solemnity and sincerity, we would like to thank

Mr.

Y.Ramesh Kumar, Head of the Department, Computer Science and Information Technology,
for his encouragement and valuable guidelines during our study in the department. I am deeply
motivated by his valuable guidance and kind cooperation throughout the making of the project.
We offer our profuse thanks to Mr. Ch. Kodanda Ram, Associate Professor,
Department of computer science, for guiding us all through our project work, giving a right
direction and shape to our learning.
Finally, we would like to thank all staff members and technicians for their continuous
cooperation and encouragement.

CONTENTS
S.No. Topic

Page No

1. INTRODUCTION
1.1. Introduction to Project

1.2. Objective of the Project

1.3. Problem definition

1.4.Organization of Documentation

1.5. Existed Systems

1.6. Proposed Systems

10

2. SYSTEM REQUIREMENTS
2.1. Overview of Application

12

2.2. Functional Requirements

12

2.3. Non Functional Requirements

12

2.4. System Requirements

13

2.4.1. Software Requirements

13

2.4.1.1. Software Environment: JAVA


2.4.1.2. Software Environment: ANDROID
2.4.2. Hardware Requirements

13
25
32

2.5. Domain Description

32

3. SYSTEM ANALYSIS
3.1. Introduction

34

3.2. Software Requirement Specification

34

3.3. Feasibility study

35

3.3.1. Economical feasibility

35

3.3.2. Technical feasibility

35

3.3.3. Social feasibility

36

4. SYSTEM DESIGN

4.1. Introduction

37

4.2. Data Flow Diagrams

40

4.3. UML Diagrams

42

4.3.1. Use Case Diagram

43

4.3.2. Class Diagram

44

4.3.3. Sequence Diagram

45

4.3.4. Activity Diagram

46

4.3.5. State chart Diagram

47

4.3.6. Component Diagram

48

4.3.7. Deployment Diagram

49

4.3.8. Collaboration Diagram

50

5. Implementation
5.1. Introduction

51

5.2. Sample data

52

5.3. Sample code

55

6. OUTPUT SCREENS

66

7. TESTING AND VALIDATIONS

74

8. CONCLUSION

81

9. BIBLIOGRAPHY

82

10. USER MANUAL

83

ABSTRACT

We decided to make the manual student-faculty interaction to be computerized


after conducting various feasibility studies. All details will be available on a click. Fast
access to database less error More Storage Capacity Search facility Look and Feel
Environment. It provides "better and efficient" service to members. Reduce the
workload of employee. Proposed system is an automated Student-Faculty
Interaction. Firstly he should register with his id number into the app and then log on
to the app. After login he can send doubts. This paper represents online interaction
of student and faculty. In this app student can post his doubts corresponding to
subject and branch. At the same time faculty can give answers to their doubts
corresponding to his assigned subjects.This app is mainly developing for specifc
college.The main advantage of this app is student and faculty can download this app
and make interaction and share the ideas.

1. Introduction
1.1 Introduction to Project
This android application is mainly developing for online interacion about
student and faculty.In this app every student and faculty has its own username
and password for logon to the application. There are three modules inthis app
Admin
Student
Faculty
1.2 Objective of the Project
The project Student Faculty Interaction is designed and developed on Android platform
using Java Language and SQLite. This project lends a helping hand to students in sending their
doubts in the app itself. This project is developed to provide the student with message system and
to get the solution/answer issued in the app itself. This project accepts any inputs and displays
the required output within no time.

1.3Problem Definition
Post doubts
Sharing ideas
Faculty can view and send their solution to their respective subjects.

1.4 Organization of Documentation


In this project documentation we have initially put the definition and objective of the
project as well as the design of the project which is followed by the implementation and testing
phases. Finally the project has been concluded successfully.

1.5. Existing System


7

In this application we are aiming for the student and faculty interaction ,where in earlier
applications and portals of specific colleges, we dont have idea sharing between the student and
faculty. In previous ideas they provide college portals for the information about the college.
And there give the college details and faculty details and subjects etc, but they dont give
the interaction. They can provide information about the academic year and student details and
further details about

the student according to year ,semester and branch . student academic

details of the particular student has been provide .


Details about the faculty in the Particular department under the guidance of the particular
hod. Their subjects and e-books and further details of the subjects have been provided. but their
is no particular subject to student doubt clarification interaction program
But here we can provide that idea sharing application through college portal.

DISADVANTAGES:
. No interaction between faculty and student
Subject wise doubt clarification is not there.
No communication .

1.6.Proposed System:
Proposed system is an automated Student-Faculty Interaction. Firstly he should
register with his id number into the app and then log on to the app. After login he can
send doubts. This paper represents online interaction of student and faculty. In this
app student can post his doubts corresponding to subject and branch. At the same
time faculty can give answers to their doubts corresponding to his assigned
subjects.This app is mainly developing for specifc college.The main advantage of
8

this app is student and faculty can download this app and make interaction and
share the ideas.

2. System Requirements
2.1 Introduction
A Software Requirement specification (SRS) is a complete description of the behavior of
the system to be developed. It includes set of use cases that describe all the interactions the users
will have with the software. Use cases are also known as functional requirements. In addition to
use cases, the SRS also contains non-functional (or supplementary) requirements. Non-functional
requirements are requirements which impose constraints on the design or implementation (such
as performance engineering requirements, quality standards, or design constraints)

2.2 Functional Requirements


In software engineering, a functional requirement defines a function of a software system
or its component. A function is described as a set of inputs, the behavior, and outputs. Functional
requirements may be calculations, technical details, data manipulations and processing and other
specific functionality that define what a system is supposed to accomplish. Behavioral
9

requirements describing all the cases where the system uses the functional requirements are
captured in the usecases. Functional requirements are supported by non-functional requirements
(also known as quality requirements), which impose constraints on the design or implementation
(such as performance requirements, security, or reliability). How a system implements functional
requirements is detailed in the system design. In some cases a requirements analyst generates use
cases after gathering and validating a set of functional requirements. Each use case illustrates
behavioral scenarios through one or more functional requirements. Often, through an analyst will
begin by elicting a set of use cases, from which the analyst can derive the functional
requirements that must be implemented to allow a user to perform each use case.

Functional Requirements

Input: user id & password, faculty or student.


Output: subject details, and messages.

2.3.Non Functional Requirements


In systems engineering and requirements engineering, a non functional requirement is a
requirements that specifies criteria that can be used to judge the operation of a system,rather than
specific behaviours. This should be contrasted with functional requirements that define specific
behaviour or functions. In general functional requirements define what a system is supposed to
do whereas non-functional requirements define how a system supposed to be. Non-functional
requirements are often called qualities of a system. Other terms for non functional requirements
are constraints,quality goals andquality of service requirements, and non behavioural
requirements. Qualities, that is, non-functional requirements,can be divided into two main
categories:

Execution qualities,such as security and usability,which are observable at run time.


Evolution qualities,such as testability,maintability,extensibility and scalability,which are
emboided in the structure of the software system.

2.4.System Requirements
To be used efficiently,all computer software needs certain hardware components or other
software resources to e present on a computer.these pre-requisites are known as system
requirements and are often used as aguideline as opposed to an absolute rule. Most software
defines two sets of system requirements:min imum and recommended. With increasing demand
for higher processing power and resources in newer versions of software,system requirements
tend to increase over time. Industry analysts suggest that this trend plays a bigger part in driving
upgrades to existing computer system than technological advancements.
10

2.4.1 Software Requirements:


Software requirements deal with defining software resource requirements and prerequisite that need to be installed on computer to provide optimal functioning of an application.
These requirements are generally not include in the software installation package and need to be
installed seperately before the software is installed.

Front end
Back End
Tools used
Operating system
Database

:
:
:
:
:

Java, Android.
java, JSON
Android SDK, Eclipse.
Windows 7
SQL

2.4.1.1 Software Environment: JAVA


Java Technology
Java technology is both a programming language and a platform.

The Java Programming Language


The Java programming language is a high-level language that can be characterized by
all of the following buzzwords:

Simple
Architecture neutral
Object oriented
Portable
Distributed
High performance
Interpreted
Multithreaded
Robust
Dynamic
Secure

With most programming languages, you either compile or interpret a program so that you
can run it on your computer. The Java programming language is unusual in that a program is

11

both compiled and interpreted. With the compiler, first you translate a program into an
intermediate language called Java byte codes the platform-independent codes interpreted by
the interpreter on the Java platform. The interpreter parses and runs each Java byte code
instruction on the computer. Compilation happens just once; interpretation occurs each time the
program is executed. The following figure illustrates how this works.

Figure: Working of Java


You can think of Java byte codes as the machine code instructions for the Java
Virtual Machine (Java VM). Every Java interpreter, whether its a development tool or a Web
browser that can run applets, is an implementation of the Java VM. Java byte codes help make
write once, run anywhere possible. You can compile your program into byte codes on any
platform that has a Java compiler. The byte codes can then be run on any implementation of the
Java VM. That means that as long as a computer has a Java VM, the same program written in the
Java programming language can run on Windows 2000, a Solaris workstation, or on an iMac.

Figure 3.2 Platform Dependency


12

The Java Platform


A platform is the hardware or software environment in which a program runs. Weve

already mentioned some of the most popular platforms like Windows 2000, Linux, Solaris,
and MacOS. Most platforms can be described as a combination of the operating system and
hardware. The Java platform differs from most other platforms in that its a software-only
platform that runs on top of other hardware-based platforms.
The Java platform has two components:

The Java Virtual Machine (Java VM)


The Java Application Programming Interface (Java API)

Youve already been introduced to the Java VM. Its the base for the Java platform and is
ported onto various hardware-based platforms.
The Java API is a large collection of ready-made software components that provide
many useful capabilities, such as graphical user interface (GUI) widgets. The Java API is
grouped into libraries of related classes and interfaces; these libraries are known as packages.
The next section, What Can Java Technology Do? Highlights what functionality some of the
packages in the Java API provide.
The following figure depicts a program thats running on the Java platform. As the
figure shows, the Java API and the virtual machine insulate the program from the hardware.
Native code is code that after you compile it, the compiled code runs on a specific
hardware platform. As a platform-independent environment, the Java platform can be a bit
slower than native code. However, smart compilers, well-tuned interpreters, and just-in-time
byte code compilers can bring performance close to that of native code without threatening
portability.

13

What Can Java Technology Do?


The most common types of programs written in the Java programming language are
applets and applications. If youve surfed the Web, youre probably already familiar with
applets. An applet is a program that adheres to certain conventions that allow it to run within
a Java-enabled browser.
However, the Java programming language is not just for writing cute, entertaining
applets for the Web. The general-purpose, high-level Java programming language is also a
powerful software platform. Using the generous API, you can write many types of programs.
An application is a standalone program that runs directly on the Java platform. A
special kind of application known as a server serves and supports clients on a network.
Examples of servers are Web servers, proxy servers, mail servers, and print servers.
Another specialized program is a servlet. A servlet can almost be thought of as an
applet that runs on the server side. Java Servlets are a popular choice for building interactive
web applications, replacing the use of CGI scripts. Servlets are similar to applets in that they
are runtime extensions of applications. Instead of working in browsers, though, servlets run
within Java Web servers, configuring or tailoring the server.
How does the API support all these kinds of programs? It does so with packages of
software components that provides a wide range of functionality.
Every full implementation of the Java platform gives you the following features:

The essentials: Objects, strings, threads, numbers, input and output, data

structures, system properties, date and time, and so on.


Applets: The set of conventions used by applets.
Networking: URLs, TCP (Transmission Control Protocol), UDP (User Data gram

Protocol) sockets, and IP (Internet Protocol) addresses.


Internationalization: Help for writing programs that can be localized for users
worldwide. Programs can automatically adapt to specific locales and be displayed
in the appropriate language.
14

Security: Both low level and high level, including electronic signatures, public

and private key management, access control, and certificates.


Software components: Known as JavaBeans TM, can plug into existing

component architectures.
Object serialization: Allows lightweight persistence and communication via
Remote Method Invocation (RMI).

How Will Java Technology Change My Life?


We cant promise you fame, fortune, or even a job if you learn the Java
programming language. Still, it is likely to make your programs better and requires less
effort than other languages. We believe that Java technology will help you do the
following:

Get started quickly: Although the Java programming language is a powerful


object-oriented language, its easy to learn, especially for programmers already

familiar with C or C++.


Write less code: Comparisons of program metrics (class counts, method counts,
and so on) suggest that a program written in the Java programming language can be

four times smaller than the same program in C++.


Write better code: The Java programming language encourages good coding
practices, and its garbage collection helps you avoid memory leaks. Its object
orientation, its JavaBeans component architecture, and its wide-ranging, easily

extendible API let you reuse other peoples tested code and introduce fewer bugs.
Develop programs more quickly: Your development time may be as much as
twice as fast versus writing the same program in C++. Why? You write fewer lines

of code and it is a simpler programming language than C++.


Avoid platform dependencies with 100% Pure Java: You can keep your program
portable by avoiding the use of libraries written in other languages. The 100% Pure
Java Product Certification Program has a repository of historical process manuals,

white papers, brochures, and similar materials online.


Write once, run anywhere: Because 100% Pure Java programs are compiled into
machine-independent byte codes, they run consistently on any Java platform.

15

Distribute software more easily: You can upgrade applets easily from a central
server. Applets take advantage of the feature of allowing new classes to be loaded

on the fly, without recompiling the entire program.


Java has two things:
A programming language and a platform.
Java is a high-level programming language that is all of the following.

Secure

Architectural neutral

Object oriented

Portable

Distributed

High Performance

Interpreted

Multithreaded

Robust and Dynamic

Secure

Java is also unusual in that each Java program is both compiled and interpreted. With a
compile you translate a Java program into an intermediate language called Java byte codes
the platform-independent code instruction is passed and run on the computer.
Compilation happens just once; interpretation occurs each time the program is executed.
The figure illustrates how this works.
You can think of Java byte codes as the machine code instructions for the Java Virtual
Machine (Java VM). Every Java interpreter, whether its a Java development tool or a Web
browser that can run Java applets, is an implementation of the Java VM. The Java VM can
also be implemented in hardware.
Java byte codes help make write once, run anywhere possible. You can compile your
Java program into byte codes on my platform that has a Java compiler. The byte codes can
then be run any implementation of the Java VM. For example, the same Java program can
run Windows NT, Solaris, and Macintosh.
Java provides more packages to develop all kind of applications and applets. Some of
them are listed below.

java.lang - handles all basic operations and contains the data types.
16

java.io - handles all kinds of input and output operations.


java.util - contains collection based classes and interfaces.
java.awt - contains user interface components.
java.awat.event - contains user interface component event listeners.
java.awt.image - contains image handling classes and interfaces.
javax.swing - contains enhanced user interface components.
javax.swing.event - contains event listeners of enhanced user interface
components.

Swing is a platform-independent, Model-View-Controller GUI framework for Java. It


follows a single-threaded programming model, and possesses the following traits:

Platform Independence
Swing is platform independent both in terms of its expression (Java) and its

implementation (non-native universal rendering of widgets).

Extensibility
Swing is a highly partitioned architecture, which allows for the "plugging" of various

custom implementations of specified framework interfaces: Users can provide their own
custom implementation(s) of these components to override the default implementations. In
general, Swing users can extend the framework by extending existing (framework) classes
and/or providing alternative implementations of core components.

Component-oriented
Swing is a component-based framework. The distinction between objects and

components is a fairly subtle point: concisely, a component is a well-behaved object with a


known/specified characteristic pattern of behavior. Swing objects asynchronously fire events,
have "bound" properties, and respond to a well-known set of commands (specific to the
component.) Specifically, Swing components are Java Beans components, compliant with the
Java Beans Component Architecture specifications.
Customizable

17

Given the programmatic rendering model of the Swing framework, fine control over
the details of rendering of a component is possible in Swing. As a general pattern, the visual
representation of a Swing component is a composition of a standard set of elements, such as
a "border", "inset", decorations, etc. Typically, users will programmatically customize a
standard Swing component (such as a JTable) by assigning specific Borders, Colors,
Backgrounds, opacities, etc., as the properties of that component. The core component will
then use these properties (settings) to determine the appropriate renderers to use in painting
its various aspects. However, it is also completely possible to create unique GUI controls
with highly customized visual representation.

Configurable
Swing's heavy reliance on runtime mechanisms and indirect composition patterns

allows it to respond at runtime to fundamental changes in its settings. For example, a Swingbased application can change its look and feel at runtime. Further, users can provide their
own look and feel implementation, which allows for uniform changes in the look and feel of
existing Swing applications without any programmatic change to the application code.

Lightweight UI
Swing's configurability is a result of a choice not to use the native host OS's GUI

controls for displaying itself. Swing "paints" its controls programmatically through the use of
Java 2D APIs, rather than calling into a native user interface toolkit. Thus, a Swing
component does not have a corresponding native OS GUI component, and is free to render
itself in any way that is possible with the underlying graphics APIs. However, at its core
every Swing component relies on an AWT container, since (Swing's) JComponent extends
(AWT's) Container. This allows Swing to plug into the host OS's GUI management
framework, including the crucial device/screen mappings and user interactions, such as key
presses or mouse movements. Swing simply "transposes" its own (OS agnostic) semantics
over the underlying (OS specific) components. So, for example, every Swing component
paints its rendition on the graphic device in response to a call to component. Paint (), which
18

is defined in (AWT) Container. But unlike AWT components, which delegated the painting to
their OS-native "heavyweight" widget, Swing components are responsible for their own
rendering.
This transposition and decoupling is not merely visual, and extends to Swing's
management and application of its own OS-independent semantics for events fired within its
component containment hierarchies. Generally speaking, the Swing Architecture delegates
the task of mapping the various flavors of OS GUI semantics onto a simple, but generalized,
pattern to the AWT container. Building on that generalized platform, it establishes its own
rich and complex GUI semantics in the form of the JComponent model. A review of the
source of container. Java and JComponent.java classes are recommended for further insights
into the nature of the interface between Swing's lightweight components and AWT's
heavyweight widgets.

Loosely-Coupled/MVC
The Swing library makes heavy use of the Model/View/Controller software design

pattern, which conceptually decouples the data being viewed from the user interface controls
through which it is viewed. Because of this, most Swing components have associated models
(which are specified in terms of Java interfaces), and the programmer can use various default
implementations or provide their own. The framework provides default implementations of
model interfaces for all of its concrete components.
Typically, Swing component model objects are responsible for providing a concise
interface defining events fired, and accessible properties for the (conceptual) data model for
use by the associated JComponent. Given that the overall MVC pattern is a loosely-coupled
collaborative object relationship pattern, the model provides the programmatic means for
attaching event listeners to the data model object. Typically, these events are model centric
(ex: a "row inserted" event in a table model) and are mapped by the JComponent
specialization into a meaningful event for the GUI component.
For example, the JTable has a model called Table Model that describes an interface
for how a table would access tabular data. A default implementation of this operates on a
19

two-dimensional array. The view component of a Swing JComponent is the object used to
graphically "represent" the conceptual GUI control. A distinction of Swing, as a GUI
framework, is in its reliance on programmatically-rendered GUI controls (as opposed to the
use of the native host OS's GUI controls). This distinction is a source of complications when
mixing AWT controls, which use native controls, with Swing controls in a GUI.
Finally, in terms of visual composition and management, Swing favors relative
layouts (which specify the positional relationships between components) as opposed to
absolute layouts (which specify the exact location and size of components). This bias towards
"fluid"' visual ordering is due to its origins in the applet operating environment that framed
the design and development of the original Java GUI toolkit. (Conceptually, this view of the
layout management is quite similar to that which informs the rendering of HTML content in
browsers, and addresses the same set of concerns that motivated the former.)

Look and feel


Swing allows one to specialize the look and feel of widgets, by modifying the default

(via runtime parameters), deriving from an existing one, by creating one from scratch, or,
beginning with J2SE 5.0, by using the skinnable synth Look and Feel (see Synth Look and
Feel), which is configured with an XML property file. The look and feel can be changed at
runtime, and early demonstrations of Swing frequently provided a way to do this.

Features of Swing components:


Swing buttons and 1abels can display images instead of, or in addition to text.
User can easily add or change the borders drawn around most swing components.
Users can easily change the behavior or appearance of a swing component by

either invoking methods on it or creating a subclass of it.


Swing components dont have to be rectangular, buttons, for e.g., can be round.
Assistive technologies such as screen renders can get information from swing
components.
Swing lets to specify which look and feel a programs GUI uses.
The Swing API is flexible, powerful and immense. It is available in two forms:
As a core part of the Java2 platform
JFC 1.1
20

JFrame: The JFrame class is slightly incompatible with Frame. Like all other JFC/Swing
top-level containers, a JFrame contains a JRootPane as its only child. The content pane
provided by the root pane should, as a rule, contain all the non-menu components

displayed by the JFrame. This is different from the AWT Frame case.
JPanel: JPanel is an extension of Jcomponent used for grouping together other

components. It gets most of its implementations from its super classes.


JButton: JButton is a push button that is a replacement for java.awt.Button. Like AWT
buttons, Swing button fire action events when they activated. An action Listener can
register with a button, and the listeners action performed method will be invoked

whenever the button is activated.


JTextField: JTextField allow the user to enter a single line of text, scrolling the text if its
size exceeds the physical size of the field. Horizontal alignment either LEFT, RIGHT or

CENTER can be specified for a text fields text.


JTextArea: JTextArea class displays multiple times of text in a single font and style. Its
default behavior is not to wrap lines of text, but line wrapping can be enabled on word

(or) character boundaries.


JList: Swing lists, represented by the JList class, display a list of selectable objects.
JSplit: The JSplitPane component allows you to place two (and only two) components

side by side in a single pane.


JScrollPane: The JScrollPane class is actually just a panel with a hard-working layout

manager and some convenient access methods for the manager.


-JScrollPane control
-Row header
-Column header
-View port
-Horizontal Scrollbar
-Vertical Scrollbar
-Four corners (Upper left, Upper right, lower left)
JTabbedPane: The JTabbedPane is used for creating your own tabbed pane with tab

activation components, very quickly.


JFileChooser: JFileChooser class bundles a directory pane into a handy interface.
JMenubar: JMenubar uses the Default single Selection model as its data model because

the user can raise, or activate, only one of its menus at a given time.
JMenuItem: An implementation of an item in a menu. A menu item is essentially a
button sitting in a list. When the user selects the "button", the action associated with the
21

menu item is performed. A JMenuItem contained in a JPopupMenu performs exactly that

function.
JTree: The JTree class can build up trees out of several different objects, including a Tree
model. JTree extends directly from JComponent and represent the visual side of any valid

tree structure.
DefaultMutableTreeNode: DefaultMutableTreeNode inherits many of its properties

from the MutableTreeNode and TreeNode interfaces.


Border Layout: Border Layout lays out a container, arranging and resizing its
components to fit in five regions: north, south, east, west and center. Each region may
contain no more than one component, and is identified by a corresponding constant:

NORTH, SOUTH, EAST, WEST and CENTER.


Null Layout: A null layout arranges components in a user-defined position.

2.4.1.2 Software Environment: ANDROID

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.
Android offers a unified approach to application development for mobile devices
which means developers need only develop for Android, and their applications should be able
to run on different devices powered by Android.
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 incremental update, with the primary aim of
improving the user interface, both in terms of functionality and performance.

22

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 version 2.

Features of Android:
Android is a powerful operating system competing with Apple 4GS and supports great
features. Few of them are listed below:
Feature
Beautiful UI
Connectivity

Description
Android OS basic screen provides a beautiful and intuitive user interface.
GSM/EDGE, IDEN, CDMA, EV-DO, UMTS, Bluetooth, Wi-Fi, LTE, NFC

and WiMAX.
Storage
SQLite, a lightweight relational database, is used for data storage purposes.
Media support H.263, H.264, MPEG-4 SP, AMR, AMR-WB, AAC, HE-AAC, AAC 5.1,
Messaging
Web browser

MP3, MIDI, Ogg Vorbis, WAV, JPEG, PNG, GIF, and BMP
SMS and MMS
Based on the open-source WebKit layout engine, coupled with Chrome's V8

Multi-touch

JavaScript engine supporting HTML5 and CSS3.


Android has native support for multi-touch which was initially made

Multi-tasking

available in handsets such as the HTC Hero.


User can jump from one task to another and same time various application

Resizable

can run simultaneously.


Widgets are resizable, so users can expand them to show more content or

widgets
Multi-

shrink them to save space


Supports single direction and bi-directional text.

Language
GCM

Google Cloud Messaging (GCM) is a service that lets developers send short
message data to their users on Android devices, without needing a proprietary

Wi-Fi Direct

sync solution.
A technology that lets apps discover and pair directly, over a high-bandwidth

Android

peer-to-peer connection.
A popular NFC-based technology that lets users instantly share, just by

Beam

touching two NFC-enabled phones together.

Android Applications:
23

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.
This tutorial has been written with an aim to teach you how to develop and package
Android application. We will start from environment setup for Android application
programming and then drill down to look into various aspects of Android applications.

Android Architecture:
Android operating system is a stack of software components which is roughly divided
into five sections and four main layers as shown below in the architecture diagram.

24

3.5 Platform Dependency

Linux kernel:
At the bottom of the layers is Linux - Linux 2.6 with approximately 115 patches. This
provides basic system functionality like process management, memory management, device
management like camera, keypad, display etc. Also, the kernel handles all the things that
Linux is really good at such as networking and a vast array of device drivers, which take the
pain out of interfacing to peripheral hardware.

Libraries:
On top of Linux kernel there is a set of libraries including open-source Web browser
engine WebKit, well known library libc, SQLite database which is a useful repository for
storage and sharing of application data, libraries to play and record audio and video, SSL
libraries responsible for Internet security etc.

Android Runtime:
25

This is the third section of the architecture and available on the second layer from the
bottom. This section provides a key component called Dalvik Virtual Machine which is a
kind of Java Virtual Machine specially designed and optimized for Android.
The Dalvik VM makes use of Linux core features like memory management and
multi-threading, which is intrinsic in the Java language. The Dalvik VM enables every
Android application to run in its own process, with its own instance of the Dalvik virtual
machine.
The Android runtime also provides a set of core libraries which enable Android
application developers to write Android applications using standard Java programming
language.

Application Framework:
The Application Framework layer provides many higher-level services to applications
in the form of Java classes. Application developers are allowed to make use of these services
in their applications.

Applications & Components:


You will find all the Android application at the top layer. You will write your
application to be installed on this layer only. Examples of such applications are Contacts
Books, Browser, and Games etc.
Application components are the essential building blocks of an Android application.
These

components

are

loosely

coupled

by

the

application

manifest

file AndroidManifest.xml that describes each component of the application and how they
interact.
There are following four main components that can be used within an Android
application:
Components
Activities

Description
They dictate the UI and handle the user interaction to the smart phone
26

screen
They handle background processing associated with an application.

Services
Broadcast
Receivers
Content Providers

They handle communication between Android OS and applications.


They handle data and database management issues.

Activities:
An activity represents a single screen with a user interface. For example, an email

application might have one activity that shows a list of new emails, another activity to
compose an email, and another activity for reading emails. If an application has more than
one activity, then one of them should be marked as the activity that is presented when the
application is launched.
An activity is implemented as a subclass of Activity class as follows:
public class MainActivity extends Activity { }

Services:
A service is a component that runs in the background to perform long-running
operations. For example, a service might play music in the background while the user is in a
different application, or it might fetch data over the network without blocking user
interaction with an activity.
A service is implemented as a subclass of Service class as follows:
public class MyService extends Service {}

Broadcast Receivers:
Broadcast Receivers simply respond to broadcast messages from other applications or
from the system. For example, applications can also initiate broadcasts to let other
applications know that some data has been downloaded to the device and is available for
them to use, so this is broadcast receiver who will intercept this communication and will
initiate appropriate action.
27

A broadcast receiver is implemented as a subclass of BroadcastReceiver class and


each message is broadcasted as an Intent object.
public class MyReceiver extends BroadcastReceiver {}

Content Providers:
A content provider component supplies data from one application to others on
request. Such requests are handled by the methods of the ContentResolver class. The data
may be stored in the file system, the database or somewhere else entirely.
A content provider is implemented as a subclass of ContentProvider class and must
implement a standard set of APIs that enable other applications to perform transactions.
public class MyContentProvider extends ContentProvider {}
We will go through these tags in detail while covering application components in
individual chapters.

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:
Components
Fragments
Views
Layouts

Description
Represents a behavior or a portion of user interface in an Activity.
UI elements that are drawn onscreen including buttons, lists forms etc.
View hierarchies that control screen format and appearance of the

Intents
Resources
Manifest

views.
Messages wiring components together.
External elements, such as strings, constants and drawables pictures.
Configuration files for the application.

2.4.2.Hardware requirements:
The most common set of requirements defined by any operating system or software application
is the physical computter resources,also known as hardware, A hareware requirements list is
28

often accomplished by a hardware compatibility list(HCL),especially in case of operating


systems. An HCL lists tested,compatible and incompatible hardware devices for a particular
operating system or application. The following sub sections discuss the various aspects of
hardware requirements.

Android Virtual Device Manager Configuration:

Processor ARM (armeabi-v7a)


RAM 512MB
Android version Gingerbread 2.3.6
Display Density 240dpi
Application Interface Level 18

2.5.Domain Description:
Data mining involves the use of sophisticated data analysis tools to discover previously
unknown, valid patterns and relationships in large data sets. These tools can include statistical
models, mathematical algorithms, and machine learning methods (algorithms that improve their
performance automatically through experience, such as neural networks or decision trees).
Consequently, data mining consists of more than collecting and managing data, it also includes
analysis and prediction.
Data mining can be performed on data represented in quantitative, textual, or multimedia
forms. Data mining applications can use a variety of parameters to examine the data. They
include association (patterns where one event is connected to another event, such as purchasing a
pen and purchasing paper), sequence or path analysis (patterns where one event leads to another
event, such as the birth of a child and purchasing diapers), classification (identification of new
patterns, such as coincidences between duct tape purchases and plastic sheeting purchases),
clustering (finding and visually documenting groups of previously unknown facts, such as
geographic location and brand preferences), and forecasting (discovering patterns from which
one can make reasonable predictions regarding future activities, such as the prediction that
people who join an athletic club may take exercise classes).

Data Mining Uses:


29

Data mining is used for a variety of purposes in both the private and public sectors.

Industries such as banking, insurance, medicine, and retailing commonly use data mining
to reduce costs, enhance research, and increase sales. For example, the insurance and
banking industries use data mining applications to detect fraud and assist in risk
assessment (e.g., credit scoring).

Using customer data collected over several years, companies can develop models that
predict whether a customer is a good credit risk, or whether an accident claim may be
fraudulent and should be investigated more closely.

The medical community sometimes uses data mining to help predict the effectiveness of a
procedure or medicine.

Pharmaceutical firms use data mining of chemical compounds and genetic material to
help guide research on new treatments for diseases.

Retailers can use information collected through affinity programs (e.g., shoppers, club cards,
frequent flyer points, contests) to assess the effectiveness of product selection and placement
decisions, coupon offers, and which products are often purchased together.

30

3.System Analysis
3.1 Introduction
A system analysis is the process of examining a business situation with the intent of
improving it through better procedures and methods. Software design is a process through which
the requirements are translated into a representation of software. Preliminary design is concerned
with the transformation of requirements into data and software architecture. It must act as a basis
for detailed implementation.
A system analysis is a detailed study of the various operations performed by a system and
their relationships within and outside the system. One aspect of analysis is defining the
boundaries of the system and determining whether a new proposed system should consider other
related items or not.
During analysis various data are collected using the toll like data flow diagrams,
interviews, On-line observations, procedural manuals and questionnaires sensitively to the
subjects being interviewed.

3.2 Software Requirement Specification


Purpose: The main purpose for preparing this document is to give a general insight into the
analysis and requirements of the existing system or situation and for determining the operating
characteristics of the system.
Scope: This Document plays a vital role in the development life cycle (SDLC) and it describes
the complete requirement of the system. It is meant for use by the developers and will be the
basic during testing phase. Any changes made to the requirements in the future will have to go
through formal change approval process.

The developer is responsible for:

Developing the system, which meets the SRS and solving all the requirements of the
system?

31

Demonstrating the system and installing the system at client's location after the

acceptance testing is successful.


Submitting the required user manual describing the system interfaces to work on it and

also the documents of the system.


Conducting any user training that might be needed for using the system.

3.3. Feasibility Study


The feasibility of the project is analyzed in this phase and business proposal is put forth
with a very general plan for the project and some cost estimates. During system analysis the
feasibility study of the proposed system is to be carried out. This is to ensure that the proposed
system is not a burden to the company. For feasibility analysis, some understanding of the major
requirements for the system is essential.
Three key considerations involved in the feasibility analysis are

Economical Feasibility

Technical Feasibility

Social Feasibility

3.3.1 Economical Feasibility


This study is carried out to check the economic impact that the system will have on the
organization. The amount of fund that the company can pour into the research and development
of the system is limited. The expenditures must be justified. Thus the developed system as well
within the budget and this was achieved because most of the technologies used are freely
available. Only the customized products had to be purchased.

3.3.2 Technical Feasibility


This study is carried out to check the technical feasibility, that is, the technical requirements
of the system. Any system developed must not have a high demand on the available technical
32

resources. This will lead to high demands on the available technical resources. This will lead to
high demands being placed on the client. The developed system must have a modest
requirement, as only minimal or null changes are required for implementing this system.

3.3.3 Social Feasibility


The aspect of study is to check the level of acceptance of the system by the user. This
includes the process of training the user to use the system efficiently. The user must not feel
threatened by the system, instead must accept it as a necessity. The level of acceptance by the
users solely depends on the methods that are employed to educate the user about the system and
to make him familiar with it. His level of confidence must be raised so that he is also able to
make some constructive criticism, which is welcomed, as he is the final user of the system.

33

4. System Design
4.1 Introduction
It is a simple graphical formalism that can be used to represent a system in terms of the
input data to the system, various processing carried out on these data, and the output data is
generated by the system.

Modules:
1. Student Module.
2. Administrator Module: Is used to update or modify the database.
3. Faculty Module

Definition:
UML is a general-purpose visual modeling language that is used to specify, visualize,
construct, and document the artifacts of the software system.

UML is a language:
It will provide vocabulary and rules for communications and function on conceptual
and physical representation. So it is modeling language.

UML Specifying:
Specifying means building models that are precise, unambiguous and complete. In
particular, the UML address the specification of all the important analysis, design and
implementation decisions that must be made in developing and displaying a software
intensive system.

UML Visualization:
The UML includes both graphical and textual representation. It makes easy to
visualize the system and for better understanding.

34

UML Constructing:

UML models can be directly connected to a variety of programming languages and it


is sufficiently expressive and free from any ambiguity to permit the direct execution of
models.

UML Documenting:
UML provides variety of documents in addition raw executable codes.

Figure 4.1 Modeling a System Architecture using views of UML


The use case view of a system encompasses the use cases that describe the behavior of
the system as seen by its end users, analysts, and testers.
The design view of a system encompasses the classes, interfaces, and collaborations that
form the vocabulary of the problem and its solution.
The process view of a system encompasses the threads and processes that form the
system's concurrency and synchronization mechanisms.
The implementation view of a system encompasses the components and files that are used
35

to assemble and release the physical system.


The deployment view of a system encompasses the nodes that form the system's hardware
topology on which the system executes.

Uses of UML:
The UML is intended primarily for software intensive systems. It has been used
effectively for such domain as

Enterprise Information System


Banking and Financial Services
Telecommunications
Transportation
Defense/Aerosp
Retails
Medical Electronics
Scientific Fields
Distributed Web

Building blocks of UML:


The vocabulary of the UML encompasses 3 kinds of building blocks

Things:
Things are the data abstractions that are first class citizens in a model.

Structural Things
Behavioral Things
Grouping Things
Annotational Things

Relationships:
Relationships tie the things together. Relationships in the UML are

Dependency
36

Association
Generalization
Specialization

4.2.DATA FLOW DIAGRAMS


Data flow diagram is a structure analysis tool that is used for graphical representation of
Data processes through any organization. The data flow approach emphasis on the logic
underlying the system, by using combination of only 4 symbols. It follows a top down approach.
A full description of a system actually consists of set of DFD s , which comprises of various
levels. And initial over view model is exploded lower level diagrams that show additional feature
of the system. Further each process can be broken down into a more detailed DFD. This occurs
repeatedly until sufficient details are described.
DFD symbols
Square:

It defines a source (originator) or destination of system data.


Arrow:
It indicates data flow-data in motion. It is a pipeline through which information flows.
Circle or Bubble:

It represents a process that transforms incoming data flow(s) into outgoing data flow(s).
Open Rectangle:

37

It is a data store-data at rest, or a temporary repository of data. Here I am giving only


the Data Flow Diagram:
Subjects
Post
message

login

Student

Database

Faculty

Log out

UML Diagrams:

38

A diagram is the graphical presentation of a set of elements, most often rendered as a


connected graph of vertices (things) and arcs (relationships).

4.3 UML Diagrams


Diagram is graphical representation of elements.UML diagrams can be classified into two
types

Structural Diagrams

Class Diagram
Component Diagram
Deployment Diagram
Object Diagram

Behavioral Diagrams

Usecase Diagram
Sequence Diagram
Collaboration Diagram
State Chart Diagram

4.3.1 Use case Diagram:


39

A use case is a set of scenarios that describing an interaction between a user and a
system. A use case diagram displays the relationship among actors and use cases. The two main
components of a use case diagram are use cases and actors. An actor is represents a user or
another system that will interact with the system you are modeling. A use case is an external
view of the system that represents some action the user might perform in order to complete a
task.
The primary goals of Use Case diagrams include:

Providing a high-level view of what the system does


Identifying the users ("actors") of the system
Determining areas needing human-computer interfaces

Figure 4.3.1 Use-case diagrams for library


40

4.3.2 Class Diagram:


Class diagrams are widely used to describe the types of objects in a system and their
relationships. Class diagrams model class structure and contents using design elements such as
classes, packages and objects. Class diagrams describe three different perspectives when
designing a system, conceptual, specification, and implementation. These perspectives become
evident as the diagram is created and help solidify the design. It is the main building block of any
object oriented solution. The Class diagram is one of the most widely used diagrams from the
UML specification. Part of the popularity of Class diagrams stems from the fact that many
CASE tools, such as Rational XDE, will auto-generate code in a variety of languages, These
tools can synchronize models and code, reducing your workload, and can also generate Class
diagrams from object-oriented code, for those "code-then-design" maintenance projects.

41

Figure 4.3.2 Class diagram

4.3.3 Sequence Diagram:


Sequence diagrams in UML shows how object interact with each other and the order
those interactions occur. Its important to note that they show the interactions for a particular
scenario. The processes are represented vertically and interactions are show as arrows. Sequence
diagrams document the interactions between classes to achieve a result, such as a use case.
Because UML is designed for object-oriented programming, these communications between
classes are known as messages. The Sequence diagram lists objects horizontally, and time
vertically, and models these messages over time.

42

Figure 4.3.3 Sequence diagram for student-faculty

4.3.4 Activity Diagram:


Activity diagrams describe the workflow behavior of a system. Activity diagrams are
similar to state diagrams because activities are the state of doing something. The diagrams
43

describe the state of activities by showing the sequence of activities performed. Activity
diagrams can show activities that are conditional or parallel. Activity diagrams should be used in
conjunction with other modeling techniques such as interaction diagrams and state diagrams.
Activity Diagrams are also useful for: analyzing a use case by describing what actions needs to
take place and when they should occur; describing a complicated sequential algorithm;

Activity diagram for Library

4.3.5. State chart Diagram:


These diagrams render the states and responses of a class participating in behavoiur,and
the life cycle of an object.These diagrams describe the behaviour of a class in response to
external stimuli

44

State chart diagram for Library

4.3.6. Component Diagram:


In the Unified Modeling Language, a component diagram depicts how components are
wired together to form larger components and or software systems. They are used to illustrate the
structure of arbitrarily complex systems
A component is something required to execute a stereotype function. Examples of
stereotypes in components include executables, documents, database tables, files, and library
files.
Components are wired together by using an assembly connector to connect the
required interface of one component with the provided interface of another component. This
illustrates the service consumer - service provider relationship between the two components.
An assembly connector is a "connector between two components that defines that one
component provides the services that another component requires. An assembly connector is a
connector that is defined from a required interface or port to a provided interface or port."
When using a component diagram to show the internal structure of a component, the
provided and required interfaces of the encompassing component can delegate to the
45

corresponding interfaces of the contained components. A delegation connector is a "connector


that links the external contract of a component (as specified by its ports) to the internal
realization of that behavior by the components parts."

46

4.3.7 Deployment Diagram:


A deployment diagram in the Unified Modeling Language models
the physical deployment of artifacts on nodes. To describe a web site, for example, a deployment
diagram would show what hardware components ("nodes") exist (e.g., a web server, an
application server, and a database server), what software components ("artifacts") run on each
node (e.g., web application, database), and how the different pieces are connected (e.g. JDBC,
REST, RMI).
The nodes appear as boxes, and the artifacts allocated to each node appear as rectangles within
the boxes. Nodes may have subnodes, which appear as nested boxes. A single node in a
deployment diagram may conceptually represent multiple physical nodes, such as a cluster of
database servers.
There are two types of Nodes.
1. Device Node
2. Execution Environment Node
Device nodes are physically computing resources with processing memory and services to
execute software, such as typical computer or mobile phones. An execution environment node
(EEN) is a software computing resource that runs within an outer node and which itself provides
a service to host and execute other executable software elements.

47

4.3.8 Collaboration diagram:A communication diagram in the Unified Modeling Language (UML) 2.0 is a simplified
version of the UML 1.x collaboration diagram.
UML has four types of interaction diagrams:

Sequence diagram

Communication diagram

Interaction overview diagram

Timing diagram

A Communication diagram models the interactions between objects or parts in terms of


sequenced messages. Communication diagrams represent a combination of information taken
from Class, Sequence, and Use Case Diagrams describing both the static structure and dynamic
behavior of a system.

48

Communication diagrams show a lot of the same information as sequence diagrams, but because
of how the information is presented, some of it is easier to find in one diagram than the other.
Communication diagrams show which elements each one interacts with better, but sequence
diagrams show the order in which the interactions take place more clearly.

49

5. Implementation
5.1 Introduction
Implementation is the stage of the project when the theoretical design is turned out into a
working system. Thus it can be considered to be the most critical stage in achieving a successful
new system and in giving the user, confidence that the new system will work and be effective.
The implementation stage involves careful planning, investigation of the existing system
and its constraints on implementation, designing of methods to achieve changeover and
evaluation of changeover methods.
The implementation part is the most important phase of the project. In this phase, we
code the entire project in the chosen software according to the design laid during the previous
phase. The code has to be in such a way that the user requirements are satisfied and also not
complicated for the user i.e., the user interface or GUI has to be easy to navigate. The code
should be efficient in all terms like space, easy to update, etc. In this manner, we can complete
the coding part of the project and later it can be sent for testing before being delivered to the
customer.

5.2 Sample data


50

DATABASE SUPPORT:

Database schema browsing to see the tables, views, and stored procedures defined
in a database

Database schema editing using wizards

Data view to see data stored in tables

SQL and DDL command execution to help you write and execute more
complicated SQL or DDL commands

Migration of table definitions across databases from different vendors

Works with databases, such as MySQL, PostgreSQL, Oracle, IBM DB2,


Microsoft SQL Server, PointBase, Sybase, Informix, Cloudscape, Derby, and
more

The Net Beans IDE also provides full-featured refactoring tools, which allow you to
rename and move classes, fields, and methods, as well as change method parameters. In addition,
you get a debugger and an Ant-based project system.

DATABASE DESCRIPTION:
The data pertaining to proposed system is voluminous hence a careful design of the
database must proceed before storing the data in the database.
A database management system provides flexibility in the storage and retrieval of data.
The DBMS is a bridge between the application program, which determines what data are needed
and how they are processed, and the operating system of the computer, which is responsible for
placing data on the magnetic storage devices.

Characteristics:

Represents complex relationships between data.

Keeps control on data redundancy.

Enforces data access authorization.

Has automatic intelligent backup and recovery procedure for data.

Database Administrator:
51

A database administrator is a block of code loaded into memory, which organizes all
information (database) between the users.
The DBA takes care of the following things:

Updating database.

Retrieving the data

Accepting the queries

Enforces security

Optimizing queries

NORMALIZATION:
First Normal Form:
A relation R is in first normal form if and only if all underlying domains contains atomic
values only.

Second Normal Form:


A relation R is in second normal form if and only if it is in first normal form and every
non-key attribute is fully dependent on primary key.

Third Normal Form:


A relation R is in third normal form if and only if t is in second normal form and every
non-key attribute is non-transitively dependent on primary key.

Boyce-Codd Normal Form:


A relation R is in Boyce-Codd form if and only if every determinate is a candidate key.
Normalization reduces redundancy. Redundancy is the unnecessary reputation of data. It can
cause problems with storage and retrieval of data. Full-normalized record consists of a primary
key, which identifies the entity and empty set of attribute.

52

DATA DICTIONARY:
A data dictionary is a file that contains metadata i.e. data about data. This file is
consulates before actual data are read or modified in the database system. It is also known as
system catalogue. Among the types of information that the system must store all the below items.

Name of the relations

Names of the attributes of each relation

Domains and lengths of attributes

5.3.Sample Code
HomeActivity.java
package in.ganesh.model;
import in.ganesh.adapters.SubjectAdapter;
import in.ganesh.controllers.FacultyController;
import in.ganesh.controllers.StudentController;
import in.ganesh.entities.SubjectEntity;
import in.ganesh.util.SessionManagement;
import java.util.List;
import android.app.Activity;
import android.content.Context;
import android.content.Intent;
import android.content.SharedPreferences;
import android.content.SharedPreferences.Editor;
import android.os.Bundle;
import android.view.Menu;
import android.view.MenuItem;
import android.view.View;
53

import android.widget.AdapterView;
import android.widget.AdapterView.OnItemClickListener;
import android.widget.ListView;

public class HomeActivity extends Activity{

private SubjectAdapter adapter;


private List<SubjectEntity> subjectsList;
private ListView listView;
int roleType;
int id;
String name;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_home);
initComponents();
}

private void roleType() {


SharedPreferences
sharedPreferences
getSharedPreferences(SessionManagement.FILENAME, Context.MODE_PRIVATE);

if(sharedPreferences.contains(SessionManagement.ROLE)) {
roleType = sharedPreferences.getInt(SessionManagement.ROLE, -1);
id = sharedPreferences.getInt(SessionManagement.ID, -1);
name = sharedPreferences.getString(SessionManagement.NAME, "no
name");
}
54

private void initComponents() {


roleType();
if(roleType == 1) {
subjectsList = new StudentController(this).getSubjectEntity(id);
adapter = new SubjectAdapter(this, subjectsList);
initListView(adapter);
} else if(roleType == 2) {
subjectsList = new FacultyController(this).getSubjectEntity(id);
adapter = new SubjectAdapter(this, subjectsList);
initListView(adapter);
}

private void initListView(SubjectAdapter adapter) {


listView = (ListView) findViewById(R.id.listView);
listView.setAdapter(adapter);
listView.setOnItemClickListener(new OnItemClickListener() {

@Override
public void onItemClick(AdapterView<?> arg0, View arg1, int position,
long arg3) {
Intent

intent

new

Intent(HomeActivity.this,

MessageActivity.class);
intent.putExtra("id", subjectsList.get(position).getId());
55

intent.putExtra("name", name + "-"+(roleType == 1 ? "Student" :


"Faculty")+"");
startActivity(intent);
}

});
}

@Override
public boolean onCreateOptionsMenu(Menu menu) {
// Inflate the menu; this adds items to the action bar if it is present.
getMenuInflater().inflate(R.menu.main, menu);
return true;
}

@Override
public boolean onOptionsItemSelected(MenuItem item) {
switch(item.getItemId()) {
case R.id.exit : exit(); break;
case R.id.logout : logout();break;
}
return false;
}

56

public void logout() {


SharedPreferences
sharedPreferences
getSharedPreferences(SessionManagement.FILENAME, Context.MODE_PRIVATE);
Editor editor = sharedPreferences.edit();
editor.clear();
editor.commit();
moveTaskToBack(true);
HomeActivity.this.finish();
}

public void exit() {


moveTaskToBack(true);
HomeActivity.this.finish();
}}

MainActivity.java
package in.ganesh.model;

import in.ganesh.controllers.FacultyController;

import in.ganesh.controllers.StudentController;

import in.ganesh.entities.FacultyEntity;

import in.ganesh.entities.StudentEntity;
57

import in.ganesh.util.SessionManagement;

import in.ganesh.util.ToastMessages;

import android.app.Activity;

import android.content.Context;

import android.content.Intent;

import android.content.SharedPreferences;

import android.content.SharedPreferences.Editor;

import android.os.Bundle;

import android.view.View;

import android.view.View.OnClickListener;

import android.widget.Button;

import android.widget.EditText;
import android.widget.RadioGroup;
import android.widget.RadioGroup.OnCheckedChangeListener;

58

public class MainActivity extends Activity


{

private EditText username;

private EditText password;

private RadioGroup roles;

private int roleType;

private ToastMessages messages = new ToastMessages(this);


private SharedPreferences sharedPreferences;

private Button loginButton;

@Override
protected void onCreate(Bundle savedInstanceState)
{

super.onCreate(savedInstanceState);

setContentView(R.layout.activity_main);

59

initComponents();

private void initComponents()


{

username = (EditText) findViewById(R.id.username);

password = (EditText) findViewById(R.id.password);

roles = (RadioGroup) findViewById(R.id.radioGroup);

roles.setOnCheckedChangeListener(new OnCheckedChangeListener()
{

@Override
public void onCheckedChanged(RadioGroup arg0, int arg1)
{

switch(arg1)
{

case R.id.student : roleType = 1;

60

break;

case R.id.faculty : roleType = 2;


break;

}
}

);

loginButton = (Button) findViewById(R.id.loginButton);

loginButton.setOnClickListener(new OnClickListener()
{

@Overridepublic void Click(View arg0)


{

authenticateUser();

61

});
}

@Override
pro+tected void onResume()
{

sharedPreferences
=
Context.MODE_PRIVATE);

getSharedPreferences(SessionManagement.FILENAME,

if(sharedPreferences.contains(SessionManagement.ID)
sharedPreferences.contains(SessionManagement.NAME))
{

Intent intent = new Intent(this, HomeActivity.class);

startActivity(intent);

super.onResume();

public void successfulLogin(String username, int id)


{

62

&&

Editor editor = sharedPreferences.edit();

editor.putInt(SessionManagement.ID, id);

editor.putString(SessionManagement.NAME, username);

editor.putInt(SessionManagement.ROLE, roleType);

editor.commit();

Intent intent = new Intent(this, HomeActivity.class);

startActivity(intent);

public void authenticateUser()


{

if(roleType == 1)
{

StudentEntity
entity
=
StudentController(this).loginSuccessful(username.getText().toString(),
password.getText().toString()) ;

63

new

if(entity != null)
{

successfulLogin(entity.getName(), entity.getId());

}
else
{

messages.showMessage("Login Failed.. Please Try again...!");

}
else
{

FacultyEntity
entity
=
FacultyController(this).loginSuccessful(username.getText().toString(),
password.getText().toString()) ;

if(entity != null)
{

successfulLogin(entity.getName(), entity.getId());

}
else
64

new

messages.showMessage("Login Failed.. Please Try again...!");

}
}
}
}

MessageActivity.java
package in.ganesh.model;

import in.ganesh.adapters.MessageAdapter;
import in.ganesh.controllers.MessageController;
import in.ganesh.entities.MessageEntity;
import in.ganesh.util.ToastMessages;
import in.ganesh.util.WebResource;

import java.util.ArrayList;
import java.util.List;
import java.util.Timer;
import java.util.TimerTask;

65

import org.apache.http.HttpEntity;
import org.apache.http.HttpResponse;
import org.apache.http.client.HttpClient;
import org.apache.http.client.methods.HttpGet;
import org.apache.http.impl.client.DefaultHttpClient;
import org.apache.http.util.EntityUtils;
import org.json.JSONArray;
import org.json.JSONObject;

import android.app.Activity;
import android.app.ProgressDialog;
import android.content.Context;
import android.os.AsyncTask;
import android.os.Bundle;
import android.util.Log;
import android.view.Menu;
import android.view.MenuItem;
import android.view.View;
import android.view.View.OnClickListener;
import android.widget.Button;
import android.widget.EditText;

66

import android.widget.ListView;

public class MessageActivity extends Activity {


private int subjectId;
private String name;
private ToastMessages toast = new ToastMessages(this);
private Button sendButton;
private EditText message;
private MessageController controller = new MessageController(this);
private ListView listView;
private MessageAdapter adapter;
private List<MessageEntity> list;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_messages);
initSubjectId();
initList();

67

private void initSubjectId() {


Bundle extras = getIntent().getExtras();
name = extras.getString("name");
subjectId = extras.getInt("id");
message = (EditText) findViewById(R.id.sendMessage);
sendButton = (Button) findViewById(R.id.button);
sendButton.setOnClickListener(new OnClickListener() {

@Override
public void onClick(View arg0) {
sendMessage();

}
});

private void initList() {


listView = (ListView) findViewById(R.id.messages);
list = controller.getMessages(subjectId);
adapter = new MessageAdapter(this, list);

68

listView.setAdapter(adapter);
new getMessages(this).execute();
}

private void setTimer() {

List<MessageEntity> newList = controller.getMessages(subjectId, getLastId());


for(MessageEntity en: newList) {
list.add(en);
}
adapter.notifyDataSetChanged();
}

@Override
public boolean onCreateOptionsMenu(Menu menu) {
// Inflate the menu; this adds items to the action bar if it is present.
getMenuInflater().inflate(R.menu.message, menu);
return true;

69

@Override
public boolean onOptionsItemSelected(MenuItem item) {
switch (item.getItemId()) {
case R.id.refresh : setTimer(); break;
}
return super.onOptionsItemSelected(item);
}

private int getLastId() {


MessageEntity entity = list.get(list.size()-1);
return entity.getId();
}

public void sendMessage() {


if (message.getText().toString().length() > 0) {
if (controller.sendMessage(subjectId, message.getText().toString(),
name)) {
toast.showMessage("Message Sent.. Successfully..!");

70

} else {
toast.showMessage("Message Sending Failed");
}
} else {
toast.showMessage("Blank Message cannot be sent");
}
}

public class getMessages extends AsyncTask<String, Void, List<MessageEntity>> {


private Context context;
private ProgressDialog dialog;
private List<MessageEntity> newList = new ArrayList<MessageEntity>();
public getMessages(Context context) {
this.context= context;
}

@Override
protected void onPreExecute() {
super.onPreExecute();
dialog = new ProgressDialog(context);

71

dialog.setProgressStyle(ProgressDialog.STYLE_SPINNER);
dialog.setMessage("Loading");
dialog.show();

@Override
protected List<MessageEntity> doInBackground(String... params) {
try {
Timer timer = new Timer();

timer.schedule(new TimerTask() {

@Override
public void run() {
newList = getList();

}
}, 1, 1000);

72

return newList;
} catch (Exception ex) {
Log.e("Error", ex.getMessage());
return null;
}
}

private List<MessageEntity> getList() {


try {
Log.e("Control", "Control came here");
HttpClient client = new DefaultHttpClient();
HttpGet

get

HttpGet(WebResource.GET_NEWMESSAGE+"/"+subjectId+"/"+getLastId());
HttpResponse response = client.execute(get);
int statusCode = response.getStatusLine().getStatusCode();
Log.i("Status Code", statusCode+"");
if(statusCode == 200) {
HttpEntity entity = response.getEntity();
String data = EntityUtils.toString(entity);
if(data != null) {
JSONArray array = new JSONArray(data);

73

new

List<MessageEntity>

list

new

ArrayList<MessageEntity>();
for(int i = 0; i < array.length(); i++) {
JSONObject

object

array.getJSONObject(i);
MessageEntity ent = new MessageEntity();
ent.setId(object.getInt("id"));
ent.setDate(object.getString("dateFormat"));
ent.setFrom(object.getString("person"));

ent.setMessage(object.getString("message"));
ent.setTime(object.getString("time"));
ent.setSubjectId(object.getInt("subject"));
list.add(ent);
}
return list;
} else {
Log.e("Data is not found", "Not Data");
return new ArrayList<MessageEntity>();

}
} else {

74

Log.e("Status

COde

is

not

200",

"+statusCode);
return new ArrayList<MessageEntity>();
}
} catch (Exception ex) {
Log.e("Exception ", ex.getMessage());
return null;
}
}

@Override
protected void onPostExecute(List<MessageEntity> result) {
dialog.dismiss();
if(result != null) {
for(MessageEntity entity : result) {
list.add(entity);
}
Log.i("added", result.size()+"");
adapter.notifyDataSetChanged(); }
}

}
75

"staus

code

6. OUTPUT SCREENS

76

77

78

79

80

81

7. Testing and Validations


7.1 Introduction
Software testing is a critical element of software quality assurance and represents the
ultimate review of specification, design and coding. In fact, testing is the one step in the software
engineering process that could be viewed as destructive rather than constructive. A strategy for
software testing integrates software test case design methods into a well-planned series of steps
that result in the successful construction of software. Testing is the set of activities that can be
planned in advance and conducted systematically. The underlying motivation of program testing
is to affirm software quality with methods that can economically and effectively apply to both
strategic to both large and small-scale systems.
The purpose of testing is to discover errors. Testing is the process of trying to discover
every conceivable fault or weakness in a work product. It provides a way to check the
functionality of components, sub assemblies, assemblies and/or a finished product. It is the
process of exercising software with the intent of ensuring that the Software system meets its
requirements and user expectations and does not fail in an unacceptable manner. There are
various types of test. Each test type addresses a specific testing requirement.
The following are the Testing Objectives:
82

Testing is a process of executing a program with the intent of finding an error.


A good test has a high probability of finding an as yet undiscovered error.
A successful test is one that uncovers an as yet undiscovered error.

7.2 System Testing and Implementation


The purpose is to exercise the different parts of the module code to detect coding errors.
After this the modules are gradually integrated into subsystems, which are then integrated
themselves too eventually forming the entire system. During integration of module integration
testing is performed. The goal of this is to detect designing errors, while focusing the
interconnection between modules. After the system was put together, system testing is
performed. Here the system is tested against the system requirements to see if all requirements
were met and the system performs as specified by the requirements. Finally accepting testing is
performed to demonstrate to the client for the operation of the system.
For the testing to be successful, proper selection of the test case is essential. There are
two different approaches for selecting test case. The software or the module to be tested is treated
as a black box, and the test cases are decided based on the specifications of the system or
module. For this reason, this form of testing is also called black box testing.
The focus here is on testing the external behavior of the system. In structural testing the
test cases are decided based on the logic of the module to be tested. A common approach here is
to achieve some type of coverage of the statements in the code. The two forms of testing are
complementary: one tests the external behavior, the other tests the internal structure. Often
structural testing is used for lower levels of testing, while functional testing is used for higher
levels.
Testing is an extremely critical and time-consuming activity. It requires proper planning
of the overall testing process. Frequently the testing process starts with the test plan. This plan
identifies all testing related activities that must be performed and specifies the schedule, allocates
the resources, and specifies guidelines for testing. The test plan specifies conditions that should
be tested; different units to be tested, and the manner in which the module will be integrated
together. Then for different test unit, a test case specification document is produced, which lists
all the different test cases, together with the expected outputs, that will be used for testing.
83

During the testing of the unit the specified test cases are executed and the actual results are
compared with the expected outputs. The final output of the testing phase is the testing report and
the error report, or a set of such reports. Each test report contains a set of test cases and the result
of executing the code with the test cases. The error report describes the errors encountered and
the action taken to remove the error

7.3 Error Messages:


The term error is used in two different ways. Errors refer to the discrepancy between
computed and observed values. That is error refers to the difference between the actual output of
the software and the correct output. In this interpretation, error essentially is a measure of the
difference between the actual and the ideal. Error is also used to refer to human action those
results in the software containing a defect or a fault. This detection is quite general and
encompasses all phases. The consequence of thinking is the belief that the errors largely occur
during Programming, as it is the can see, the errors occur through the development. As we can
see, the errors occur throughout the development process. However, the cost of connecting the
errors of different phases is not the same and depends upon when the error was detected and
corrected. As one would expect the greater the delay in detecting an error after it occurs, the
more expensive it is to correct it. Suppose an error occurs during the requirement phase and it
was corrected after the coding then the cost is higher than correcting it in the requirements phase
itself. If there was error in the requirements phase that error will affect the design and coding
also. To correct the error after coding is done require both the design and the code to be changed
there by increasing the cost of correction.
The main moral of this section is that we should attempt to detect the errors that occur in
a phase during the phase itself should not wait until testing to detect errors. This is not often
practiced. In reality, sometimes testing is the sole point where errors are detected. Besides the
cost factor, reliance on testing as a primary source for error detection and correction should be a
continuous process that is done throughout the software development. In terms of the
development phase, what this means is that we should try to validate each phase before starting
the next.

7.4 Testing Techniques


84

Testing is a process, which reveals errors in the program. It is the major quality
measure employed during software development. During testing, the program is executed with a
set of conditions known as test cases and the output is evaluated to determine whether the
program is performing as expected. In order to make sure that the system does not have errors,
the different levels of testing strategies that are applied at differing phases of software
development are:
Unit Testing: Unit testing involves the design of test cases that validate that the internal program
logic is functioning properly, and that program inputs produce valid outputs. All decision
branches and internal code flow should be validated. It is the testing of individual software units
of the application .it is done after the completion of an individual unit before integration. This is
a structural testing, that relies on knowledge of its construction and is invasive. Unit tests
perform basic tests at component level and test a specific business process, application, and/or
system configuration. Unit tests ensure that each unique path of a business process performs
accurately to the documented specifications and contains clearly defined inputs and expected
results.

7.4.1 Test strategy and approach


Field testing will be performed manually and functional tests will be written in detail.

7.4.2 Test objectives

All field entries must work properly.

Pages must be activated from the identified link.

The entry screen, messages and responses must not be delayed.

Features to be tested

Verify that the entries are of the correct format

No duplicate entries should be allowed

All links should take the user to the correct page.

Each module can be tested using the following two strategies:


Black Box Testing: Black Box Testing is testing the software without any knowledge of the
inner workings, structure or language of the module being tested. Black box tests, as most other
85

kinds of tests, must be written from a definitive source document, such as specification or
requirements document, such as specification or requirements document. It is a testing in which
the software under test is treated, as a black box .you cannot see into it. The test provides
inputs and responds to outputs without considering how the software works.
Incorrect or missing functions

Interface errors

Errors in data structure or external database access

Performance errors

Initialization and termination errors.

In this testing only the output is checked for correctness. The logical flow of the data is not
checked.
White Box Testing: In this the test cases are generated on the logic of each module by drawing
flow graphs of that module and logical decisions are tested on all the cases. It has been uses to
generate the test cases in the following cases:

Guarantee that all independent paths have been executed.

Execute all logical decisions on their true and false sides.

Execute all loops at their boundaries and within their operational

Execute internal data structures to ensure their validity.

Integration Testing: Integration testing ensures that software and subsystems work together as a
whole. It tests the interface of all the modules to make sure that the modules behave properly
when integrated together.
Integration tests are designed to test integrated software components to determine
if they actually run as one program. Testing is event driven and is more concerned with the basic
outcome of screens or fields. Integration tests demonstrate that although the components were
individually satisfaction, as shown by successfully unit testing, the combination of components is
correct and consistent. Integration testing is specifically aimed at
arise from the combination of components.
86

exposing the problems that

7.4.3 Test Results: All the test cases mentioned above passed successfully. No defects
encountered.
System Testing: The purpose of testing is to discover errors. Testing is the process of trying to
discover every conceivable fault or weakness in a work product. It provides a way to check the
functionality of components, sub assemblies, assemblies and/or a finished product. It is the
process of exercising software with the intent of ensuring that the Software system meets its
requirements and user expectations and does not fail in an unacceptable manner. There are
various types of test. Each test type addresses a specific testing requirement.
Functional test: Functional tests provide systematic demonstrations that functions tested are
available as specified by the business and technical requirements, system documentation, and
user manuals.
Functional testing is centered on the following items:
Valid Input

: identified classes of valid input must be accepted.

Invalid Input

: identified classes of invalid input must be rejected.

Functions

: identified functions must be exercised.

Output

: identified classes of application outputs must be exercised.

Systems/Procedures : interfacing systems or procedures must be invoked.


Organization and preparation of functional tests is focused on requirements, key
functions, or special test cases. In addition, systematic coverage pertaining to identify Business
process flows; data fields, predefined processes, and successive processes must be considered for
testing. Before functional testing is complete, additional tests are identified and the effective
value of current tests is determined.
Acceptance Testing: It is a pre-delivery testing in which entire system is tested at client's site on
real world data to find errors.
Test Results: All the test cases mentioned above passed successfully. No defects encountered.

87

Validation Testing: The system has been tested and implemented successfully and thus ensured
that all the requirements as listed in the software requirements specification are completely
fulfilled. In case of erroneous input corresponding error messages are displayed.
Compilation Testing: It was a good idea to do our stress testing early on, because it gave us
time to fix some of the unexpected deadlocks and stability problems that only occurred when
components were exposed to very high transaction volumes.
Execution Testing: This program was successfully loaded and executed. Because of good
programming there was no execution error.
Output Testing: The successful output screens are placed in the output screens section

7.5 Test cases


Cases

Test component

Expected output

88

Evaluated output

8. CONCLUSION
In this project we were developed an android application which is useful to students who
can share doubts easily. This android application is mainly developing for online
interacion about student and faculty.In this app every student and faculty has its own
username and password for logon to the application.Faculty In this app student can post
his doubts corresponding to subject and branch.At the same time faculty can give answers
to their doubts corresponding to his assigned subjects.This app is mainly developing for
specifc college.The main advantage of this app is student and faculty can download this
app and make interaction and share the ideas.

9. BIBLOGRAPHY
89

TEXTBOOKS:
1. Java complete reference, Herbert schield,7th edition, Mc. Graw hill.
2. The definitive guide to SQLite, Mike Owens.
3. The Unified Modeling Language Reference Manual, James Rumbaugh, 2nd
edition.
4. Expert Android, by Satya Komatineni, Dave MacLean ,Dave MacLean

REFERENCES:
1. www.sun.com
2. www.android.com
3. www.developers.android.com
4. www.SQLite.com

10. USER MANUAL

After downloading and installing STUDENT-FACULTY application from play store, the
user can find the icon of this application.
90

The user needs to touch the icon of STUDENT-FACULTY application to open this

application.
After opening this application the user will get the home page which contains some

buttons named as USERNAME AND PASSORD


If the student is a registered user he can login to his account by giving the username and

password..
After logging into the account, you can see your subjects page. And then click on the

subjects which you have doubt.


After clicking on the subject ,text area will open and you can post messages.
The above function will applicable to faculty.
After all this process he can close the app by clicking on the exit button.

91

Das könnte Ihnen auch gefallen