0% found this document useful (0 votes)
26 views48 pages

Android Practical Lab Manual CSE

Uploaded by

ROHAN A
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
26 views48 pages

Android Practical Lab Manual CSE

Uploaded by

ROHAN A
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 48

POLYTECHNIC CSE PRACTICAL

LAB MANUAL

DEVELOPMENT OF
ANDROID
APPLICATION

NAME - ROHAN
COURSE - POLYTECHNIC
BRANCH - CSE 2ND YEAR
POLYTECHNIC CSE PRACTICAL
LAB MANUAL

PRACTICAL LIST
COMPUTER SCIENCE AND
ENGINEERING 3RD YEAR

NAME - ROHAN
COURSE - POLYTECHNIC
BRANCH - CSE 3RD YEAR
HOW TO CONDUCT CSE LAB PRACTICAL AND
RULES -

1.Practice all the practicals on system Desktop /laptop


in college .

2. Every student should have carry a fair register For Note Down
Summary of Practical which was do him/her in Lab.

3. Without Register there is No Entry In Computer Lab.


4. practical Conduct Under Practical Procter.
5. Note Down the Practical summary Is Most Important part
of the practical.
6. After the completion of each practical the Procter cross
Questions to Students For Know How Much Effective the
Practical Session.
PRACTICALS LIST

1. Install the Android Studio and Setup the Development Environment


2. Write a program to demonstrate activity (Application Life Cycle)
3. Write a program to demonstrate different types of layouts
4. Write a program to implement simple calculator using text view, edit view,
option button and button
5. Write a program to develop app having multiple activities and user should be
able switch between the
activities by using intents.
6. Write a program to demonstrate list view
7. Write a program to demonstrate photo gallery
8. Write a program to demonstrate Date picker and time picker
9. Develop an simple application with context menu and option menu.
10. Write a program to demonstrate the functionality of Shared Preferences.
11. Develop a sample Android application having navigation items similar to Gmail
Application.
12. Write a program to demonstrate a service
13. Write a program to demonstrate the application of intent class
14. Write a program to create a text file in a external memory
15. Write a program to store and fetch data from SQL life database.
PRACTICAL NO: 1
OBJECT - Install the Android Studio and Setup the Development
Environment

Theory -
How to Install and Set up Android Studio on Windows?

INSTRUCTOR - ROHAN
INSTRUCTOR - ROHAN
INSTRUCTOR - ROHAN
INSTRUCTOR - ROHAN
INSTRUCTOR - ROHAN
INSTRUCTOR - ROHAN
INSTRUCTOR - ROHAN
INSTRUCTOR - ROHAN
INSTRUCTOR - ROHAN
PRACTICAL NO: 2
OBJECT - Write a program to demonstrate activity (Application
Life Cycle)

THEORY -

INSTRUCTOR - ROHAN
/** Called when the activity is about to become visible. */
@Override
protected void onStart() {
super.onStart();
Log.d(msg, "The onStart() event");
}

/** Called when the activity has become visible. */


@Override
protected void onResume() {
super.onResume();
Log.d(msg, "The onResume() event");
}

/** Called when another activity is taking focus. */


@Override
protected void onPause() {
super.onPause();
Log.d(msg, "The onPause() event");
}

/** Called when the activity is no longer visible. */


@Override
protected void onStop() {
super.onStop();
Log.d(msg, "The onStop() event");
}

/** Called just before the activity is destroyed. */


@Override
public void onDestroy() {
super.onDestroy();
Log.d(msg, "The onDestroy() event");
}
}
INSTRUCTOR - ROHAN
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.example.tutorialspoint7.myapplication">

<application
android:allowBackup="true"
android:icon="@mipmap/ic_launcher"
android:label="@string/app_name"
android:supportsRtl="true"
android:theme="@style/AppTheme">
<activity android:name=".MainActivity">
<intent-filter>
<action android:name="android.intent.action.MAIN" />

<category android:name="android.intent.category.LAUNCHER" />


</intent-filter>
</activity>
</application>

</manifest>
INSTRUCTOR - ROHAN
PRACTICAL NO: 3
OBJECT - Write a program to demonstrate different types of layouts

THEORY -

<?xml version="1.0" encoding="utf-8"?>


<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical">

<!-- Linear Layout -->


<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="horizontal">

<Button
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Button 1" />

<Button
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Button 2" />
</LinearLayout>

INSTRUCTOR - ROHAN
<!-- Relative Layout -->
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="wrap_content">

<Button
android:id="@+id/button3"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Button 3"
android:layout_alignParentStart="true" />

<Button
android:id="@+id/button4"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Button 4"
android:layout_alignParentEnd="true" />
</RelativeLayout>
<!-- Constraint Layout -->
<androidx.constraintlayout.widget.ConstraintLayout
android:layout_width="match_parent"
android:layout_height="wrap_content">

<Button
android:id="@+id/button5"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Button 5"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent" />

<Button
android:id="@+id/button6"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Button 6"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintTop_toTopOf="parent" />
</androidx.constraintlayout.widget.ConstraintLayout>
</LinearLayout>
INSTRUCTOR - ROHAN
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);

Button button3 = findViewById(R.id.button3);


Button button4 = findViewById(R.id.button4);
Button button5 = findViewById(R.id.button5);
Button button6 = findViewById(R.id.button6);

button3.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
Toast.makeText(MainActivity.this, "Button 3 Clicked", Toast.LENGTH_SHORT).show();
}
});

button4.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
Toast.makeText(MainActivity.this, "Button 4 Clicked", Toast.LENGTH_SHORT).show();
}
});

button5.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
Toast.makeText(MainActivity.this, "Button 5 Clicked", Toast.LENGTH_SHORT).show();
}
});

button6.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
Toast.makeText(MainActivity.this, "Button 6 Clicked", Toast.LENGTH_SHORT).show();
}
});
}
INSTRUCTOR - ROHAN
INSTRUCTOR - ROHAN
PRACTICAL NO: 5
OBJECT - Programming exercises on formatting input/output using
printf and scanf and their return type values.

<?xml version="1.0" encoding="utf-8"?>


<androidx.constraintlayout.widget.ConstraintLayout
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"
android:background="#8BC34A"
android:backgroundTint="@android:color/darker_gray"
tools:context=".MainActivity">

INSTRUCTOR - ROHAN
<!-- Text View to display our basic heading of "calculator"-->
<TextView
android:layout_width="194dp"
android:layout_height="43dp"
android:layout_marginStart="114dp"
android:layout_marginLeft="114dp"
android:layout_marginTop="58dp"
android:layout_marginEnd="103dp"
android:layout_marginRight="103dp"
android:layout_marginBottom="502dp"
android:scrollbarSize="30dp"
android:text=" Calculator"
android:textAppearance="@style/TextAppearance.AppCompat.Body1"
android:textSize="30dp"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent" />

<!-- Edit Text View to input the values -->


<EditText
android:id="@+id/num1"
android:layout_width="364dp"
android:layout_height="28dp"
android:layout_marginStart="72dp"
android:layout_marginTop="70dp"
android:layout_marginEnd="71dp"
android:layout_marginBottom="416dp"
android:background="@android:color/white"
android:ems="10"
android:onClick="clearTextNum1"
android:inputType="number"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent" />

INSTRUCTOR - ROHAN
<!-- Edit Text View to input 2nd value-->
<EditText
android:id="@+id/num2"
android:layout_width="363dp"
android:layout_height="30dp"
android:layout_marginStart="72dp"
android:layout_marginTop="112dp"
android:layout_marginEnd="71dp"
android:layout_marginBottom="374dp"
android:background="@android:color/white"
android:ems="10"
android:onClick="clearTextNum2"
android:inputType="number"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent" />

<!-- Text View to display result -->


<TextView
android:id="@+id/result"
android:layout_width="356dp"
android:layout_height="71dp"
android:layout_marginStart="41dp"
android:layout_marginTop="151dp"
android:layout_marginEnd="48dp"
android:layout_marginBottom="287dp"
android:background="@android:color/white"
android:text="result"
android:textColorLink="#673AB7"
android:textSize="25sp"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent" />

INSTRUCTOR - ROHAN
<!-- A button to perform 'sum' operation -->
<Button
android:id="@+id/sum"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginStart="16dp"
android:layout_marginTop="292dp"
android:layout_marginEnd="307dp"
android:layout_marginBottom="263dp"
android:backgroundTint="@android:color/holo_red_light"
android:onClick="doSum"
android:text="+"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent" />

<!-- A button to perform subtraction operation. -->

<!-- A button to perform division. -->

<Button
android:id="@+id/sub"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginStart="210dp"
android:layout_marginTop="292dp"
android:layout_marginEnd="113dp"
android:layout_marginBottom="263dp"
android:backgroundTint="@android:color/holo_red_light"
android:onClick="doSub"
android:text="-"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintHorizontal_bias="1.0"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent"
app:layout_constraintVertical_bias="0.507" />

INSTRUCTOR - ROHAN
<Button
android:id="@+id/div"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginStart="307dp"
android:layout_marginTop="292dp"
android:layout_marginEnd="16dp"
android:layout_marginBottom="263dp"
android:backgroundTint="@android:color/holo_red_light"
android:onClick="doDiv"
android:text="/"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintHorizontal_bias="0.0"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent" />

<!-- A button to perform multiplication. -->


<Button
android:id="@+id/mul"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginStart="16dp"
android:layout_marginTop="356dp"
android:layout_marginEnd="307dp"
android:layout_marginBottom="199dp"
android:backgroundTint="@android:color/holo_red_light"
android:onClick="doMul"
android:text="x"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent" />

INSTRUCTOR - ROHAN
<!-- A button to perform a modulus function. -->

<!-- A button to perform a power function. -->

<Button
android:id="@+id/button"
android:layout_width="103dp"
android:layout_height="46dp"
android:layout_marginStart="113dp"
android:layout_marginTop="356dp"
android:layout_marginEnd="206dp"
android:layout_marginBottom="199dp"
android:backgroundTint="@android:color/holo_red_light"
android:onClick="doMod"
android:text="%(mod)"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent"
app:layout_constraintVertical_bias="0.515" />

<Button
android:id="@+id/pow"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginStart="113dp"
android:layout_marginTop="292dp"
android:layout_marginEnd="210dp"
android:layout_marginBottom="263dp"
android:backgroundTint="@android:color/holo_red_light"
android:onClick="doPow"
android:text="n1^n2"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintHorizontal_bias="0.0"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent"
app:layout_constraintVertical_bias="0.507" />

</androidx.constraintlayout.widget.ConstraintLayout>
INSTRUCTOR - ROHAN
INSTRUCTOR - ROHAN
File: MainActivity.java

package com.example.calculator2;

import android.os.Bundle;

import com.google.android.material.snackbar.Snackbar;

import androidx.appcompat.app.AppCompatActivity;

import android.text.TextUtils;
import android.view.View;

import androidx.navigation.NavController;
import androidx.navigation.Navigation;
import androidx.navigation.ui.AppBarConfiguration;
import androidx.navigation.ui.NavigationUI;

import com.example.calculator2.databinding.ActivityMainBinding;

import android.view.Menu;
import android.view.MenuItem;

import android.os.Bundle;
import android.view.View;
import android.widget.EditText;
import android.widget.TextView;

import androidx.appcompat.app.AppCompatActivity;

public class MainActivity extends AppCompatActivity {

private AppBarConfiguration appBarConfiguration;


private ActivityMainBinding binding;
public EditText e1, e2;
TextView t1;
int num1, num2;

INSTRUCTOR - ROHAN
public boolean getNumbers() {

//checkAndClear();
// defining the edit text 1 to e1
e1 = (EditText) findViewById(R.id.num1);

// defining the edit text 2 to e2


e2 = (EditText) findViewById(R.id.num2);

// defining the text view to t1


t1 = (TextView) findViewById(R.id.result);

// taking input from text box 1


String s1 = e1.getText().toString();

// taking input from text box 2


String s2 = e2.getText().toString();

if(s1.equals("Please enter value 1") && s2.equals(null))


{
String result = "Please enter value 2";
e2.setText(result);
return false;
}
if(s1.equals(null) && s2.equals("Please enter value 2"))
{
String result = "Please enter value 1";
e1.setText(result);
return false;
}
if(s1.equals("Please enter value 1") || s2.equals("Please enter value 2"))
{
return false;
}

INSTRUCTOR - ROHAN
if((!s1.equals(null) && s2.equals(null))|| (!s1.equals("") && s2.equals("")) ){

String result = "Please enter value 2";

e2.setText(result);
return false;
}
if((s1.equals(null) && !s2.equals(null))|| (s1.equals("") && !s2.equals("")) ){
//checkAndClear();
String result = "Please enter value 1";
e1.setText(result);
return false;
}
if((s1.equals(null) && s2.equals(null))|| (s1.equals("") && s2.equals("")) ){
//checkAndClear();
String result1 = "Please enter value 1";
e1.setText(result1);
String result2 = "Please enter value 2";
e2.setText(result2);
return false;
}

else {
// converting string to int.
num1 = Integer.parseInt(s1);

// converting string to int.


num2 = Integer.parseInt(s2);

return true;
}

INSTRUCTOR - ROHAN
public void doSum(View v) {

// get the input numbers


if (getNumbers()) {
int sum = num1 + num2;
t1.setText(Integer.toString(sum));
}
else
{
t1.setText("Error Please enter Required Values");
}

}
public void clearTextNum1(View v) {

// get the input numbers


e1.getText().clear();
}
public void clearTextNum2(View v) {

// get the input numbers


e2.getText().clear();
}
public void doPow(View v) {

//checkAndClear();
// get the input numbers
if (getNumbers()) {
double sum = Math.pow(num1, num2);
t1.setText(Double.toString(sum));
}
else
{
t1.setText("Error Please enter Required Values");
}
}

// a public method to perform subtraction


public void doSub(View v) {
//checkAndClear();
// get the input numbers
if (getNumbers()) {
int sum = num1 - num2;
t1.setText(Integer.toString(sum));
}
else
{
t1.setText("Error Please enter Required Values");
}
} INSTRUCTOR - ROHAN
// a public method to perform multiplication
public void doMul(View v) {
//checkAndClear();
// get the input numbers
if (getNumbers()) {
int sum = num1 * num2;
t1.setText(Integer.toString(sum));
}
else
{
t1.setText("Error Please enter Required Values");
}
}

// a public method to perform Division


public void doDiv(View v) {
//checkAndClear();
// get the input numbers
if (getNumbers()) {

// displaying the text in text view assigned as t1


double sum = num1 / (num2 * 1.0);
t1.setText(Double.toString(sum));
}
else
{
t1.setText("Error Please enter Required Values");
}
}

// a public method to perform modulus function


public void doMod(View v) {
//checkAndClear();
// get the input numbers
if (getNumbers()) {
double sum = num1 % num2;
t1.setText(Double.toString(sum));
}
else
{
t1.setText("Error Please enter Required Values");
}
}
INSTRUCTOR - ROHAN
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
e1 = (EditText) findViewById(R.id.num1);
// defining the edit text 2 to e2
e2 = (EditText) findViewById(R.id.num2);
}

@Override
public boolean onCreateOptionsMenu(Menu menu) {
// Inflate the menu; this adds items to the action bar if it is present.
getMenuInflater().inflate(R.menu.menu_main, menu);
return true;
}

@Override
public boolean onOptionsItemSelected(MenuItem item) {
// Handle action bar item clicks here. The action bar will
// automatically handle clicks on the Home/Up button, so long
// as you specify a parent activity in AndroidManifest.xml.
int id = item.getItemId();

//noinspection SimplifiableIfStatement
if (id == R.id.action_settings) {
return true;
}

return super.onOptionsItemSelected(item);
}

@Override
public boolean onSupportNavigateUp() {
NavController navController = Navigation.findNavController(this,
R.id.nav_host_fragment_content_main);
return NavigationUI.navigateUp(navController, appBarConfiguration)
|| super.onSupportNavigateUp();
}
}

INSTRUCTOR - ROHAN
PRACTICAL NO: 6

OBJECT - Write a program to demonstrate list view

THEORY -

INSTRUCTOR - ROHAN
import androidx.appcompat.app.AppCompatActivity;
import android.os.Bundle;
import android.widget.AdapterView;
import android.widget.ArrayAdapter;
import android.widget.ListView;

public class MainActivity extends AppCompatActivity {

ListView l;
String tutorials[]
= { "Algorithms", "Data Structures",
"Languages", "Interview Corner",
"GATE", "ISRO CS",
"UGC NET CS", "CS Subjects",
"Web Technologies" };

@Override
protected void onCreate(Bundle savedInstanceState)
{
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
l = findViewById(R.id.list);
ArrayAdapter<String> arr;
arr
= new ArrayAdapter<String>(
this,
R.layout.support_simple_spinner_dropdown_item,
tutorials);
l.setAdapter(arr);
}
}

INSTRUCTOR - ROHAN
INSTRUCTOR - ROHAN
PRACTICAL NO: 7
OBJECT - Write a program to demonstrate Date picker and time picker

THEORY -

<?xml version="1.0" encoding="utf-8"?>


<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/btnPick"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_centerHorizontal="true"
android:layout_marginTop="30dp"
android:text="Pick Date and TIme"/>
<TextView
android:id="@+id/textView"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_centerInParent="true"
android:textSize="16sp"
android:textStyle="bold"/>
</RelativeLayout>

INSTRUCTOR - ROHAN
Step 3 − Add the following code to src/MainActivity.java
import android.app.DatePickerDialog;
import android.app.TimePickerDialog;
import android.support.v7.app.AppCompatActivity;
import android.os.Bundle;
import android.text.format.DateFormat;
import android.view.View;
import android.widget.Button;
import android.widget.DatePicker;
import android.widget.TextView;
import android.widget.TimePicker;
import java.util.Calendar;
public class MainActivity extends AppCompatActivity implements
DatePickerDialog.OnDateSetListener, TimePickerDialog.OnTimeSetListener {
TextView textView;
Button button;
int day, month, year, hour, minute;
int myday, myMonth, myYear, myHour, myMinute;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
textView = findViewById(R.id.textView);
button = findViewById(R.id.btnPick);
button.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
Calendar calendar = Calendar.getInstance();
year = calendar.get(Calendar.YEAR);
month = calendar.get(Calendar.MONTH);
day = calendar.get(Calendar.DAY_OF_MONTH);
DatePickerDialog datePickerDialog = new DatePickerDialog(MainActivity.this,
MainActivity.this,year, month,day);
datePickerDialog.show();
}
});
}
@Override
public void onDateSet(DatePicker view, int year, int month, int dayOfMonth) {
myYear = year;
myday = day;
myMonth = month;
Calendar c = Calendar.getInstance();
hour = c.get(Calendar.HOUR);
minute = c.get(Calendar.MINUTE);
TimePickerDialog timePickerDialog = new TimePickerDialog(MainActivity.this,
MainActivity.this, hour, minute, DateFormat.is24HourFormat(this));
timePickerDialog.show();
}
INSTRUCTOR - ROHAN
@Override
public void onTimeSet(TimePicker view, int hourOfDay, int minute) {
myHour = hourOfDay;
myMinute = minute;
textView.setText("Year: " + myYear + "
"+
"Month: " + myMonth + "
"+
"Day: " + myday + "
"+
"Hour: " + myHour + "
"+
"Minute: " + myMinute);
}
}

Step 4 − Add the following code to androidManifest.xml

<?xml version="1.0" encoding="utf-8"?>


<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="app.com.sample">
<application
android:allowBackup="true"
android:icon="@mipmap/ic_launcher"
android:label="@string/app_name"
android:roundIcon="@mipmap/ic_launcher_round"
android:supportsRtl="true"
android:theme="@style/AppTheme">
<activity android:name=".MainActivity">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
</application>
</manifest>

INSTRUCTOR - ROHAN
INSTRUCTOR - ROHAN
PRACTICAL NO: 8
OBJECT - Programming exercises on switch statement C.

THEORY -

INSTRUCTOR - ROHAN
INSTRUCTOR - ROHAN
RESULT - we successfully understand and execute the switch
statement.

INSTRUCTOR - ROHAN
PRACTICAL NO: 9
OBJECT - Programming exercises on while and do - while statement.

THEORY -

C While Loop

INSTRUCTOR - ROHAN
C Do/While Loop

RESULT - we successfully understand and execute the while


and do while loop.

INSTRUCTOR - ROHAN
PRACTICAL NO: 10
OBJECT - Programming exercises on for statement.

THEORY -

C For Loop

INSTRUCTOR - ROHAN
RESULT - we successfully understand and execute the for
statement.

INSTRUCTOR - ROHAN
PRACTICAL NO: 10
OBJECT - Programming exercises on for statement.

THEORY -

C For Loop

INSTRUCTOR - ROHAN

You might also like