Mca File Extra
Mca File Extra
EXTRA
EXPERIMENTS
Vision:-
“To mould technocrat in the field of computer engineering with innovation skills, moral values & societal concerns.”
EXTRA EXPERIMENT:- 1
PROGRAM CODE:-
XML File:-
activity_main.xml
<RelativeLayout
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent" android:layout_height="match_parent"
android:paddingBottom="@dimen/activity_vertical_margin"
android:paddingLeft="@dimen/activity_horizontal_margin"
android:paddingRight="@dimen/activity_horizontal_margin"
android:paddingTop="@dimen/activity_vertical_margin"
tools:context=".MainActivity" >
<Button
android:id="@+id/button2"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:layout_alignParentLeft="true"
android:layout_below="@+id/button1"
android:text="Fill parent" />
<Button
android:id="@+id/button1"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignLeft="@+id/button2"
android:text="wrap content" />
</RelativeLayout>
Vision:-
“To mould technocrat in the field of computer engineering with innovation skills, moral values & societal concerns.”
JAVA File:-
MainActivity.java
package com.example.extra1;
import android.os.Bundle;
import android.app.Activity;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
}
Vision:-
“To mould technocrat in the field of computer engineering with innovation skills, moral values & societal concerns.”
MANIFEST File:-
<uses-sdk
android:minSdkVersion="8"
android:targetSdkVersion="17" />
<application
android:allowBackup="true"
android:icon="@drawable/ic_launcher"
android:label="@string/app_name"
android:theme="@style/AppTheme" >
<activity
android:name=" com.example.extra1.MainActivity"
android:label="@string/app_name" >
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
</application>
</manifest>
Vision:-
“To mould technocrat in the field of computer engineering with innovation skills, moral values & societal concerns.”
OUTPUT:-
Vision:-
“To mould technocrat in the field of computer engineering with innovation skills, moral values & societal concerns.”
EXTRA EXPERIMENT:- 2
PROGRAM CODE:-
XML File:-
Activity_main.xml
<LinearLayout
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:paddingBottom="@dimen/activity_vertical_margin"
android:paddingLeft="@dimen/activity_horizontal_margin"
android:paddingRight="@dimen/activity_horizontal_margin"
android:paddingTop="@dimen/activity_vertical_margin"
tools:context=".MainActivity"
android:orientation="vertical">
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Click the Buttons togo to New Activity"
android:layout_marginTop="15dp"/>
Vision:-
“To mould technocrat in the field of computer engineering with innovation skills, moral values & societal concerns.”
<Button
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="First Activity"
android:id="@+id/btnFirst"
android:layout_marginTop="15dp"
android:background="#00FFFF"/>
<Button
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="Second Activity"
android:id="@+id/btnSecond"
android:layout_marginTop="15dp"
android:background="#7CFC00"/>
<Button
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="Third Activity"
android:id="@+id/btnThird"
android:layout_marginTop="15dp"
android:background="#ffa500"/>
</LinearLayout>
Vision:-
“To mould technocrat in the field of computer engineering with innovation skills, moral values & societal concerns.”
activity_first.xml
<LinearLayout
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:paddingBottom="@dimen/activity_vertical_margin"
android:paddingLeft="@dimen/activity_horizontal_margin"
android:paddingRight="@dimen/activity_horizontal_margin"
android:paddingTop="@dimen/activity_vertical_margin"
tools:context=".FirstActivity"
android:orientation="vertical">
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Welcome to First Activity..."
android:textSize="20sp"/>
<Button
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="Go to Main Activity"
android:id="@+id/btnFirst"
android:layout_marginTop="15dp"
android:background="#00FFFF"/>
</LinearLayout>
Vision:-
“To mould technocrat in the field of computer engineering with innovation skills, moral values & societal concerns.”
activity_second.xml
<LinearLayout
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:paddingBottom="@dimen/activity_vertical_margin"
android:paddingLeft="@dimen/activity_horizontal_margin"
android:paddingRight="@dimen/activity_horizontal_margin"
android:paddingTop="@dimen/activity_vertical_margin"
tools:context=".SecondActivity"
android:orientation="vertical">
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text=" Welcome to Second Activity..."
android:textSize="20sp"/>
<Button
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="Go to Main Activity"
android:id="@+id/btnSecond"
android:layout_marginTop="15dp"
android:background="# 7CFC00"/>
</LinearLayout>
Vision:-
“To mould technocrat in the field of computer engineering with innovation skills, moral values & societal concerns.”
activity_third.xml
<LinearLayout
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:paddingBottom="@dimen/activity_vertical_margin"
android:paddingLeft="@dimen/activity_horizontal_margin"
android:paddingRight="@dimen/activity_horizontal_margin"
android:paddingTop="@dimen/activity_vertical_margin"
tools:context=".ThirdActivity"
android:orientation="vertical">
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text=" Welcome to Third Activity..."
android:textSize="20sp"/>
<Button
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="Go to Main Activity"
android:id="@+id/btnThird"
android:layout_marginTop="15dp"
android:background="# ffa500"/>
</LinearLayout>
Vision:-
“To mould technocrat in the field of computer engineering with innovation skills, moral values & societal concerns.”
JAVA File:-
MainActivity.java
package com.example.threebuttonintent;
import android.os.Bundle;
import android.view.View;
import android.view.View.OnClickListener;
import android.widget.Button;
import android.app.Activity;
import android.content.Intent;
btn1=(Button)findViewById(R.id.btnFirst);
btn2=(Button)findViewById(R.id.btnSecond);
btn3=(Button)findViewById(R.id.btnThird);
btn1.setOnClickListener(new OnClickListener() {
@Override
public void onClick(View arg0) {
Intent first=new Intent(MainActivity.this,FirstActivity.class);
startActivity(first);
Vision:-
“To mould technocrat in the field of computer engineering with innovation skills, moral values & societal concerns.”
}
});
btn2.setOnClickListener(new OnClickListener() {
@Override
public void onClick(View arg0) {
Intent second=new Intent(MainActivity.this,SecondActivity.class);
startActivity(second);
}
});
btn3.setOnClickListener(new OnClickListener() {
@Override
public void onClick(View arg0) {
Intent third=new Intent(MainActivity.this,ThirdActivity.class);
startActivity(third);
}
});
}
Vision:-
“To mould technocrat in the field of computer engineering with innovation skills, moral values & societal concerns.”
FirstActivity.java
package com.example.threebuttonintent;
import android.os.Bundle;
import android.view.View;
import android.view.View.OnClickListener;
import android.widget.Button;
import android.app.Activity;
import android.content.Intent;
Vision:-
“To mould technocrat in the field of computer engineering with innovation skills, moral values & societal concerns.”
SecondActivity.java
package com.example.threebuttonintent;
import android.os.Bundle;
import android.view.View;
import android.view.View.OnClickListener;
import android.widget.Button;
import android.app.Activity;
import android.content.Intent;
second=(Button)findViewById(R.id.btnSecond);
second.setOnClickListener(new OnClickListener() {
@Override
public void onClick(View arg0) {
Intent first=new Intent(SecondActivity.this,MainActivity.class);
startActivity(first);
}
});
}
}
Vision:-
“To mould technocrat in the field of computer engineering with innovation skills, moral values & societal concerns.”
ThirdActivity.java
package com.example.threebuttonintent;
import android.os.Bundle;
import android.view.View;
import android.view.View.OnClickListener;
import android.widget.Button;
import android.app.Activity;
import android.content.Intent;
third=(Button)findViewById(R.id.btnThird);
third.setOnClickListener(new OnClickListener() {
@Override
public void onClick(View arg0) {
Intent first=new Intent(ThirdActivity.this,MainActivity.class);
startActivity(first);
}
});
}
}
Vision:-
“To mould technocrat in the field of computer engineering with innovation skills, moral values & societal concerns.”
MANIFEST File:-
<uses-sdk
android:minSdkVersion="8"
android:targetSdkVersion="17" />
<application
android:allowBackup="true"
android:icon="@drawable/ic_launcher"
android:label="@string/app_name"
android:theme="@style/AppTheme" >
<activity
android:name="com.example.threebuttonintent.MainActivity"
android:label="@string/app_name" >
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
<activity
android:name="com.example.threebuttonintent.SecondActivity"
android:label="@string/title_activity_second" />
Vision:-
“To mould technocrat in the field of computer engineering with innovation skills, moral values & societal concerns.”
<activity
android:name="com.example.threebuttonintent.ThirdActivity"
android:label="@string/title_activity_third" />
<activity
android:name="com.example.threebuttonintent.FirstActivity"
android:label="@string/title_activity_first" />
</application>
</manifest>
Vision:-
“To mould technocrat in the field of computer engineering with innovation skills, moral values & societal concerns.”
OUTPUT:-
Vision:-
“To mould technocrat in the field of computer engineering with innovation skills, moral values & societal concerns.”
Vision:-
“To mould technocrat in the field of computer engineering with innovation skills, moral values & societal concerns.”
EXTRA EXPERIMENT:- 3
PROGRAM CODE:-
XML File:-
activity_main.xml
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
tools:context=".MainActivity" >
<ImageView
android:layout_width="match_parent"
android:layout_height="match_parent"
android:scaleType="centerCrop"
android:src="@drawable/a" />
</RelativeLayout>
Vision:-
“To mould technocrat in the field of computer engineering with innovation skills, moral values & societal concerns.”
activity_second_but_main.xml
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
tools:context=".SecondButMain" >
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_centerHorizontal="true"
android:layout_centerVertical="true"
android:text="Second" />
</RelativeLayout>
Vision:-
“To mould technocrat in the field of computer engineering with innovation skills, moral values & societal concerns.”
JAVA File:-
MainActivity.java
package com.example.splashscreen;
import android.os.*;
import android.app.ActionBar;
import android.app.Activity;
import android.content.Intent;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
SecondButMain.java
package com.example.splashscreen;
import android.os.Bundle;
import android.app.Activity;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_second_but_main);
}
}
Vision:-
“To mould technocrat in the field of computer engineering with innovation skills, moral values & societal concerns.”
MANIFEST File:-
<uses-sdk android:minSdkVersion="8"
android:targetSdkVersion="17" />
<application
android:allowBackup="true"
android:icon="@drawable/ic_launcher"
android:label="@string/app_name"
android:theme="@style/AppTheme" >
<activity
android:name="com.example.splashscreen.MainActivity"
android:label="@string/app_name" >
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
<activity
android:name="com.example.splashscreen.SecondButMain"
android:label="@string/title_activity_second_but_main" >
</activity>
</application>
</manifest>
Vision:-
“To mould technocrat in the field of computer engineering with innovation skills, moral values & societal concerns.”
OUTPUT:-
Vision:-
“To mould technocrat in the field of computer engineering with innovation skills, moral values & societal concerns.”
EXTRA EXPERIMENT:- 4
PROGRAM CODE:-
XML File:-
activity_main.xml
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
tools:context=".MainActivity" >
<ImageView
android:layout_width="match_parent"
android:layout_height="match_parent"
android:scaleType="centerCrop"
android:src="@drawable/a" />
</RelativeLayout>
Vision:-
“To mould technocrat in the field of computer engineering with innovation skills, moral values & societal concerns.”
JAVA File:-
MainActivity.java
package com.example.imageview;
import android.os.Bundle;
import android.app.Activity;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
}
}
Vision:-
“To mould technocrat in the field of computer engineering with innovation skills, moral values & societal concerns.”
MANIFEST File:-
<uses-sdk
android:minSdkVersion="8"
android:targetSdkVersion="17" />
<application
android:allowBackup="true"
android:icon="@drawable/ic_launcher"
android:label="@string/app_name"
android:theme="@style/AppTheme" >
<activity
android:name="com.example.imagevie.MainActivity"
android:label="@string/app_name" >
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
</application>
</manifest>
Vision:-
“To mould technocrat in the field of computer engineering with innovation skills, moral values & societal concerns.”
OUTPUT:-
Vision:-
“To mould technocrat in the field of computer engineering with innovation skills, moral values & societal concerns.”
EXTRA EXPERIMENT:- 5
PROGRAM CODE:-
XML File:-
activity_main.xml
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:paddingBottom="@dimen/activity_vertical_margin"
android:paddingLeft="@dimen/activity_horizontal_margin"
android:paddingRight="@dimen/activity_horizontal_margin"
android:paddingTop="@dimen/activity_vertical_margin"
tools:context=".MainActivity" >
<TextView
android:id="@+id/textView1"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentTop="true"
android:text="Select subject to diplay"
android:textAppearance="?android:attr/textAppearanceLarge" />
Vision:-
“To mould technocrat in the field of computer engineering with innovation skills, moral values & societal concerns.”
<Spinner
android:id="@+id/spinner_sub"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_below="@+id/textView1"
android:layout_marginTop="16dp"
android:entries="@array/subname" />
</RelativeLayout>
Vision:-
“To mould technocrat in the field of computer engineering with innovation skills, moral values & societal concerns.”
JAVA File:-
MainActivity.java
package com.example.spinner_subject;
import android.os.Bundle;
import android.app.Activity;
import android.view.View;
import android.widget.*;
import android.widget.AdapterView.OnItemSelectedListener;
public class MainActivity extends Activity {
Spinner spinner_sub;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
spinner_sub = (Spinner) findViewById(R.id.spinner_sub);
spinner_sub.setOnItemSelectedListener(new OnItemSelectedListener() {
@Override
public void onItemSelected(AdapterView<?> arg0, View arg1,
int arg2, long arg3) {
// TODO Auto-generated method stub
switch (arg2) {
case 0:
Toast.makeText(getApplicationContext(),
"Subject name : MCA",Toast.LENGTH_SHORT).show();
break;
case 1:
Toast.makeText(getApplicationContext(),
"Subject name : NMA", Toast.LENGTH_SHORT).show();
Vision:-
“To mould technocrat in the field of computer engineering with innovation skills, moral values & societal concerns.”
break;
case 2:
Toast.makeText(getApplicationContext(),
"Subject name : AJAVA", Toast.LENGTH_SHORT).show();
break;
case 3:
Toast.makeText(getApplicationContext(),
"Subject name : PPD", Toast.LENGTH_SHORT).show();
break;
default:
break;
}
}
@Override
public void onNothingSelected(AdapterView<?> arg0) {
// TODO Auto-generated method stub
}
});
}
}
Vision:-
“To mould technocrat in the field of computer engineering with innovation skills, moral values & societal concerns.”
MANIFEST File:-
<uses-sdk
android:minSdkVersion="8"
android:targetSdkVersion="17" />
<application
android:allowBackup="true"
android:icon="@drawable/ic_launcher"
android:label="@string/app_name"
android:theme="@style/AppTheme" >
<activity
android:name="com.example.spinner_subject.MainActivity"
android:label="@string/app_name" >
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
</application>
</manifest>
Vision:-
“To mould technocrat in the field of computer engineering with innovation skills, moral values & societal concerns.”
OUTPUT:-
Vision:-
“To mould technocrat in the field of computer engineering with innovation skills, moral values & societal concerns.”
AIM:- Create an application that will create database with table of User
credential.
OR
Create an application to make Insert, and retrieve operation on the
database.
OR
Create an application to make Update and Delete operation on the
database.
PROGRAM CODE:-
XML File:-
activity_main.xml
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical"
android:paddingBottom="@dimen/activity_vertical_margin"
android:paddingLeft="@dimen/activity_horizontal_margin"
android:paddingRight="@dimen/activity_horizontal_margin"
android:paddingTop="@dimen/activity_vertical_margin"
tools:context=".MainActivity" >
Vision:-
“To mould technocrat in the field of computer engineering with innovation skills, moral values & societal concerns.”
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="horizontal" >
<TextView
android:id="@+id/id"
android:layout_width="30dp"
android:layout_height="wrap_content"
android:gravity="center"
android:text="ID"
android:textAppearance="?android:attr/textAppearanceMedium"/>
<TextView
android:id="@+id/name"
android:layout_width="160dp"
android:layout_height="wrap_content"
android:gravity="center"
android:text="Name"
android:textAppearance="?android:attr/textAppearanceMedium"/>
<TextView
android:id="@+id/enrolno"
android:layout_width="110dp"
android:layout_height="wrap_content"
android:gravity="center"
android:text="Enrol No"
android:textAppearance="?android:attr/textAppearanceMedium"/>
</LinearLayout>
Vision:-
“To mould technocrat in the field of computer engineering with innovation skills, moral values & societal concerns.”
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="horizontal" >
<ListView
android:id="@+id/user_data"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:textAlignment="center" >
</ListView>
</LinearLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="horizontal" >
<Button
android:id="@+id/btn_insert"
android:layout_width="100dp"
android:layout_height="wrap_content"
android:gravity="center"
android:onClick="insert_intent"
android:text="Insert"
android:textAppearance="?android:attr/textAppearanceMedium"/>
<Button
android:id="@+id/btn_update"
android:layout_width="100dp"
android:layout_height="wrap_content"
Vision:-
“To mould technocrat in the field of computer engineering with innovation skills, moral values & societal concerns.”
android:gravity="center"
android:onClick="update_intent"
android:text="Update"
android:textAppearance="?android:attr/textAppearanceMedium"/>
<Button
android:id="@+id/btn_delete"
android:layout_width="100dp"
android:layout_height="wrap_content"
android:gravity="center"
android:onClick="delete_intent"
android:text="Delete"
android:textAppearance="?android:attr/textAppearanceMedium"/>
</LinearLayout>
</LinearLayout>
activity_insert.xml
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical"
android:paddingBottom="@dimen/activity_vertical_margin"
android:paddingLeft="@dimen/activity_horizontal_margin"
android:paddingRight="@dimen/activity_horizontal_margin"
android:paddingTop="@dimen/activity_vertical_margin"
tools:context=".InsertActivity" >
Vision:-
“To mould technocrat in the field of computer engineering with innovation skills, moral values & societal concerns.”
<EditText
android:id="@+id/txt_ins_name"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:hint="Enter Name" />
<EditText
android:id="@+id/txt_ins_no"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:hint="Enter Enrolment No"
android:inputType="number" />
<EditText
android:id="@+id/txt_ins_pass"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:hint="Enter Password"
android:inputType="textPassword" />
<Button
android:id="@+id/button1"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_below="@+id/editText2"
android:onClick="insert_data"
android:text="Insert" />
</LinearLayout>
Vision:-
“To mould technocrat in the field of computer engineering with innovation skills, moral values & societal concerns.”
activity_update.xml
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical"
android:paddingBottom="@dimen/activity_vertical_margin"
android:paddingLeft="@dimen/activity_horizontal_margin"
android:paddingRight="@dimen/activity_horizontal_margin"
android:paddingTop="@dimen/activity_vertical_margin"
tools:context=".UpdateActivity" >
<EditText
android:id="@+id/txt_up_id"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:hint="Enter Id" />
<EditText
android:id="@+id/txt_up_name"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:hint="Enter Name" />
<EditText
android:id="@+id/txt_up_no"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:hint="Enter Enrolment No"
android:inputType="number" />
Vision:-
“To mould technocrat in the field of computer engineering with innovation skills, moral values & societal concerns.”
<EditText
android:id="@+id/txt_up_pass"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:hint="Enter Password"
android:inputType="textPassword" />
<Button
android:id="@+id/button1"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_below="@+id/editText2"
android:onClick="update_data"
android:text="Update" />
</LinearLayout>
activity_delete.xml
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical"
android:paddingBottom="@dimen/activity_vertical_margin"
android:paddingLeft="@dimen/activity_horizontal_margin"
android:paddingRight="@dimen/activity_horizontal_margin"
android:paddingTop="@dimen/activity_vertical_margin"
tools:context=".DeleteActivity" >
Vision:-
“To mould technocrat in the field of computer engineering with innovation skills, moral values & societal concerns.”
<EditText
android:id="@+id/txt_del_id"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:hint="Enter Id" />
<Button
android:id="@+id/button1"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:onClick="delete_data"
android:text="Delete" />
</LinearLayout>
customlist.xml
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="horizontal" >
<TextView
android:id="@+id/txt_id"
android:layout_width="30dp"
android:layout_height="wrap_content"
android:gravity="center"
android:text="Medium Text"
android:textAppearance="?android:attr/textAppearanceMedium" />
Vision:-
“To mould technocrat in the field of computer engineering with innovation skills, moral values & societal concerns.”
<TextView
android:id="@+id/txt_name"
android:layout_width="160dp"
android:layout_height="wrap_content"
android:gravity="center"
android:text="Medium Text"
android:textAppearance="?android:attr/textAppearanceMedium" />
<TextView
android:id="@+id/txt_enrolno"
android:layout_width="110dp"
android:layout_height="wrap_content"
android:gravity="center"
android:text="Medium Text"
android:textAppearance="?android:attr/textAppearanceMedium" />
</LinearLayout>
Vision:-
“To mould technocrat in the field of computer engineering with innovation skills, moral values & societal concerns.”
JAVA File:-
MainActivity.java
package com.example.databaseapp;
import android.os.Bundle;
import android.app.Activity;
import android.content.*;
import android.database.Cursor;
import android.database.sqlite.SQLiteDatabase;
import android.view.View;
import android.widget.*;
public class MainActivity extends Activity {
ListView user_data;
SQLiteDatabase db;
Button btn_ins;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
Vision:-
“To mould technocrat in the field of computer engineering with innovation skills, moral values & societal concerns.”
InsertActivity.java
package com.example.databaseapp;
import android.os.Bundle;
import android.app.Activity;
import android.content.*;
import android.database.sqlite.SQLiteDatabase;
import android.view.View;
import android.widget.*;
public class InsertActivity extends Activity {
TextView txt_ins_name, txt_ins_no, txt_ins_pass;
Button btn_insert;
SQLiteDatabase db;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_insert);
}
public void insert_data(View v) {
Vision:-
“To mould technocrat in the field of computer engineering with innovation skills, moral values & societal concerns.”
UpdateActivity.java
package com.example.databaseapp;
import android.os.Bundle;
import android.app.Activity;
import android.content.*;
import android.database.sqlite.SQLiteDatabase;
import android.view.View;
import android.widget.*;
public class UpdateActivity extends Activity {
TextView txt_up_id, txt_up_name, txt_up_no, txt_up_pass;
Button btn_update;
SQLiteDatabase db;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_update);
}
public void update_data(View v) {
txt_up_id = (TextView) findViewById(R.id.txt_up_id);
txt_up_name = (TextView) findViewById(R.id.txt_up_name);
txt_up_no = (TextView) findViewById(R.id.txt_up_no);
txt_up_pass = (TextView) findViewById(R.id.txt_up_pass);
btn_update = (Button) findViewById(R.id.btn_update);
Integer id = Integer.parseInt(txt_up_id.getText().toString());
String name = txt_up_name.getText().toString();
Integer no = Integer.parseInt(txt_up_no.getText().toString());
String pass = txt_up_pass.getText().toString();
Vision:-
“To mould technocrat in the field of computer engineering with innovation skills, moral values & societal concerns.”
DeleteActivity.java
package com.example.databaseapp;
import android.os.Bundle;
import android.app.Activity;
import android.content.*;
import android.database.sqlite.SQLiteDatabase;
import android.view.View;
import android.widget.*;
public class DeleteActivity extends Activity {
TextView txt_del_id;
Button btn_delete;
SQLiteDatabase db;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_delete);
}
public void delete_data(View v) {
txt_del_id = (TextView) findViewById(R.id.txt_del_id);
btn_delete = (Button) findViewById(R.id.btn_delete);
Integer id = Integer.parseInt(txt_del_id.getText().toString());
db = openOrCreateDatabase("user", Context.MODE_PRIVATE, null);
db.execSQL("delete from user_data where id='" + id + "'");
Intent i = new Intent(this, MainActivity.class);
startActivity(i);
}
}
Vision:-
“To mould technocrat in the field of computer engineering with innovation skills, moral values & societal concerns.”
CustomAdapter.java
package com.example.databaseapp;
import android.app.Activity;
import android.view.*;
import android.widget.*;
public class CustomAdapter extends ArrayAdapter<String> {
private final Activity context;
private final Integer[] id;
private final String[] name;
private final Integer[] enrolno;
public CustomAdapter(Activity context, Integer[] id, String[] name,
Integer[] enrolno) {
super(context, R.layout.customlist, name);
// TODO Auto-generated constructor stub
this.context = context;
this.id = id;
this.name = name;
this.enrolno = enrolno;
}
public View getView(int position, View view, ViewGroup parent) {
LayoutInflater inflater = context.getLayoutInflater();
View rowView = inflater.inflate(R.layout.customlist, null, true);
txt_enrolno.setText(enrolno[position].toString());
return rowView;
};
}
Vision:-
“To mould technocrat in the field of computer engineering with innovation skills, moral values & societal concerns.”
MANIFEST File:-
</activity>
<activity
android:name="com.example.databaseapp.DeleteActivity"
android:label="@string/title_activity_delete" >
</activity>
</application>
</manifest>
Vision:-
“To mould technocrat in the field of computer engineering with innovation skills, moral values & societal concerns.”
OUTPUT:-
Vision:-
“To mould technocrat in the field of computer engineering with innovation skills, moral values & societal concerns.”
Vision:-
“To mould technocrat in the field of computer engineering with innovation skills, moral values & societal concerns.”