Professional Documents
Culture Documents
Institute of Technology and Engineering
Institute of Technology and Engineering
A
Micro Project Report On
“Design Student Information Form”
Submitted By
KHATAVKAR OM ANANDSAGAR BHOSALE JAYASH MILIND
Certificate
This is to certify that
CERTIFICATE
This is to Certify that Mr. / Miss
have successfully completed the Micro Project work in Mobile Application Development
Subject Code (22617) for the Academic year 2021-22 as prescribed in MSBTE curriculum under
to work with this project. Through his timely advice, constructive criticism and
supervision.
much thankful to our Principal Prof. R.M. Wabale who has been a constant source
By
Om Anandsagar Khatavkar
Jayash Milind Bhosale
Aditya Prakash Saste
Ashish Arun Panhale
Source Code:
activity_main.xml
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
tools:context=".addstudent">
<ScrollView
android:layout_width="match_parent"
android:layout_height="match_parent">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical">
<TextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="Insert Student Record..."
android:textSize="20sp"
android:textColor="#000000"/>
<EditText
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:id="@+id/rollno"
android:textSize="20sp"
android:hint="Enter RollNo"
android:textColor="#000000"
android:layout_marginTop="30sp"/>
<EditText
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:id="@+id/name"
android:hint="Enter Name"
android:textSize="20sp"
android:layout_marginTop="10sp"
android:textColor="#000000"/>
<EditText
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:id="@+id/mono"
android:hint="Enter Mobile No"
android:textSize="20sp"
android:layout_marginTop="10sp"
android:textColor="#000000"/>
<EditText
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:id="@+id/pmono"
android:hint="Enter Parent Mobile No."
android:textSize="20sp"
android:layout_marginTop="10sp"
android:textColor="#000000"/>
<EditText
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:id="@+id/add"
android:hint="Enter Address"
android:textSize="20sp"
android:layout_marginTop="10sp"
android:textColor="#000000"/>
<EditText
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:id="@+id/ayear"
android:hint="Enter Academic Year"
android:textSize="20sp"
android:layout_marginTop="10sp"
android:textColor="#000000"/>
<EditText
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:id="@+id/course"
android:hint="Enter Course"
android:textSize="20sp"
android:layout_marginTop="10sp"
android:textColor="#000000"/>
<EditText
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:id="@+id/marks"
android:hint="Enter Marks of Last Semester"
android:textSize="20sp"
android:layout_marginTop="10sp"
android:textColor="#000000"/>
<EditText
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:id="@+id/email"
android:hint="Enter Email"
android:textSize="20sp"
android:layout_marginTop="10sp"
android:textColor="#000000"/>
<Button
android:layout_width="130dp"
android:layout_height="50dp"
android:id="@+id/submit"
android:layout_marginRight="1dp"
android:padding="10dp"
android:text="Submit"
android:textColor="#FFFFFF"
android:layout_gravity="center_horizontal"/>
</LinearLayout>
</ScrollView>
</RelativeLayout>
addstudent.java
package com.example.student_data;
import androidx.appcompat.app.AppCompatActivity;
import android.content.Context;
import android.database.sqlite.SQLiteDatabase;
import android.os.Bundle;
import android.view.View;
import android.widget.Button;
import android.widget.EditText;
import android.widget.Toast;
public class addstudent extends AppCompatActivity {
Button submit;
EditText name,rollno,mono,add,pmono,ayear,course,marks,email;
SQLiteDatabase db;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
try {
db=openOrCreateDatabase("Student",Context.MODE_PRIVATE,null);
db.execSQL("CREATE TABLE IF NOT EXISTS student(roll
varchar(255),name varchar(255),mobile varchar(255),ParentMoNo
varchar(255),address varchar(255),AYear varchar(255),course varchar(255),marks
varchar(255),marks varchar(255),email varchar(255));");
} catch (Exception ex) {
Toast.makeText(this,"DB Error" , Toast.LENGTH_LONG).show();
}
try {
name=(EditText) findViewById(R.id.name);
rollno=(EditText) findViewById(R.id.rollno);
mono=(EditText) findViewById(R.id.mono);
add=(EditText) findViewById(R.id.add);
pmono=(EditText) findViewById(R.id.pmono);
ayear=(EditText) findViewById(R.id.ayear);
course=(EditText) findViewById(R.id.course);
marks=(EditText) findViewById(R.id.marks);
email=(EditText) findViewById(R.id.email);
submit=(Button) findViewById(R.id.submit);
submit.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View view) {
try {
db.execSQL("INSERT INTO student
VALUES('"+rollno.getText().toString()+"','"+name.getText().toString()
+"','"+mono.getText().toString()+"','"+pmono.getText().toString()
+"','"+add.getText().toString()+"','"+ayear.getText().toString()
+"','"+course.getText().toString()+"','"+marks.getText().toString()
+"','"+email.getText().toString()+"');");
rollno.setText("");
name.setText("");
mono.setText("");
pmono.setText("");
add.setText("");
ayear.setText("");
course.setText("");
marks.setText("");
email.setText("");
Toast.makeText(addstudent.this, "Record Inserted",
Toast.LENGTH_SHORT).show();
} catch (Exception ex) {
Toast.makeText(addstudent.this, "Error" +
ex.toString(),Toast.LENGTH_SHORT).show();
}
}
});
}catch (Exception ex) {
Toast.makeText(this, "Error", Toast.LENGTH_SHORT).show();
}
}
}
Output: