Professional Documents
Culture Documents
Mca File Main
Mca File Main
EXPERIMENT:- 1
AIM:- Create “Hello World” application. That will display “Hello World”
in the middle of the screen in the red color with white background.
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:gravity="center"
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:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textColor="#ff0000"
android:text="@string/hello_world" />
</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.main_pr1;
import android.os.Bundle;
import android.app.Activity;
import android.view.Menu;
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.main_pr1.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.”
EXPERIMENT:- 2
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:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Hello World!" />
</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.activitylifecycle;
import android.os.Bundle;
import android.widget.Toast;
import android.app.Activity;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
Toast.makeText(getApplicationContext(), "onCreate Method Invoked",
Toast.LENGTH_LONG).show();
}
@Override
protected void onStart() {
super.onStart();
Toast.makeText(getApplicationContext(), "onStart Method Invoked",
Toast.LENGTH_LONG).show();
}
@Override
protected void onResume() {
super.onResume();
Vision:-
“To mould technocrat in the field of computer engineering with innovation skills, moral values & societal concerns.”
@Override
protected void onPause() {
super.onPause();
Toast.makeText(getApplicationContext(), "onPause Method Invoked",
Toast.LENGTH_LONG).show(); }
@Override
protected void onStop() {
super.onStop();
Toast.makeText(getApplicationContext(), "onStop Method Invoked",
Toast.LENGTH_LONG).show(); }
@Override
protected void onRestart() {
super.onRestart();
Toast.makeText(getApplicationContext(), "onRestart Method Invoked",
Toast.LENGTH_LONG).show(); }
@Override
protected void onDestroy() {
super.onDestroy();
Toast.makeText(getApplicationContext(), "onDestroy Method Invoked",
Toast.LENGTH_LONG).show(); }
}
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.activitylifecycle.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.”
Vision:-
“To mould technocrat in the field of computer engineering with innovation skills, moral values & societal concerns.”
EXPERIMENT:- 3
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"
tools:context=".MainActivity" >
<TextView
android:id="@+id/txt_welcome"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_marginTop="20dp"
android:gravity="center_horizontal"
android:text="CODEX REGISTRATION"
android:textColor="#ffffff"
android:textSize="20dp" />
Vision:-
“To mould technocrat in the field of computer engineering with innovation skills, moral values & societal concerns.”
<LinearLayout
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_margin="15dip"
android:background="#cccccc"
android:orientation="vertical" >
<LinearLayout
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:orientation="horizontal" >
<TextView
android:id="@+id/txt_name"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_margin="10dip"
android:text="Name:"
android:textColor="#000000"
android:textSize="15dip" />
<EditText
android:id="@+id/ext_name"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_margin="5dip" />
</LinearLayout>
<LinearLayout
android:layout_width="fill_parent"
Vision:-
“To mould technocrat in the field of computer engineering with innovation skills, moral values & societal concerns.”
android:layout_height="wrap_content"
android:orientation="horizontal" >
<TextView
android:id="@+id/txt_name"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_margin="10dip"
android:text="Phone:"
android:textColor="#000000"
android:textSize="15dip" />
<EditText
android:id="@+id/ext_phone"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_margin="5dip" />
</LinearLayout>
<LinearLayout
android:layout_width="fill_parent"
android:layout_height="30dip"
android:layout_margin="10dip"
android:orientation="horizontal" >
<TextView
android:id="@+id/txt_name"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:gravity="center_vertical"
Vision:-
“To mould technocrat in the field of computer engineering with innovation skills, moral values & societal concerns.”
android:text="Gender:"
android:textColor="#000000"
android:textSize="15dip" />
<RadioGroup
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_marginLeft="10dip"
android:orientation="horizontal" >
<RadioButton
android:id="@+id/rb_male"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Male"
android:textColor="#000000" >
</RadioButton>
<RadioButton
android:id="@+id/rb_female"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Female"
android:textColor="#000000" >
</RadioButton>
</RadioGroup>
</LinearLayout>
<LinearLayout
android:layout_width="fill_parent"
Vision:-
“To mould technocrat in the field of computer engineering with innovation skills, moral values & societal concerns.”
android:layout_height="wrap_content"
android:layout_margin="10dip"
android:orientation="horizontal" >
<TextView
android:id="@+id/txt_name"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:gravity="center_vertical"
android:text="Area of interest:"
android:textColor="#000000"
android:textSize="15dip" />
</LinearLayout>
<LinearLayout
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_marginLeft="10dip"
android:layout_marginRight="10dip"
android:orientation="horizontal" >
<CheckBox
android:id="@+id/ch_java"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_weight="0.3"
android:text="Java"
android:textColor="#000000" />
Vision:-
“To mould technocrat in the field of computer engineering with innovation skills, moral values & societal concerns.”
<CheckBox
android:id="@+id/ch_php"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_weight="0.3"
android:text="Php"
android:textColor="#000000" />
<CheckBox
android:id="@+id/ch_android"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_weight="0.3"
android:text="Android"
android:textColor="#000000" />
</LinearLayout>
<Button
android:id="@+id/btn_register"
android:layout_height="40dip"
android:layout_width="fill_parent"
android:layout_margin="10dip"
android:background="#aaaaaa"
android:text="Register now FREE"/>
</LinearLayout>
</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.registrationmodule;
import android.os.Bundle;
import android.app.Activity;
import android.view.Menu;
@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="@android:style/Theme.Black.NoTitleBar.Fullscreen" >
<activity
android:name="com.example.registrationmodule.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.”
EXPERIMENT:- 4
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"
tools:context=".MainActivity" >
<EditText
android:id="@+id/edt_get_number"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:ems="10"
android:hint="Enter Phone Number"
android:inputType="number" />
Vision:-
“To mould technocrat in the field of computer engineering with innovation skills, moral values & societal concerns.”
<Button
android:id="@+id/btn_call"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Call" />
</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.callthrougheditview;
import android.app.Activity;
import android.content.Intent;
import android.net.Uri;
import android.os.Bundle;
import android.view.View;
import android.view.View.OnClickListener;
import android.widget.Button;
import android.widget.EditText;
EditText edt_get_number;
Button btn_call;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
edt_get_number=(EditText)findViewById(R.id.edt_get_number);
btn_call=(Button)findViewById(R.id.btn_call);
btn_call.setOnClickListener(new OnClickListener() {
Vision:-
“To mould technocrat in the field of computer engineering with innovation skills, moral values & societal concerns.”
@Override
public void onClick(View arg0) {
try {
String Number=edt_get_number.getText().toString();
Intent i=new Intent(Intent.ACTION_CALL);
i.setData(Uri.parse("tel:"+Number));
startActivity(i);
} catch (Exception e) {
e.printStackTrace();
}
}
});
}
}
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" />
<uses-permission android:name="android.permission.CALL_PHONE"/>
<application
android:allowBackup="true"
android:icon="@drawable/ic_launcher"
android:label="@string/app_name"
android:theme="@style/AppTheme" >
<activity
android:name="com.example.callthrougheditview.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.”
EXPERIMENT:- 5
AIM:- Create application to open browser with any URL(on button click).
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:layout_width="match_parent"
android:layout_height="wrap_content"
android:onClick="secondactivity"
android:layout_margin="20dp"
android:padding="10dp"
android:text="Click for open google" />
</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.mainpr5;
import android.net.Uri;
import android.os.Bundle;
import android.app.Activity;
import android.content.Intent;
import android.view.Menu;
import android.view.View;
@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.mainpr5.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.”
EXPERIMENT:- 6
AIM:- Create simple app to navigate from one screen (activity) to another
screen (activity).
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_margin="@dimen/activity_horizontal_margin"
android:text="@string/hello_world" />
Vision:-
“To mould technocrat in the field of computer engineering with innovation skills, moral values & societal concerns.”
<Button
android:id="@+id/mbtn2"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_below="@+id/mbtn1"
android:layout_margin="@dimen/activity_horizontal_margin"
android:layout_marginLeft="18dp"
android:layout_toRightOf="@+id/mbtn1"
android:text="Third" />
<Button
android:id="@+id/mbtn1"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignLeft="@+id/textView1"
android:layout_below="@+id/textView1"
android:layout_margin="@dimen/activity_horizontal_margin"
android:layout_marginTop="50dp"
android:text="Second" />
</RelativeLayout>
Vision:-
“To mould technocrat in the field of computer engineering with innovation skills, moral values & societal concerns.”
activity_second.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=".Second" >
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@string/title_activity_second" />
<Button
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="MainActivity"
android:id="@+id/sbtn1"
android:layout_margin="@dimen/activity_horizontal_margin" />
<Button
android:id="@+id/ssbtn2"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignLeft="@+id/sbtn1"
android:layout_below="@+id/sbtn1"
Vision:-
“To mould technocrat in the field of computer engineering with innovation skills, moral values & societal concerns.”
android:layout_margin="@dimen/activity_horizontal_margin"
android:layout_marginTop="44dp"
android:text="Third" />
</RelativeLayout>
activity_thirdactivity.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=".Thirdactivity" >
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@string/title_activity_thirdactivity" />
<Button
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="MaIN Activity"
android:id="@+id/tbtn1"
android:layout_margin="@dimen/activity_horizontal_margin" />
Vision:-
“To mould technocrat in the field of computer engineering with innovation skills, moral values & societal concerns.”
<Button
android:id="@+id/tbtn2"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignLeft="@+id/tbtn1"
android:layout_below="@+id/tbtn1"
android:layout_margin="@dimen/activity_horizontal_margin"
android:layout_marginTop="29dp"
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.first;
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.TextView;
Button btn1;
Button btn2;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
btn1=(Button) findViewById(R.id.mbtn1);
btn2=(Button) findViewById(R.id.mbtn2);
btn1.setOnClickListener(new OnClickListener() {
public void onClick(View arg0) {
Intent i=new Intent(MainActivity.this,Second.class);
startActivity(i);
Vision:-
“To mould technocrat in the field of computer engineering with innovation skills, moral values & societal concerns.”
}
});
btn2.setOnClickListener(new OnClickListener() {
public void onClick(View arg0) {
Intent i=new Intent(MainActivity.this,Thirdactivity.class);
startActivity(i);
}
});
}
}
Vision:-
“To mould technocrat in the field of computer engineering with innovation skills, moral values & societal concerns.”
Second.java:-
package com.example.first;
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;
Vision:-
“To mould technocrat in the field of computer engineering with innovation skills, moral values & societal concerns.”
btn2.setOnClickListener(new OnClickListener() {
public void onClick(View arg0) {
Intent i=new Intent(Second.this,Thirdactivity.class);
startActivity(i);
}
});
}
}
Vision:-
“To mould technocrat in the field of computer engineering with innovation skills, moral values & societal concerns.”
Thirdactivity.java
package com.example.first;
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;
btn1.setOnClickListener(new OnClickListener() {
public void onClick(View arg0) {
Intent i=new Intent(Thirdactivity.this,MainActivity.class);
startActivity(i);
}
});
Vision:-
“To mould technocrat in the field of computer engineering with innovation skills, moral values & societal concerns.”
btn2.setOnClickListener(new OnClickListener() {
public void onClick(View arg0) {
Intent i=new Intent(Thirdactivity.this,Second.class);
startActivity(i);
}
});
}
}
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.first.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.first.Second"
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.first.Thirdactivity"
android:label="@string/title_activity_thirdactivity" >
<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.”
EXPERIMENT:- 7
AIM:- Create an application that will pass two number using TextView to
the next screen , and on the next screen display sum of that number.
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"
tools:context=".MainActivity" >
<EditText
android:id="@+id/edt_num1"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:hint="Enter first number" />
<EditText
android:id="@+id/edt_num2"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:hint="Enter second number" />
Vision:-
“To mould technocrat in the field of computer engineering with innovation skills, moral values & societal concerns.”
<Button
android:id="@+id/btn_sum"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:text="Answer of two number" />
</LinearLayout>
Vision:-
“To mould technocrat in the field of computer engineering with innovation skills, moral values & societal concerns.”
activity_answer.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=".AnswerActivity" >
<TextView
android:id="@+id/txt_ans"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="answer" />
</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.sumofnumber;
import android.app.Activity;
import android.content.Intent;
import android.os.Bundle;
import android.view.View;
import android.view.View.OnClickListener;
import android.widget.Button;
import android.widget.EditText;
@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.”
@Override
public void onClick(View arg0) {
}
});
}
}
Vision:-
“To mould technocrat in the field of computer engineering with innovation skills, moral values & societal concerns.”
AnswerActivity.java
package com.example.sumofnumber;
import android.app.Activity;
import android.content.Intent;
import android.os.Bundle;
import android.widget.TextView;
TextView txt_ans;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_answer);
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.sumofnumber.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.sumofnumber.AnswerActivity"
android:label="@string/title_activity_answer" />
</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.”
EXPERIMENT:- 8
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" >
<Button
android:id="@+id/button1"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentLeft="true"
android:layout_alignParentTop="true"
android:text="Button" />
<Button
android:id="@+id/button3"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentRight="true"
Vision:-
“To mould technocrat in the field of computer engineering with innovation skills, moral values & societal concerns.”
android:layout_below="@+id/button2"
android:layout_marginTop="20dp"
android:text="Button" />
<Button
android:id="@+id/button2"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_below="@+id/button1"
android:layout_centerHorizontal="true"
android:layout_marginTop="39dp"
android:text="Button" />
</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.relativedemo;
import android.os.Bundle;
import android.app.Activity;
import android.view.Menu;
@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.relativedemo.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.”
EXPERIMENT:- 9
PROGRAM CODE:-
XML File:-
activity_main.xml
<TableLayout
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:shrinkColumns="*"
android:stretchColumns="*"
tools:context=".MainActivity" >
<TableRow
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:gravity="center_horizontal" >
<Button
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:layout_span="2"
android:text="Button1" />
Vision:-
“To mould technocrat in the field of computer engineering with innovation skills, moral values & societal concerns.”
<Button
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:text="Button2" />
</TableRow>
<TableRow
android:layout_width="fill_parent"
android:layout_height="wrap_content" >
<Button
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:text="Button3" />
<Button
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:text="Button4" />
<Button
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:text="Button5" />
</TableRow>
</TableLayout>
Vision:-
“To mould technocrat in the field of computer engineering with innovation skills, moral values & societal concerns.”
JAVA File:-
MainActivity.java
package com.example.tableviewdemo;
import android.os.Bundle;
import android.app.Activity;
import android.view.Menu;
@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:-
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.example.tableviewdemo"
android:versionCode="1"
android:versionName="1.0" >
<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.tableviewdemo.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.”
EXPERIMENT:- 10
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/txtcolor"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="Hello World!"/>
<EditText
android:layout_width="match_parent"
Vision:-
“To mould technocrat in the field of computer engineering with innovation skills, moral values & societal concerns.”
android:layout_height="wrap_content"
android:layout_margin="20dp"
android:id="@+id/etcolor"
android:maxLength="10"
android:hint="Enter #code of color"
android:padding="10dp" />
<Button
android:id="@+id/btncolor"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_alignRight="@+id/etcolor"
android:layout_below="@+id/etcolor"
android:layout_margin="20dp"
android:layout_marginTop="125dp"
android:onClick="secondactivity"
android:padding="10dp"
android:text="Change Color" />
</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.mainpr9;
import android.os.Bundle;
import android.app.Activity;
import android.graphics.Color;
import android.view.Menu;
import android.view.View;
import android.widget.EditText;
import android.widget.TextView;
@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.”
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.mainpr9.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.”
EXPERIMENT:- 11
AIM:- Create an UI such that, one screen have list of all the types of cars.
On selecting of any car name, next screen should show Car details
like : name, launched date, company name.
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"
tools:context=".MainActivity" >
<ListView
android:id="@+id/lv_car"
android:layout_width="fill_parent"
android:layout_height="fill_parent"/ >
</LinearLayout>
car_details.xml
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
Vision:-
“To mould technocrat in the field of computer engineering with innovation skills, moral values & societal concerns.”
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical"
tools:context=".CarDetail" >
<TextView
android:id="@+id/txt_carname"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center_horizontal"
android:text="Car Name"
android:textSize="25dip" />
<ImageView
android:id="@+id/car_image"
android:layout_width="150dp"
android:layout_height="150dp"
android:layout_gravity="center_horizontal" />
<LinearLayout
android:layout_width="300dp"
android:layout_height="wrap_content"
android:layout_marginTop="20dp"
android:orientation="horizontal" >
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginLeft="20dp"
android:text="Launch Date:"
android:textStyle="bold" />
Vision:-
“To mould technocrat in the field of computer engineering with innovation skills, moral values & societal concerns.”
<TextView
android:id="@+id/txt_launch_date"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginLeft="20dp"
android:text="00-00-0000" />
</LinearLayout>
<LinearLayout
android:layout_width="300dp"
android:layout_height="wrap_content"
android:layout_marginTop="20dp"
android:orientation="horizontal" >
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginLeft="20dp"
android:text="Price:"
android:textStyle="bold" />
<TextView
android:id="@+id/txt_price"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginLeft="20dp"
android:text="3L Rs/-" />
</LinearLayout>
</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.carlistview;
import android.app.Activity;
import android.content.Intent;
import android.graphics.Color;
import android.os.Bundle;
import android.view.View;
import android.widget.AdapterView;
import android.widget.AdapterView.OnItemClickListener;
import android.widget.ArrayAdapter;
import android.widget.ListView;
ListView lv_car;
String[] cars = new String[] { "BMW-i8", "Hyundai New Sonata",
"Honda New Jazz", "Audi TT Roadster", "Ford New Figo" };
String[] launched_date = new String[] { "01-01-2015", "01-02-2015",
"01-03-2015", "01-04-2015", "01-05-2015" };
String[] price = new String[] { "10,000", "20,000", "30,000", "40,000",
"50,000" };
String[] images = new String[] { "bmw_i8", "hyundai_new_sonata",
"honda_new_jazz", "audi_tt_roadster", "ford_new_figo" };
Vision:-
“To mould technocrat in the field of computer engineering with innovation skills, moral values & societal concerns.”
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
lv_car.setOnItemClickListener(new OnItemClickListener() {
@Override
public void onItemClick(AdapterView<?> arg0, View arg1,
int selected, long arg3) ;
// TODO Auto-generated method stub
Intent i = new Intent(MainActivity.this, CarDetail.class);
i.putExtra("cars", cars[selected]);
i.putExtra("launched_date", launched_date[selected]);
i.putExtra("price", price[selected]);
i.putExtra("images", images[selected]);
startActivity(i);
}
});
}
}
Vision:-
“To mould technocrat in the field of computer engineering with innovation skills, moral values & societal concerns.”
Car_Details.java
package com.example.carlistview;
import android.app.Activity;
import android.content.Intent;
import android.content.res.Resources.NotFoundException;
import android.graphics.drawable.Drawable;
import android.os.Bundle;
import android.widget.ImageView;
import android.widget.TextView;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.car_detail);
txt_carname = (TextView) findViewById(R.id.txt_carname);
txt_launch_date = (TextView) findViewById(R.id.txt_launch_date);
txt_price = (TextView) findViewById(R.id.txt_price);
car_image = (ImageView) findViewById(R.id.car_image);
Intent i = getIntent();
String carname = i.getStringExtra("cars");
String launched_date = i.getStringExtra("launched_date");
String price = i.getStringExtra("price");
Vision:-
“To mould technocrat in the field of computer engineering with innovation skills, moral values & societal concerns.”
try {
int id = getResources().getIdentifier(image, "drawable",
getPackageName());
Drawable d = getResources().getDrawable(id);
car_image.setImageDrawable(d);
} catch (NotFoundException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
}
}
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.carlistview.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.carlistview.CarDetail"
android:label="@string/title_activity_car_detail" />
</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.”
EXPERIMENT:- 12
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" >
<ScrollView
android:id="@+id/sv1"
android:layout_width="fill_parent"
android:layout_height="fill_parent">
<LinearLayout
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:orientation="vertical">
Vision:-
“To mould technocrat in the field of computer engineering with innovation skills, moral values & societal concerns.”
<ImageView
android:src="@drawable/go"
android:layout_width="fill_parent"
android:layout_height="wrap_content"/>
<ImageView
android:src="@drawable/images"
android:layout_width="fill_parent"
android:layout_height="wrap_content"/>
<ImageView
android:src="@drawable/diff"
android:layout_width="fill_parent"
android:layout_height="wrap_content"/>
</LinearLayout>
</ScrollView>
</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.registrationmodule;
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:-
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.example.registrationmodule "
android:versionCode="1"
android:versionName="1.0" >
<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.registrationmodule.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.”
EXPERIMENT:- 13
AIM:- Create spinner with strings taken from resource folder(res >> value
folder). On changing spinner value, change background of screen.
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" >
<Spinner
android:id="@+id/spn"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:entries="@array/color"
android:prompt="@string/hello_world"/>
</RelativeLayout>
Vision:-
“To mould technocrat in the field of computer engineering with innovation skills, moral values & societal concerns.”
strings.xml
<string-array name="color">
<item>GREEN</item>
<item>BLUE</item>
<item>BLACK</item>
</string-array>
</resources>
Vision:-
“To mould technocrat in the field of computer engineering with innovation skills, moral values & societal concerns.”
JAVA File:-
MainActivity.java
package com.example.spinnerdemo;
import android.app.Activity;
import android.graphics.Color;
import android.os.Bundle;
import android.view.View;
import android.widget.AdapterView;
import android.widget.AdapterView.OnItemSelectedListener;
import android.widget.RelativeLayout;
import android.widget.Spinner;
RelativeLayout relative;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
spn.setOnItemSelectedListener(new OnItemSelectedListener() {
Vision:-
“To mould technocrat in the field of computer engineering with innovation skills, moral values & societal concerns.”
@Override
public void onItemSelected(AdapterView<?> arg0, View arg1,
int arg2, long arg3) {
switch (arg2) {
case 0:
relative.setBackgroundColor(Color.GREEN);
break;
case 1:
relative.setBackgroundColor(Color.BLUE);
break;
case 2:
relative.setBackgroundColor(Color.BLACK);
break;
default:
break;
}
}
@Override
public void onNothingSelected(AdapterView<?> arg0) { } });
}
}
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.spinnerdemo.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.”
EXPERIMENT:- 14
AIM:- Create an application that will get the Text Entered in Edit Text
and display that Text using Custom Toast(message) With Duration.
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" >
<EditText
android:id="@+id/editText1"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentTop="true"
android:layout_centerHorizontal="true"
android:layout_marginTop="106dp"
android:hint="Enter Message..."
android:ems="10" />
Vision:-
“To mould technocrat in the field of computer engineering with innovation skills, moral values & societal concerns.”
<Button
android:id="@+id/button1"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_below="@+id/editText1"
android:layout_centerHorizontal="true"
android:layout_marginTop="26dp"
android:onClick="display"
android:text="Display" />
</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.toastfromeditview;
import android.app.Activity;
import android.os.Bundle;
import android.view.View;
import android.view.View.OnClickListener;
import android.widget.Button;
import android.widget.EditText;
import android.widget.Toast;
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.toastfromeditview.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.”
EXPERIMENT:- 15
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" >
</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.pr15;
import android.os.Bundle;
import android.app.Activity;
import android.app.AlertDialog;
import android.content.DialogInterface;
import android.content.DialogInterface.OnClickListener;
import android.widget.Toast;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
AlertDialog.Builder ad=new AlertDialog.Builder(this);
ad.setTitle("About MCA Object");
ad.setMessage("Do You Like MCA Subject??");
ad.setPositiveButton("Yes",new OnClickListener(){
public void onClick(DialogInterface dialog,int arg0){
Toast.makeText(getApplicationContext(), "I Would Like MCA Subject",
Toast.LENGTH_LONG).show();
}});
ad.setNegativeButton("No",new OnClickListener(){
public void onClick(DialogInterface dialog,int arg0) {
Toast.makeText(getApplicationContext(), "I Couldn't Like MCA Subject",
Toast.LENGTH_LONG).show();
Vision:-
“To mould technocrat in the field of computer engineering with innovation skills, moral values & societal concerns.”
}});
ad.setNeutralButton("Don't Decide",new OnClickListener(){
public void onClick(DialogInterface dialog,int arg0) {
Toast.makeText(getApplicationContext(), "I am Confuse!! ",
Toast.LENGTH_LONG).show();
}});
ad.show();
}
}
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.pr15.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.”