Académique Documents
Professionnel Documents
Culture Documents
Submitted In
Partial fulfillment of the requirement for the degree of
Computer Science and Engineering
Submitted by
Akshay Sukhani
14ESNCS003
1.2 Laboratory
1.2.1 Presentation
PURPOSE
This app have been carried out to satisfy customer needs as well
as exploiting the opportunities of new technologies.
METHODOLOGY
1. HARDWARE REQUIREMENTS
Android 2.2.3 phone or any device.
2. SOFTWARE REQUIREMENTS
OPERATING SYSTEM : Android 2.2.3 and above
PLATFORM : Windows 7 and above with
Android Studio
CODING : Java
DESIGNING : XML
Work Plan:-
I. Android.
User friendly.
Any literate can work upon this application.
Ease of use encourages users to take the advantage of
technology to keep track of student records.
Any android phone user can use this application.
Technical Environment
(Technologies)
2.1 Android
2.1.2 Specifications:
Architecture:
Competitors
Market share
Applications
- Google applications
-Widgets
Multitasking
SDK
View:
Xml:
Here is an example:
<? xml version="1.0" encoding="utf-8"?>
<LinearLayout
xmlns:android=http://schemas.android.com/apk/res/android
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:orientation="vertical" >
<TextView android:id="@+id/text"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Hello, I am a TextView" />
<Button android:id="@+id/button"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Hello, I am a Button" />
</LinearLayout>
Intent:
Content Providers:
Android Manifest:
A fragment has its own layout and its own behaviour with
its own life cycle callbacksYou can add or remove
fragments in an activity while the activity is running.You
can combine multiple fragments in a single activity to
build a multi-plane UI.A fragment can be used in multiple
activities.Fragment life cycle is closely related to the life
cycle of its host activity which means when the activity is
paused, all the fragments available in the activity will also
be stopped.A fragment can implement a behaviour that
has no user interface component.Fragments were added
to the Android API in Honeycomb version of Android
which API version 11.
You create fragments by extending Fragment class and You
can insert a fragment into your activity layout by declaring the
fragment in the activity's layout file, as
a <fragment> element.
Prior to fragment introduction, we had a limitation because we
can show only a single activity on the screen at one given point
in time. So we were not able to divide device screen and
control different parts separately. But with the introduction of
fragment we got more flexibility and removed the limitation of
having a single activity on the screen at a time. Now we can
have a single activity but each activity can comprise of
multiple fragments which will have their own layout, events
and complete life cycle.
Menu:
Services:
A service is started when an application component, such as an
activity, starts it by calling startService(). Once started,
aservice can run in the background indefinitely, even if the
component that started it is destroyed. A service is bound when
an application component binds to it by calling bindService().
Components:
package com.example.smngsystem;
import android.os.Bundle;
import android.os.Handler;
import android.app.Activity;
import android.content.Intent;
import android.view.Menu;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_splash);
/*
* Showing splash screen with a timer. This will be
useful when you
* want to show case your app logo / company
*/
@Override
public void run() {
// This method will be executed once the timer is
over
// Start your app main activity
@Override
public boolean onCreateOptionsMenu(Menu menu) {
// Inflate the menu; this adds items to the action bar
if it is present.
getMenuInflater().inflate(R.menu.splash, menu);
return true;
}
}
MainActivity1.java
package com.example.smngsystem;
import android.os.Bundle;
import android.app.Activity;
import android.content.Intent;
import android.view.Menu;
import android.view.View;
import android.view.View.OnClickListener;
import android.widget.Button;
import android.widget.EditText;
import android.widget.Toast;
@Override
protected void onCreate(Bundle
savedInstanceState)
{
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main_activity1);
btn=(Button)findViewById(R.id.button1);
edtname=(EditText)findViewById(R.id.editText1);
edtpwd=(EditText)findViewById(R.id.editText2);
btn.setOnClickListener(new OnClickListener()
{
@Override
public void onClick(View arg0) {
// TODO Auto-generated method
stub
if(edtname.getText().toString().equals("admin") &&
edtpwd.getText().toString().equals("admin"))
{Intent intent=new
Intent(MainActivity1.this,MainActivity.class);
startActivity(intent);}
else
Toast.makeText(getApplicationContext(), "Wrong
Credentials",Toast.LENGTH_SHORT).show();
}
});
}
@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_activity1,
menu);
return true;
}
MainActivity.java
package com.example.smngsystem;
import android.os.Bundle;
import android.app.Activity;
import android.app.AlertDialog.Builder;
import android.content.Context;
import android.database.Cursor;
import android.database.sqlite.SQLiteDatabase;
import android.view.Menu;
import android.view.View;
import android.view.View.OnClickListener;
import android.widget.Button;
import android.widget.EditText;
public class MainActivity extends Activity {
EditText ename,eroll_no,emarks,etest_no,emob_no;
Button add,view,viewall,Show1,delete,modify;
SQLiteDatabase db;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
ename=(EditText)findViewById(R.id.name);
eroll_no=(EditText)findViewById(R.id.roll_no);
emarks=(EditText)findViewById(R.id.marks);
etest_no=(EditText)findViewById(R.id.test_no);
emob_no=(EditText)findViewById(R.id.mob_no);
add=(Button)findViewById(R.id.addbtn);
view=(Button)findViewById(R.id.viewbtn);
viewall=(Button)findViewById(R.id.viewallbtn);
delete=(Button)findViewById(R.id.deletebtn);
modify=(Button)findViewById(R.id.modifybtn);
db=openOrCreateDatabase("Student_manage",
Context.MODE_PRIVATE, null);
db.execSQL("CREATE TABLE IF NOT EXISTS
student(rollno INTEGER,name VARCHAR,marks
INTEGER,testno INTEGER,mobileno INTEGER);");
add.setOnClickListener(new OnClickListener() {
@Override
public void onClick(View v) {
// TODO Auto-generated method stub
if(eroll_no.getText().toString().trim().length()==0||
ename.getText().toString().trim().length()==0||
emarks.getText().toString().trim().length()==0)
{
showMessage("Error", "Please
enter all values");
return;
}
"','"+emarks.getText()+"','"+etest_no.getText()+"','"+emob_no
.getText()+"');");
showMessage("Success", "Record added successfully");
clearText();
}
});
delete.setOnClickListener(new OnClickListener() {
@Override
public void onClick(View v) {
// TODO Auto-generated method stub
if(eroll_no.getText().toString().trim().length()==0)
{
showMessage("Error", "Please enter Rollno");
return;
}
if(c.moveToFirst())
view.setOnClickListener(new OnClickListener() {
@Override
public void onClick(View v) {
// TODO Auto-generated method stub
if(eroll_no.getText().toString().trim().length()==0)
{
showMessage("Error", "Please enter Rollno");
return;
}
buffer1.append("Name:
"+c.getString(1)+"\n");
buffer1.append("Marks:
"+c.getString(2)+"\n");
buffer1.append("Test No.:
"+c.getString(3)+"\n");
buffer1.append("Mobile
No.:"+c.getString(4)+"\n\n");
showMessage("Student Details",
buffer1.toString());
clearText();
}
else
{
showMessage("Error", "Invalid Rollno");
clearText();
}
}
});
viewall.setOnClickListener(new OnClickListener() {
@Override
public void onClick(View v) {
// TODO Auto-generated method stub
Cursor c=db.rawQuery("SELECT * FROM
student", null);
if(c.getCount()==0)
{
showMessage("Error", "No records found");
return;
}
{
buffer.append("Rollno: "+c.getString(0)+"\n");
buffer.append("Name: "+c.getString(1)+"\n");
buffer.append("Marks: "+c.getString(2)+"\n");
buffer.append("Test No.:
"+c.getString(3)+"\n");
buffer.append("Mobile
No.:"+c.getString(4)+"\n\n");
}
showMessage("Student Details", buffer.toString());
}
});
modify.setOnClickListener(new OnClickListener() {
@Override
public void onClick(View v) {
// TODO Auto-generated method stub
if(eroll_no.getText().toString().trim().length()==0)
{
showMessage("Error", "Please enter Rollno");
return;
}
if(c.moveToFirst())
{
db.execSQL("UPDATE student SET
name='"+ename.getText()+"',marks='"+emarks.getText()+
"',testno='"+etest_no.getText()+"',mobileno='"+emob_no
.getText()+"' WHERE rollno='"+eroll_no.getText()+"'");
showMessage("Success", "Record Modified");
}
else
{
showMessage("Error", "Invalid Rollno");
}
clearText();
}
});
@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;
}
}
Activity_splash.xml
<TextView
android:id="@+id/textView1"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentTop="true"
android:textColor="#FFFFFF"
android:textSize="50sp"
android:textStyle="bold"
android:layout_centerHorizontal="true"
android:layout_marginTop="183dp"
android:text="Welcome" />
</RelativeLayout>
Activity_main_activity1.xml
<FrameLayout
xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:background="#eeeeee">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical" >
<ImageView
android:id="@+id/imageView1"
android:layout_width="83dp"
android:layout_height="70dp"
android:layout_marginLeft="140dp"
android:layout_marginTop="120dp"
android:src="@drawable/grab2" />
<EditText
android:id="@+id/editText1"
android:layout_width="220dp"
android:layout_height="50dp"
android:layout_marginTop="20dp"
android:layout_marginLeft="60dp"
android:ems="10"
android:background="#2d3238"
android:textColorHint="#FFFFFF"
android:textColor="#FFFFFF"
android:hint="Username"
android:padding="5dp">
<requestFocus />
</EditText>
<EditText
android:id="@+id/editText2"
android:layout_width="220dp"
android:layout_height="50dp"
android:ems="10"
android:layout_marginLeft="60dp"
android:layout_marginTop="15dp"
android:inputType="textPassword"
android:background="#2d3238"
android:padding="5dp"
android:textColorHint="#FFFFFF"
android:hint="Password"
android:textColor="#FFFFFF"
/>
<requestFocus />
<Button
android:id="@+id/button1"
android:layout_width="180dp"
android:layout_height="50dp"
android:layout_marginTop="30dp"
android:layout_marginLeft="80dp"
android:textStyle="normal"
android:textSize="20sp"
android:textColor="#FFFFFF"
android:text="LOGIN"
android:background="#ea4c89" />
</LinearLayout>
</FrameLayout>
Activity_main.xml
<ScrollView
xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@+id/scrollView1"
android:layout_width="fill_parent"
android:layout_height="fill_parent" >
<FrameLayout
android:layout_width="match_parent"
android:layout_height="486dp"
android:background="#324065">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="759dp"
android:orientation="vertical"
>
<EditText
android:id="@+id/roll_no"
android:layout_width="294dp"
android:layout_height="50dp"
android:layout_marginLeft="12dp"
android:layout_marginTop="50dp"
android:background="#f3f3f3"
android:ems="10"
android:hint="Enter Roll No."
android:paddingLeft="5dp"
android:textColorHint="#000000" />
<EditText
android:id="@+id/name"
android:layout_width="294dp"
android:layout_height="50dp"
android:layout_marginLeft="12dp"
android:layout_marginTop="10dp"
android:background="#f3f3f3"
android:ems="10"
android:hint="Enter Name"
android:paddingLeft="5dp"
android:textColorHint="#000000" />
<EditText
android:id="@+id/marks"
android:layout_width="294dp"
android:layout_height="50dp"
android:layout_marginLeft="12dp"
android:layout_marginTop="10dp"
android:background="#f3f3f3"
android:ems="10"
android:hint="Enter Marks"
android:paddingLeft="5dp"
android:textColorHint="#000000" />
<EditText
android:id="@+id/test_no"
android:layout_width="294dp"
android:layout_height="50dp"
android:layout_marginLeft="12dp"
android:layout_marginTop="10dp"
android:background="#f3f3f3"
android:ems="10"
android:hint="Enter Test No."
android:paddingLeft="5dp"
android:textColorHint="#000000" />
<EditText
android:id="@+id/mob_no"
android:layout_width="294dp"
android:layout_height="50dp"
android:layout_marginLeft="12dp"
android:layout_marginTop="10dp"
android:background="#f3f3f3"
android:ems="10"
android:hint="Enter Mobile No."
android:paddingLeft="5dp"
android:textColorHint="#000000" />
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content" >
<Button
android:id="@+id/addbtn"
android:layout_width="140dp"
android:layout_height="80dp"
android:layout_marginLeft="15dp"
android:layout_marginTop="20dp"
android:textColor="#FFFFFF"
android:textStyle="bold"
android:textSize="20sp"
android:text="Add Record"
android:background="#00a9ac"/>
<Button
android:id="@+id/deletebtn"
android:layout_width="140dp"
android:layout_height="80dp"
android:layout_marginLeft="5dp"
android:layout_marginTop="20dp"
android:textColor="#FFFFFF"
android:textStyle="bold"
android:textSize="20sp"
android:text="Delete Record"
android:background="#ff4b66"/>
</LinearLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content" >
<Button
android:id="@+id/modifybtn"
android:layout_width="140dp"
android:layout_height="80dp"
android:layout_marginLeft="15dp"
android:layout_marginTop="10dp"
android:textColor="#FFFFFF"
android:textStyle="bold"
android:textSize="20sp"
android:text="Modify"
android:background="#eb543b" />
<Button
android:id="@+id/viewbtn"
android:layout_width="140dp"
android:layout_height="80dp"
android:layout_marginLeft="5dp"
android:textColor="#FFFFFF"
android:textStyle="bold"
android:textSize="20sp"
android:layout_marginTop="10dp"
android:text="View Record"
android:background="#ffb246"/>
</LinearLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content" >
<Button
android:id="@+id/viewallbtn"
android:layout_width="140dp"
android:layout_height="80dp"
android:layout_marginLeft="15dp"
android:textColor="#FFFFFF"
android:textSize="20sp"
android:textStyle="bold"
android:layout_marginTop="10dp"
android:text="View all"
android:background="#5ad9a4"/>
</LinearLayout>
</LinearLayout>
</FrameLayout>
</ScrollView>
Snapshots
System Testing
TESTING METHODOLOGY
Unit Testing
System Testing
All logical decisions on their true and false sides have been
exercised. All loops within their boundaries and within
their operational bounds have been executed.