0% found this document useful (0 votes)
2 views

unit 4

The document provides syntax and attributes for creating TextView and ImageButton in Android, along with examples of XML layouts and Java code for implementing DatePicker and TimePicker functionalities. It also includes a program for converting temperature using a ToggleButton and outlines methods for DatePicker and TimePicker widgets. Additionally, it describes how to create a ListView, GridView, and ImageView in an Android application.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
2 views

unit 4

The document provides syntax and attributes for creating TextView and ImageButton in Android, along with examples of XML layouts and Java code for implementing DatePicker and TimePicker functionalities. It also includes a program for converting temperature using a ToggleButton and outlines methods for DatePicker and TimePicker widgets. Additionally, it describes how to create a ListView, GridView, and ImageView in an Android application.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 24

Q.1 State syntax to create Text View and Image button with any two attributes of each.

( 4M)

Text View:

Syntax : " android:text=""/> Attributes/Properties of TextView:

● id: Supply an identifier name of this view, to later retrieve it with View.findViewByID() or
Activity.findViewById()

● alpha: alpha property of the view as a value between 0 (entirely transparent) and
1(Completely Opaque). [flag]

● auto link: Controls whether links such as urls and email addresses are automatically found
and converted to clickable links.[flag]

● gravity: The gravity attribute is an optional attribute which is used to control the alignment of
the text like left, right, center, top, bottom, center_vertical, center_horizontal etc

● text: text attribute is used to set the text in a text view. We can set the text in xml aswell as in
the java class.

● textColor: textColor attribute is used to set the text color of a text view. Color value is in the
form of “#argb”, “#rgb”, “#rrggbb”, or “#aarrggbb”.

● textSize: textSize attribute is used to set the size of text of a text view. We can set the text size
in sp(scale independent pixel) or dp(density pixel).

● textStyle: textStyle attribute is used to set the text style of a text view. The possible text styles
are bold, italic and normal. If we need to use two or more styles for a text view then “|”
operator is used for that.

● background: background attribute is used to set the background of a text view. We can set a
color or a drawable in the background of a text view.

● padding: padding attribute is used to set the padding from left, right, top or bottom. In above
example code of background we also set the 10dp padding from all the sides of text view.
ImageButton:

Syntax : Attributes/Properties of ImageButton:

● id: id is an attribute used to uniquely identify a image button. Below is the example code in
which we set the id of a image button.

● src: src is an attribute used to set a source file of image or you can say image in your image
button to make your layout look attractive.
● background: background attribute is used to set the background of an image button. We can
set a color or a drawable in the background of a Button.

● padding: padding attribute is used to set the padding from left, right, top or bottom of the
ImageButton.

Write a program to demonstrate Date and Time picker. (Note: Consider the appropriate XML
file. All attributes are not required. In java file all imports are not expected. Different relevant
logic/code can be considered.) 4 M

Ans :activity_main.xml<?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"

tools:context=".MainActivity">

<TextView

android:id="@+id/tvDate"

android:layout_width="149dp"

android:layout_height="46dp"

android:layout_marginEnd="224dp"

android:layout_marginBottom="312dp"

android:textSize="20dp"

android:textStyle="bold"

app:layout_constraintBottom_toBottomOf="parent"

app:layout_constraintEnd_toEndOf="parent" />

<Button

android:id="@+id/btnDate"
android:layout_width="wrap_content"

android:layout_height="wrap_content"

android:layout_marginEnd="96dp"

android:layout_marginBottom="312dp"

android:text="Set Date"

app:layout_constraintBottom_toBottomOf="parent"

app:layout_constraintEnd_toEndOf="parent"

tools:ignore="DuplicateClickableBoundsCheck" />

<DatePicker

android:id="@+id/dtpcker"

android:layout_width="314dp"

android:layout_height="293dp"

android:layout_marginBottom="368dp"

android:datePickerMode="spinner"

app:layout_constraintBottom_toBottomOf="parent"

app:layout_constraintEnd_toEndOf="parent"

app:layout_constraintHorizontal_bias="0.36"

app:layout_constraintStart_toStartOf="parent" />

<TimePicker

android:id="@+id/timepcker"

android:layout_width="184dp"

android:layout_height="195dp"

android:layout_marginEnd="132dp"

android:layout_marginBottom="108dp"

android:timePickerMode="spinner"

app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent" />

<TextView

android:id="@+id/tvTime"

android:layout_width="130dp"
android:layout_height="56dp"

android:layout_marginEnd="232dp"

android:layout_marginBottom="40dp"

android:textSize="20dp"

android:textStyle="bold"

app:layout_constraintBottom_toBottomOf="parent"

app:layout_constraintEnd_toEndOf="parent" />

<Button

android:id="@+id/btnTime"

android:layout_width="wrap_content"

android:layout_height="wrap_content"

android:layout_marginEnd="104dp"

android:layout_marginBottom="48dp"

android:text="Set Time"

app:layout_constraintBottom_toBottomOf="parent"

app:layout_constraintEnd_toEndOf="parent" />

</androidx.constraintlayout.widget.ConstraintLayout>

MainActivity.java

package com.example.datepickereg;

import androidx.appcompat.app.AppCompatActivity;

import android.app.DatePickerDialog;

import android.app.TimePickerDialog;
import android.os.Bundle;

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 {

TextView tvDate,tvTime;

DatePicker dtpcker;

TimePicker timepcker;

Button b1,b2;

@Override

protected void onCreate(Bundle savedInstanceState) {

super.onCreate(savedInstanceState);

setContentView(R.layout.activity_main);

tvDate=findViewById(R.id.tvDate);

tvTime=findViewById(R.id.tvTime);

b1=findViewById(R.id.btnDate);

b2=findViewById(R.id.btnTime);

dtpcker=findViewById(R.id.dtpcker);

timepcker=findViewById(R.id.timepcker);

b1.setOnClickListener(new View.OnClickListener() {

@Override

public void onClick(View view) {

tvDate.setText("Date : "+dtpcker.getDayOfMonth()+"-
"+dtpcker.getMonth()+"-"+dtpcker.getYear());

});

b2.setOnClickListener(new View.OnClickListener() {

@Override

public void onClick(View view) {

tvTime.setText(timepcker.getCurrentHour()+":"+timepcker.getCurrentMinute());

});

Name any four attributes of Edit Text control. (2M)

Ans:

android:id

android: gravity

android: text

android: hint

android: textColor

android: textSize

android: textStyle

android: background

List any two attributes of Toggle Button (2M)

Ans:

1. android:textOff

2. android:textOn
3. android:id

4. android:checked

5. android:gravity

6. android:textColor

7. android:textSize

8. android: textStyle

Write a program to convert temperature from celcius to farenhite and vice versa using Toggle
button. (Design UI as per your choice. Write XML and java file) (Note: Consider the
appropriate XML file. All attributes are not required. In java file all imports are not expected.
Different relevant logic/code can be considered.) (4M)

activity_main.xml

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

<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"

xmlns:app="http://schemas.android.com/apk/res-auto"

xmlns:tools="http://schemas.android.com/tools"

android:layout_width="match_parent"

android:layout_height="match_parent"

tools:context=".MainActivity">

<EditText

android:layout_width="match_parent"

android:layout_height="wrap_content"

android:id="@+id/edittext"

android:hint="Enter the temp"/>

<ToggleButton

android:id="@+id/togglebutton"

android:layout_width="wrap_content"

android:layout_height="wrap_content"
android:layout_below="@+id/edittext"

android:layout_marginTop="35dp"

android:textOff="F to C"

android:textOn="C to F" />

<Button

android:id="@+id/button"

android:layout_width="wrap_content"

android:layout_height="wrap_content"

android:layout_below="@id/togglebutton"

android:layout_marginTop="56dp" />

</RelativeLayout>

MainActivity.java

package com.example.p1;

import androidx.appcompat.app.AppCompatActivity;

import android.os.Bundle;

import android.view.View;

import android.widget.Button;

import android.widget.EditText;

import android.widget.Toast;

import android.widget.ToggleButton;

public class MainActivity extends AppCompatActivity {

Button b1;

EditText et;

ToggleButton tb;

Double a;

@Override
protected void onCreate(Bundle savedInstanceState) {

super.onCreate(savedInstanceState);

setContentView(R.layout.activity_main);

et=findViewById(R.id.edittext);

b1=findViewById(R.id.button);

tb=findViewById(R.id.togglebutton);

b1.setOnClickListener(new View.OnClickListener() {

@Override

public void onClick(View v) {

if(tb.isChecked())

a=Double.parseDouble(String.valueOf(et.getText()));

Double b=a*9/5+32;

String r=String.valueOf(b);

Toast.makeText(MainActivity.this,r+"°F",Toast.LENGTH_SHORT).show();

else

a=Double.parseDouble(String.valueOf(et.getText()));

Double b=a-32;

Double c=b*5/9;

String r=String.valueOf(c);

Toast.makeText(MainActivity.this,r+"°C",Toast.LENGTH_SHORT).show();

});
}

Explain data and time picker with its method. 4 M

Ans

Date Picker: In Android, DatePicker is a widget used to select a date. It allows to select date by
day, month and year in our custom UI (user interface). If we need to show this view as a dialog
then we have to use a DatePickerDialog class. Methods of DatePicker:

1. setSpinnersShown(boolean shown): This method is used to set whether the spinner of the

date picker in shown or not. In this method you have to set a Boolean value either true or false.

True indicates spinner is shown, false value indicates spinner is not shown. Default value for

this function is true.

Syntax:

DatePicker simpleDatePicker = (DatePicker)findViewById(R.id.simpleDatePicker);

simpleDatePicker.setSpinnersShown(false);

2. getDayOfMonth(): This method is used to get the selected day of the month from a date

picker.

This method returns an integer value.

DatePicker simpleDatePicker = (DatePicker) findViewById(R.id.simpleDatePicker);

int day = simpleDatePicker.getDayOfMonth();

3. getMonth(): This method is used to get the selected month from a date picker. This method

returns an integer value.

DatePicker simpleDatePicker = (DatePicker)findViewById(R.id.simpleDatePicker);

int month = simpleDatePicker.getMonth();

4. getYear(): This method is used to get the selected year from a date picker. This method

returns an integer value.

DatePicker simpleDatePicker = (DatePicker)findViewById(R.id.simpleDatePicker);


int year = simpleDatePicker.getYear();

5. getFirstDayOfWeek(): This method is used to get the first day of the week. This method

returns an integer value.

DatePicker simpleDatePicker = (DatePicker)findViewById(R.id.simpleDatePicker);

int firstDay=simpleDatePicker.getFirstDayOfWeek();

TimePicker:

In Android, TimePicker is a widget used for selecting the time of the day in either AM/PM

mode or 24 hours mode. The displayed time consist of hours, minutes and clock format. If we

need to show this view as a Dialog then we have to use a TimePickerDialog class.

Methods of TimePicker:

1. setCurrentHour(Integer currentHour): This method is used to set the current hours in a

time picker.

setHour(Integer hour): setCurrentHour() method was deprecated in API level 23. From api

level 23 we have to use setHour(Integer hour). In this method there is only one parameter of

integer type which is used to set the value for hours.

TimePicker simpleTimePicker=(TimePicker)findViewById(R.id.simpleTimePicker);

simpleTimePicker.setCurrentHour(5);

simpleTimePicker.setHour(5);

2. setCurrentMinute(Integer currentMinute): This method is used to set the current minutes

in a time picker. setMinute(Integer minute): setCurrentMinute() method was deprecated in API

level 23. From api level 23 we have to use setMinute(Integer minute). In this method there is

only one parameter of integer type which set the value for minutes.

TimePicker simpleTimePicker=(TimePicker)findViewById(R.id.simpleTimePicker);

simpleTimePicker.setCurrentMinute(35);

simpleTimePicker.setMinute(35);
4. getCurrentMinute(): This method is used to get the current minutes from a time picker.
getMinute(): getCurrentMinute() method was deprecated in API level 23. From api level 23

we have to use getMinute(). This method returns an integer value.

TimePicker simpleTimePicker = (TimePicker)findViewById(R.id.simpleTimePicker);

int minutes = simpleTimePicker.getCurrentMinute();

int minutes = simpleTimePicker.getMinute();

5. setIs24HourView(Boolean is24HourView): This method is used to set the mode of the

Time picker either 24 hour mode or AM/PM mode. In this method we set a Boolean value

either true or false. True value indicate 24 hour mode and false value indicate AM/PM mode.

TimePicker simpleTimePicker = (TimePicker)findViewById(R.id.simpleTimePicker);

simpleTimePicker.setIs24HourView(true);

6. is24HourView(): This method is used to check the current mode of the time picker. This

method returns true if its 24 hour mode or false if AM/PM mode is set.

TimePicker simpleTimePicker = (TimePicker)findViewById(R.id.simpleTimePicker);

Boolean mode=simpleTimePicker.is24HourView();

7.setOnTimeChangedListener(TimePicker.OnTimeChangedListener

onTimeChanged(): This method is used to set the callback that indicates the time has been

adjusted by the user.

onTimeChanged(TimePicker view, int hourOfDay, int minute) is an override function of this

listener in which we have three parameters first is for TimePicker, second for getting hour of

the day and last is for getting the minutes after changing the time of the time picker.

TimePicker simpleTimePicker = (TimePicker)findViewById(R.id.simpleTimePicker);

simpleTimePicker.setOnTimeChangedListener(new TimePicker.OnTimeChangedListener() {

@Override

public void onTimeChanged(TimePicker view, int hourOfDay, int minute) {

}
});

Develop a program to implement

i) List view of 5 items

ii) Grid view of 4 x 4 items

iii) Image view.


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

<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"

xmlns:tools="http://schemas.android.com/tools"

xmlns:app="http://schemas.android.com/apk/res-auto"

android:layout_width="match_parent"

android:layout_height="match_parent"

android:orientation="vertical"

tools:context=".MainActivity">

<ListView

android:id="@+id/sample_list"

android:layout_width="match_parent"

android:layout_height="wrap_content" >

</ListView>

<GridView

android:id="@+id/gridview1"

android:layout_width="fill_parent"

android:layout_height="wrap_content"

android:columnWidth="50dp"

android:gravity="center"

android:numColumns="auto_fit"

android:stretchMode="columnWidth" >
</GridView>

<ImageView

android:id="@+id/full_logo"

android:layout_width="match_parent"android:layout_height="wrap_content"

app:srcCompat="@drawable/android_logo" />

</LinearLayout>

Placed image that has to be displayed in drawable folder

package in.msbte.controls_exam_ques;

import androidx.appcompat.app.AppCompatActivity;

import android.os.Bundle;

import android.widget.ArrayAdapter;

import android.widget.GridView;

import android.widget.ListView;

public class MainActivity extends AppCompatActivity {

String[] sampleArray = {"Item 1","Item 2","Item 3","Item 4", "Item 5"};

GridView gridView;

static final String[] alphabets = new String[]{

"A", "B", "C", "D", "E",

"F", "G", "H", "I", "J",

"K", "L", "M", "N", "O",

"P", "Q", "R", "S", "T",

"U", "V", "W", "X", "Y", "Z"

};

ArrayAdapter adapter, adapter1;

@Override

protected void onCreate(Bundle savedInstanceState) {


super.onCreate(savedInstanceState);

setContentView(R.layout.activity_main);

//List View

adapter = new ArrayAdapter<String>(this, R.layout.simple_item, sampleArray);

ListView listView = (ListView) findViewById(R.id.sample_list);

listView.setAdapter(adapter);

//Grid View

gridView = (GridView) findViewById(R.id.gridview1);

adapter1 = new ArrayAdapter<String>(this, R.layout.simple_item, alphabets);

gridView.setAdapter(adapter1);

}
Explain Gridview with its attributes with suitable example. (4M)

GridView :

Android GridView shows items in two-dimensional scrolling grid (rows & columns) and the

grid items are not necessarily predetermined but they automatically inserted to the layout

using a ListAdapter.

GridView Attributes

Following are the important attributes specific to GridView –

Sr.No Attribute & Description

1 android:id

This is the ID which uniquely identifies the layout.

2 android:columnWidth

This specifies the fixed width for each column. This could be in px, dp,

sp, in, or mm.

3 android:gravity
Specifies the gravity within each cell. Possible values are top, bottom,

left, right, center, center_vertical, center_horizontal etc.

4 android:horizontalSpacing

Defines the default horizontal spacing between columns. This could be

in px, dp, sp, in, or mm.

5 android:numColumns

Defines how many columns to show. May be an integer value, such as

"100" or auto_fit which means display as many columns as possible to

fill the available space.

6 android:stretchMode

Defines how columns should stretch to fill the available empty space, if

any. This must be either of the values −

• none − Stretching is disabled.

• spacingWidth − The spacing between each column is stretched.

• columnWidth − Each column is stretched equally.

• spacingWidthUniform − The spacing between each column is

uniformly stretched..

7 android:verticalSpacing

Defines the default vertical spacing between rows. This could be in px,

dp, sp, in, or mm.

activity_main.xml Code :

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

<GridView 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:id="@+id/gridview"
android:layout_width="fill_parent"

android:layout_height="fill_parent"

android:columnWidth="90dp"

android:gravity="center"

android:horizontalSpacing="10dp"

android:numColumns="auto_fit"

android:stretchMode="columnWidth"

android:verticalSpacing="10dp"

tools:context=".MainActivity">

</GridView>

activity_listview.xml code :

<?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">

<Button

android:id="@+id/btn"

android:layout_width="fill_parent"

android:layout_height="wrap_content"

android:layout_gravity="center" />

</LinearLayout>

MainActivity.java

package com.example.myapplication.gridviewbuttons;

import android.os.Bundle;
import android.widget.ArrayAdapter;

import android.widget.GridView;

import androidx.appcompat.app.AppCompatActivity;

public class MainActivity extends AppCompatActivity {

GridView gridview;

String arr[] = new String[15];

@Override

protected void onCreate(Bundle savedInstanceState) {

super.onCreate(savedInstanceState);

setContentView(R.layout.activity_main);

gridview = findViewById(R.id.gridview);

for (int i = 0; i < 15; i++) {

arr[i] = Integer.toString(i + 1);

ArrayAdapter<String> ad = new ArrayAdapter<String>(this, R.layout.activity_listview,

R.id.btn, arr);

gridview.setAdapter(ad);

}
Develop an android application using radio button.

Consider any relevant example of Radio Button and in XML file, consider

minimum attributes]

activity_main.xml

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

<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"

xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools=http://schemas.android.com/tools

android:layout_width="match_parent"

android:layout_height="match_parent"

android:padding="30dp"

tools:context=".frame">

<TextView android:id="@+id/text1"

android:layout_width="match_parent"

android:layout_height="wrap_content"

android:text="Radio Button"

android:textSize="20dp"

android:gravity="center"

android:textColor="#f00"/>

<RadioGroup android:id="@+id/group"

android:layout_width="match_parent"

android:layout_height="wrap_content"

android:layout_below="@+id/text1">

<RadioButton android:id="@+id/male"

android:layout_width="wrap_content"

android:layout_height="wrap_content"

android:text="Male"/>

<RadioButton

android:id="@+id/female"

android:layout_width="wrap_content"

android:layout_height="wrap_content"

android:layout_below="@+id/male"

android:text="Female"/>
</RadioGroup>

<Button android:id="@+id/submit"

android:layout_width="wrap_content"

android:layout_height="wrap_content"

android:layout_below="@+id/group"

android:layout_marginTop="99dp"

android:layout_centerHorizontal="true"

android:text="Submit" />

</RelativeLayout>

Java File:

package com.example.ifcdiv;

import androidx.appcompat.app.AppCompatActivity;

import android.os.Bundle;

import android.view.View;

import android.widget.Button;

import android.widget.RadioButton;

import android.widget.Toast;

public class frame extends AppCompatActivity

RadioButton male,female;

Button b1;

@Override

protected void onCreate(Bundle savedInstanceState)

super.onCreate(savedInstanceState);

setContentView(R.layout.activity_frame);
male=findViewById(R.id.male);

female=findViewById(R.id.female);

b1=findViewById(R.id.submit);

b1.setOnClickListener(new View.OnClickListener()

@Override

public void onClick(View v)

String selected; if(male.isChecked())

selected="You selected"+male.getText();

else

selected="You Selected"+female.getText();

Toast.makeText(getApplicationContext(),selected,Toast.LENGTH_LONG).show();

} });

Write a program to capture an image using camera and display it.

Note: Consider the appropriate XML file. All attributes are not required. In java file all imports
are not expected. Different relevant logic/code can be considered.)

activity_main.xml

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

<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"

xmlns:tools="http://schemas.android.com/tools"

android:layout_width="match_parent"

android:layout_height="match_parent"

android:padding="40dp"

android:orientation="horizontal"

tools:context=".MainActivity">

<TextView

android:layout_width="match_parent"

android:layout_height="wrap_content"

android:text="CAMERA"

android:id="@+id/text"

android:textSize="20dp"

android:gravity="center"/>

<ImageView

android:id="@+id/image"

android:layout_width="match_parent"

android:layout_height="wrap_content"

android:layout_below="@+id/text"

android:layout_marginTop="81dp"

android:src="@drawable/rose"/>

<Button

android:id="@+id/photo"

android:layout_width="wrap_content"

android:layout_height="wrap_content"

android:layout_below="@+id/image"
android:layout_centerHorizontal="true"

android:layout_marginTop="30dp"

android:text="TAKE PHOTO" />

</RelativeLayout>

MainActivity.java

package com.example.ifcdiv;

import androidx.appcompat.app.AppCompatActivity;

import android.content.Intent;

import android.graphics.Bitmap; import android.os.Bundle;

import android.provider.MediaStore;

import android.view.View;

import android.widget.Button;

import android.widget.ImageView;

public class MainActivity extends AppCompatActivity {

Button b1;

ImageView imageView;

int CAMERA_REQUEST=1;

@Override protected void onCreate(Bundle savedInstanceState) {

super.onCreate(savedInstanceState); setContentView(R.layout.activity_main);

b1=findViewById(R.id.photo); imageView=findViewById(R.id.image);

b1.setOnClickListener(new View.OnClickListener() {

@Override public void onClick(View v) {

Intent i=new Intent(MediaStore.ACTION_IMAGE_CAPTURE);

startActivityForResult(i,CAMERA_REQUEST); } }); }

@Override protected void onActivityResult(int requestCode, int resultCode, @Nullable


Intent data) { super.onActivityResult(requestCode, resultCode, data);

if (requestCode==CAMERA_REQUEST) { Bitmap image= (Bitmap)

data.getExtras().get("data");

imageView.setImageBitmap(image); } } }

You might also like