Ad 8213
Ad 8213
Roll no-8213
Android Programming
Submitted by,
Shreya Bhattacharjee
8313
Name :Shreya Bhattacharjee
Roll no-8213
Android Programming
Overview
Attendance Management System app is software developed for daily student
attendance in schools, colleges and institutes. It facilitates to access the
attendance information of a particular student in a particular class. The
information is sorted by the operators, which will be provided by the teacher for
a particular class. This system will also help in evaluating attendance eligibility
criteria of a student.
Attendance Management System app basically has two main modules for
proper functioning:-
First module is admin which has right for creating space for new batch. Any
entry of new faculty, Updating in subject if necessary, and sending notice.
Second module is handled by the user which can be a faulty or an operator.
User has a right of making daily attendance, generating report.
Purpose
The purpose of developing Attendance Management System app is to
computerized the tradition way of taking attendance. Another purpose for
developing this software is to generate the report automatically at the end of
the session or in the between of the session
Features Available
Admin Module
• Add Student.
• Add Faculty.
• Add Teacher.
• View Student.
• View Teacher.
• View Student Attendance.
• View each student’s attendance separately
Name :Shreya Bhattacharjee
Roll no-8213
Android Programming
Teacher Module
• Take attendance and keep them class wise
• Add New student. View each student’s attendance separately
• Edit Student/Attendance later
• Save notes subject wise
• Simple designed interface
CODE :
LOGINACTIVITY.JAVA
package com.android.attendance.activity;
import android.app.Activity;
import android.content.Intent;
import android.graphics.Color;
import android.os.Bundle;
import android.text.TextUtils;
import android.view.Menu;
import android.view.View;
import android.view.View.OnClickListener;
import android.widget.AdapterView;
import android.widget.AdapterView.OnItemSelectedListener;
import android.widget.ArrayAdapter;
import android.widget.Button;
import android.widget.EditText;
import android.widget.Spinner;
import android.widget.TextView;
import android.widget.Toast;
import com.android.attendance.bean.FacultyBean;
import com.android.attendance.context.ApplicationContext;
import com.android.attendance.db.DBAdapter;
import com.example.androidattendancesystem.R;
Button login;
EditText username,password;
Spinner spinnerloginas;
String userrole;
private String[] userRoleString = new String[] { "admin", "faculty"};
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
Name :Shreya Bhattacharjee
Roll no-8213
Android Programming
setContentView(R.layout.login);
login =(Button)findViewById(R.id.buttonlogin);
username=(EditText)findViewById(R.id.editTextusername);
password=(EditText)findViewById(R.id.editTextpassword);
spinnerloginas=(Spinner)findViewById(R.id.spinnerloginas);
spinnerloginas.setOnItemSelectedListener(new OnItemSelectedListener()
{
@Override
public void onItemSelected(AdapterView<?> arg0, View view,
int arg2, long arg3) {
// TODO Auto-generated method stub
((TextView) arg0.getChildAt(0)).setTextColor(Color.WHITE);
userrole =(String) spinnerloginas.getSelectedItem();
@Override
public void onNothingSelected(AdapterView<?> arg0) {
// TODO Auto-generated method stub
}
});
.setDropDownViewResource(android.R.layout.simple_spinner_dropdown_item);
spinnerloginas.setAdapter(adapter_role);
login.setOnClickListener(new OnClickListener() {
@Override
public void onClick(View v) {
// TODO Auto-generated method stub
if(userrole.equals("admin"))
{
if (TextUtils.isEmpty(user_name))
{
username.setError("Invalid User Name");
}
else if(TextUtils.isEmpty(pass_word))
{
password.setError("enter password");
}
else
{
if(user_name.equals("admin") &
pass_word.equals("admin123")){
Intent intent =new
Intent(LoginActivity.this,MenuActivity.class);
startActivity(intent);
Toast.makeText(getApplicationContext(), "Login
Name :Shreya Bhattacharjee
Roll no-8213
Android Programming
successful", Toast.LENGTH_SHORT).show();
}else{
Toast.makeText(getApplicationContext(), "Login
failed", Toast.LENGTH_SHORT).show();
}
}
}
else
{
String user_name = username.getText().toString();
String pass_word = password.getText().toString();
if (TextUtils.isEmpty(user_name))
{
username.setError("Invalid User Name");
}
else if(TextUtils.isEmpty(pass_word))
{
password.setError("enter password");
}
DBAdapter dbAdapter = new DBAdapter(LoginActivity.this);
FacultyBean facultyBean =
dbAdapter.validateFaculty(user_name, pass_word);
if(facultyBean!=null)
{
Intent intent = new
Intent(LoginActivity.this,AddAttandanceSessionActivity.class);
startActivity(intent);
((ApplicationContext)LoginActivity.this.getApplicationContext()).setFaculty
Bean(facultyBean);
Toast.makeText(getApplicationContext(), "Login
successful", Toast.LENGTH_SHORT).show();
}
else
{
Toast.makeText(getApplicationContext(), "Login failed",
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, menu);
return true;
}
Name :Shreya Bhattacharjee
Roll no-8213
Android Programming
ADDATTENDACESESSIONACTIVITY.JAVA
package com.android.attendance.activity;
import android.app.Activity;
import android.content.Intent;
import android.graphics.Color;
import android.os.Bundle;
import android.text.TextUtils;
import android.view.Menu;
import android.view.View;
import android.view.View.OnClickListener;
import android.widget.AdapterView;
import android.widget.AdapterView.OnItemSelectedListener;
import android.widget.ArrayAdapter;
import android.widget.Button;
import android.widget.EditText;
import android.widget.Spinner;
import android.widget.TextView;
import android.widget.Toast;
import com.android.attendance.bean.FacultyBean;
import com.android.attendance.context.ApplicationContext;
import com.android.attendance.db.DBAdapter;
import com.example.androidattendancesystem.R;
Button login;
EditText username,password;
Spinner spinnerloginas;
String userrole;
private String[] userRoleString = new String[] { "admin", "faculty"};
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.login);
login =(Button)findViewById(R.id.buttonlogin);
username=(EditText)findViewById(R.id.editTextusername);
password=(EditText)findViewById(R.id.editTextpassword);
spinnerloginas=(Spinner)findViewById(R.id.spinnerloginas);
spinnerloginas.setOnItemSelectedListener(new OnItemSelectedListener()
{
@Override
public void onItemSelected(AdapterView<?> arg0, View view,
int arg2, long arg3) {
// TODO Auto-generated method stub
((TextView) arg0.getChildAt(0)).setTextColor(Color.WHITE);
userrole =(String) spinnerloginas.getSelectedItem();
Name :Shreya Bhattacharjee
Roll no-8213
Android Programming
@Override
public void onNothingSelected(AdapterView<?> arg0) {
// TODO Auto-generated method stub
}
});
.setDropDownViewResource(android.R.layout.simple_spinner_dropdown_item);
spinnerloginas.setAdapter(adapter_role);
login.setOnClickListener(new OnClickListener() {
@Override
public void onClick(View v) {
// TODO Auto-generated method stub
if(userrole.equals("admin"))
{
if (TextUtils.isEmpty(user_name))
{
username.setError("Invalid User Name");
}
else if(TextUtils.isEmpty(pass_word))
{
password.setError("enter password");
}
else
{
if(user_name.equals("admin") &
pass_word.equals("admin123")){
Intent intent =new
Intent(LoginActivity.this,MenuActivity.class);
startActivity(intent);
Toast.makeText(getApplicationContext(), "Login
successful", Toast.LENGTH_SHORT).show();
}else{
Toast.makeText(getApplicationContext(), "Login
failed", Toast.LENGTH_SHORT).show();
}
}
}
else
{
String user_name = username.getText().toString();
String pass_word = password.getText().toString();
if (TextUtils.isEmpty(user_name))
{
Name :Shreya Bhattacharjee
Roll no-8213
Android Programming
if(facultyBean!=null)
{
Intent intent = new
Intent(LoginActivity.this,AddAttandanceSessionActivity.class);
startActivity(intent);
((ApplicationContext)LoginActivity.this.getApplicationContext()).setFaculty
Bean(facultyBean);
Toast.makeText(getApplicationContext(), "Login
successful", Toast.LENGTH_SHORT).show();
}
else
{
Toast.makeText(getApplicationContext(), "Login failed",
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, menu);
return true;
}
Build.grandle file
android {
compileSdkVersion 26
defaultConfig {
applicationId "com.example.androidattendancesystem"
minSdkVersion 14
targetSdkVersion 26
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-
android.txt'), 'proguard-rules.txt'
dependencies {
Name :Shreya Bhattacharjee
Roll no-8213
Android Programming
compile 'com.android.support:support-v4:26.1.0'
OUTPUT
Name :Shreya Bhattacharjee
Roll no-8213
Android Programming
Name :Shreya Bhattacharjee
Roll no-8213
Android Programming
Name :Shreya Bhattacharjee
Roll no-8213
Android Programming
Name :Shreya Bhattacharjee
Roll no-8213
Android Programming