0% found this document useful (0 votes)
7 views37 pages

Android App Development Certificate 2023

Mr. Sahil Ramjan Saiyad from SY. BSc Computer Science has successfully completed practical work in Android Application Development during the academic year 2023-24 at Satish Pradhan Dnyanasadhana College, Thane. The document includes a detailed index of practical assignments, such as implementing control structures in Kotlin, creating Android applications with various UI components, and developing applications for image galleries and media players. The certificate is signed by the subject in-charge and the head of the department.

Uploaded by

armansaiyad1000
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)
7 views37 pages

Android App Development Certificate 2023

Mr. Sahil Ramjan Saiyad from SY. BSc Computer Science has successfully completed practical work in Android Application Development during the academic year 2023-24 at Satish Pradhan Dnyanasadhana College, Thane. The document includes a detailed index of practical assignments, such as implementing control structures in Kotlin, creating Android applications with various UI components, and developing applications for image galleries and media players. The certificate is signed by the subject in-charge and the head of the department.

Uploaded by

armansaiyad1000
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

Enter Seat No: -

SATISH PRADHAN DNYANASADHANA COLLEGE, THANE


(Arts,Science and Commerce)
Re-Accredited “B+”Grade (CGPA 2.69) by NAAC, ISO 21001:2018
(Certified) Affiliated To University of Mumbai

CERTIFICATE

This is to certify that Mr: Sahil Ramjan Saiyad of SY. BSc Computer Science
(Semester-IV) Class has successfully completed all the practical work in subject
Android Application Development, under the guidance of Asst Prof. Uzma
Shaikh (subject in charge) during Year 2023-24 in partial fulfilment of
Computer Science Practical Examination conducted by University of Mumbai.

Subject In-charge Head of the Department

Date:-
SATISH PRADHAN DNYANASADHANA COLLEGE, THANE [A.Y. 2023-24]
Name : Sahil Ramjan Saiyad Class: SY. [Link]. Computer Science
Subject: Android Application Development- Practical Roll no:52, Batch :B, Div :A

INDEX
SR PRACTICAL PAGE DATE SIGN
NO NO
I. Write a program using Kotlin to implement control
structures and loops.
1.
ii. Write a program to implement object-oriented
1 4/1/24
concepts in Kotlin.
I. Create an Android application to design screens
using different layouts and UI including Button, Edit
text, Text view, Radio Button [Link]. Write an
2. android application demonstrating response to
event/user interaction for a. Checkbox
4 16/1/24
b. Radio button
c. Button
d. Spinner
I. Create an application to create Image Flipper and
Image Gallery. On click on the image display the
3.
information about the image. 8 23/1/24
ii. Create an application to use Gridview for
shopping cart application.
I. Create an Android application to demonstrate
4. implicit and explicit intents
ii. Create an application to demonstrate shared
15 1/2/24
preferences
I. Create an Android application to demonstrate the
5. use of Broadcast listeners.
ii. Create an Android application to create and use
19 5/2/24
services.
I. Create an Android application to demonstrate
6. XML based animation
ii. Create an Android application to display canvas
22 12/3/24
and allow the user to draw on it.
Create a media player application in android that
7.
plays audio. Implement play, pause, and loop 29 14/3/24
features.
8. Create an Android application to use a camera and
capture image/video and display them on the screen.
34 14/3/24
SATISH PRADHAN DNYANASADHANA COLLEGE, THANE [A.Y. 2023-24]
Name : Sahil Ramjan Saiyad Class: SY. [Link]. Computer Science
Subject: Android Application Development- Practical Roll no:52, Batch :B, Div :A

Practical no 1
Aim: - i. Write a program using Kotlin to implement control structures
and loops. ii. Write a program to implement object-oriented concepts in
Kotlin.
Program 1: - Write a program using Kotlin to implement control
structures and loops.
fun main() {
//Example of if-else statement
val number = 15

if (number % 2 == 0) {
println("$number is even.")
} else {
println("$number is odd.")
}

//Example of a for loop


println("Printing numbers from 1 to 5 using a for loop:")
for (i in 1..5) {
println(i)
}

//Example of a while loop


var countdown = 3
println("countdown using a while loop:")
while (countdown > 0) {
println(countdown)
countdown--
}

//Example of a when expression


val dayOfWeek = 4

val dayString = when (dayOfWeek) {


1 -> "Monday"
2 -> "Tuesday"
3 -> "Wednesday"
4 -> "Thursday"
5 -> "Friday"
6 -> "Saturday"
7 -> "Sunday"
else -> "Invalid day"
}
println("Day of the week is $dayString")
}

1
SATISH PRADHAN DNYANASADHANA COLLEGE, THANE [A.Y. 2023-24]
Name : Sahil Ramjan Saiyad Class: SY. [Link]. Computer Science
Subject: Android Application Development- Practical Roll no:52, Batch :B, Div :A

Output: -

Program 2: - Write a program to implement object-oriented concepts in


Kotlin.
// Parent class
open class Animal(val name: String, val age: Int) {
// Function in the parent class
open fun makeSound() {
println("$name makes a generic animal sound.")
}
}
// Subclass inheriting from Animal
class Dog(name: String, age: Int, val breed: String) : Animal(name, age) {
// Overriding the makeSound() function
override fun makeSound() {
println("$name barks loudly!")
}
// Function specific to Dog class
fun fetch() {
println("$name is fetching the ball.")
}
}
// Subclass inheriting from Animal
class Cat(name: String, age: Int, val color: String) : Animal(name, age) {
override fun makeSound() {
println("$name meows softly.")
}
// Function specific to Cat class

2
SATISH PRADHAN DNYANASADHANA COLLEGE, THANE [A.Y. 2023-24]
Name : Sahil Ramjan Saiyad Class: SY. [Link]. Computer Science
Subject: Android Application Development- Practical Roll no:52, Batch :B, Div :A
fun scratch() {
println("$name is scratching the furniture.")
}
}
fun main() {
// Creating objects of the classes
val dog = Dog(name = "Buddy", age = 3, breed = "Golden Retriever")
val cat = Cat(name = "Whiskers", age = 2, color = "Tabby")
// Calling methods on the objects
println("${[Link]} is a ${[Link]} aged ${[Link]} years")
[Link]() // This will print "Buddy barks loudly!"

[Link]() // This will print "Buddy is fetching the ball."


println("${[Link]} is a ${[Link]} cat aged ${[Link]} years")
[Link]() // This will print "Whiskers meows softly."
[Link]() // This will print "Whiskers is scratching the furniture."
}

Output: -

3
SATISH PRADHAN DNYANASADHANA COLLEGE, THANE [A.Y. 2023-24]
Name : Sahil Ramjan Saiyad Class: SY. [Link]. Computer Science
Subject: Android Application Development- Practical Roll no:52, Batch :B, Div :A

Practical no 2
Aim: -I. Create an Android application to design screens using different
layouts and UI including Button, Edit text, Text view, Radio Button etc.
ii. Write an android application demonstrating response to event/user
interaction for
a. Checkbox
b. Radio button
c. Button
d. Spinner

Program: -
activity_main_xml file: -

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


<LinearLayout
xmlns:android="[Link]
xmlns:app="[Link]
xmlns:tools="[Link]
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical"
android:gravity="center"
tools:context=".MainActivity">
<EditText
android:id="@+id/name"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:ems="10"
android:hint="Name"
android:inputType="textPersonName" />
<TextView
android:id="@+id/gender"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Gender"
android:textSize="20sp" />
<TextView
android:id="@+id/textViewResponse"
android:layout_width="110dp"
android:layout_height="wrap_content"
android:textSize="14sp"
android:textStyle="bold|italic" />
<RadioGroup
android:id="@+id/selectgender"
android:layout_width="129dp"
android:layout_height="wrap_content">
<RadioButton

4
SATISH PRADHAN DNYANASADHANA COLLEGE, THANE [A.Y. 2023-24]
Name : Sahil Ramjan Saiyad Class: SY. [Link]. Computer Science
Subject: Android Application Development- Practical Roll no:52, Batch :B, Div :A
android:id="@+id/radioButton1"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="Male" />
<RadioButton
android:id="@+id/radioButton2"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="Female" />
</RadioGroup>
<TextView
android:id="@+id/lang"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="I like"
android:textSize="20sp" />
<CheckBox
android:id="@+id/checkBox2"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Kotlin" />
<CheckBox
android:id="@+id/checkBox1"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Python" />
<TextView
android:id="@+id/language"
android:layout_width="120dp"
android:layout_height="wrap_content"
android:textStyle="bold" />
<Spinner
android:id="@+id/spinner"
android:layout_width="143dp"
android:layout_height="wrap_content" />
<TextView
android:id="@+id/course"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text=" Your Class"
android:textSize="18sp" />
<TextView
android:id="@+id/myclass"
android:layout_width="107dp"
android:layout_height="wrap_content"
android:textStyle="bold" />
<Button
android:id="@+id/button"
android:layout_width="wrap_content"

5
SATISH PRADHAN DNYANASADHANA COLLEGE, THANE [A.Y. 2023-24]
Name : Sahil Ramjan Saiyad Class: SY. [Link]. Computer Science
Subject: Android Application Development- Practical Roll no:52, Batch :B, Div :A
android:layout_height="wrap_content"
android:text="Submit" />
</LinearLayout>

Main [Link] file: -


package [Link]
import [Link]
import [Link]
import [Link]
import [Link].*
import [Link]
import [Link].pract2.R

class MainActivity: AppCompatActivity() {


override fun onCreate(savedInstanceState: Bundle ? ) {
[Link](savedInstanceState)
setContentView([Link].activity_main)
val Name = findViewById <EditText>([Link])
val submitButton = findViewById <Button> ([Link])
val dispMessage = findViewById <TextView> ([Link])
val radioGroup = findViewById <RadioGroup> ([Link])
val radioB1 = findViewById <RadioButton> ([Link].radioButton1)
val radioB2 = findViewById <RadioButton> ([Link].radioButton2)
val CheckB1 = findViewById <CheckBox> ([Link].checkBox1)
val CheckB2 = findViewById <CheckBox> ([Link].checkBox2)
val CodingLang = findViewById <TextView> ([Link])
val Universityyear = findViewById <Spinner> ([Link])
val myclass = findViewById <TextView> ([Link])
val year = arrayOf("FYCS", "SYCS", "TYCS")
val arrayAdp = ArrayAdapter(this, [Link].simple_spinner_dropdown_item,
year)
[Link] = arrayAdp
[Link] = object: [Link]
{
override fun onItemSelected(p0: AdapterView < * > ? , p1 : View ? , position :
Int, p3: Long) { [Link] = "Your Class: " + year[position]}
override fun onNothingSelected(p0: AdapterView<*> ? ) {
[Link] = "Please select Your Class"}}
[Link] {group,checkedId ->
if (checkedId == [Link].radioButton1)
[Link]("Gender" + [Link])
if (checkedId == [Link].radioButton2)
[Link]("Gender" + [Link])}
[Link] {
[Link]("Welcome " + [Link])
if ([Link] && [Link]) {
[Link] = "You love both languages"
} else if ([Link]) {

6
SATISH PRADHAN DNYANASADHANA COLLEGE, THANE [A.Y. 2023-24]
Name : Sahil Ramjan Saiyad Class: SY. [Link]. Computer Science
Subject: Android Application Development- Practical Roll no:52, Batch :B, Div :A
[Link] = "You love Python"
} else if ([Link]) {
[Link] = "You love Kotlin"
} else {
[Link] = "You don't like these languages"
}}}}
Output:

7
SATISH PRADHAN DNYANASADHANA COLLEGE, THANE [A.Y. 2023-24]
Name : Sahil Ramjan Saiyad Class: SY. [Link]. Computer Science
Subject: Android Application Development- Practical Roll no:52, Batch :B, Div :A

Practical no 3
Aim: -I. Create an application to create Image Flipper and Image Gallery.
On click on the image display the information about the image.
ii. Create an application to use Gridview for shopping cart application.
Program: -
[Link] file: -

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


<LinearLayout
xmlns:android="[Link]
xmlns:app="[Link]
xmlns:tools="[Link]
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical"
android:gravity="center"
tools:context=".MainActivity">

<ViewFlipper
android:layout_width="match_parent"
android:layout_height="100dp"
android:flipInterval="2000"
android:autoStart="true"
android:inAnimation="@android:anim/slide_in_left"
android:outAnimation="@android:anim/slide_out_right">

<ImageView
android:id="@+id/imageView1"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
app:srcCompat="@drawable/cat1"
tools:ignore="ContentDescription" />

<ImageView
android:id="@+id/imageView3"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
app:srcCompat="@drawable/cat2"
tools:ignore="ContentDescription" />

<ImageView
android:id="@+id/imageView4"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
app:srcCompat="@drawable/cat3"
tools:ignore="ContentDescription" />

</ViewFlipper>

8
SATISH PRADHAN DNYANASADHANA COLLEGE, THANE [A.Y. 2023-24]
Name : Sahil Ramjan Saiyad Class: SY. [Link]. Computer Science
Subject: Android Application Development- Practical Roll no:52, Batch :B, Div :A

<ImageView
android:id="@+id/imageView"
android:layout_width="match_parent"
android:layout_height="350dp"
android:scaleType="fitCenter"
android:adjustViewBounds="true"
android:layout_margin="10dp"
app:srcCompat="@drawable/cat1"
tools:ignore="ContentDescription" />

<HorizontalScrollView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:padding="1dp"
android:id="@+id/horizontal"
tools:ignore="ContentDescription">

<LinearLayout
android:id="@+id/imgContainer"
android:layout_width="match_parent"
android:layout_height="90dp"
android:orientation="horizontal"></LinearLayout>

</HorizontalScrollView>

</LinearLayout>

[Link] file: -

package [Link].pract3
import [Link]
import [Link]
import [Link]
import [Link]
import [Link]

class MainActivity : AppCompatActivity() {


private var images = intArrayOf(
[Link].cat1,
[Link].cat2,
[Link].cat3,
[Link].cat1,
[Link].cat2,
[Link].cat3,
[Link].cat1,
[Link].cat2,
[Link].cat3,
[Link].cat1,

9
SATISH PRADHAN DNYANASADHANA COLLEGE, THANE [A.Y. 2023-24]
Name : Sahil Ramjan Saiyad Class: SY. [Link]. Computer Science
Subject: Android Application Development- Practical Roll no:52, Batch :B, Div :A
[Link].cat2,
[Link].cat3,
)

override fun onCreate(savedInstanceState: Bundle?) {


[Link](savedInstanceState)
setContentView([Link].activity_main)

val imgContainer = findViewById<LinearLayout>([Link])

for (i in 0 until [Link]) {


val imageView = ImageView(this)
val layoutParams = [Link](200,
[Link].MATCH_PARENT)
[Link] = layoutParams
[Link](images[i])
[Link] {
findViewById<ImageView>([Link]).setImageResource(images[i])
}
[Link](imageView)
}
}
}

Output:

10
SATISH PRADHAN DNYANASADHANA COLLEGE, THANE [A.Y. 2023-24]
Name : Sahil Ramjan Saiyad Class: SY. [Link]. Computer Science
Subject: Android Application Development- Practical Roll no:52, Batch :B, Div :A
Program :2 Create an application to use Gridview for shopping cart
application.
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="[Link]
xmlns:app="[Link]
xmlns:tools="[Link]
android:layout_width="match_parent"
android:layout_height="match_parent"
tools:context=".MainActivity">
<GridView
android:id="@+id/gridCont"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:columnWidth="100dp"
android:gravity="center"
android:horizontalSpacing="10dp"
android:listSelector="#00000000"
android:numColumns="3"
android:padding="6dp"
android:stretchMode="columnWidth"
android:verticalSpacing="10dp"
tools:listitem="@layout/gridframe" />
</LinearLayout><?xml version="1.0" encoding="utf-8"?>
gridframe:
<[Link]
xmlns:android="[Link]
xmlns:app="[Link]
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_gravity="center"
android:layout_margin="8dp"
app:cardPreventCornerOverlap="true"
app:cardCornerRadius="20dp"
>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:gravity="center"
android:padding="4dp"
android:orientation="vertical">
<ImageView
android:id="@+id/imgData"
android:layout_width="80dp"
android:layout_height="80dp"
android:padding="5dp"

11
SATISH PRADHAN DNYANASADHANA COLLEGE, THANE [A.Y. 2023-24]
Name : Sahil Ramjan Saiyad Class: SY. [Link]. Computer Science
Subject: Android Application Development- Practical Roll no:52, Batch :B, Div :A
android:src="@drawable/k"/>
<TextView
android:id="@+id/txtData"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:padding="4dp"
android:text="Test"
android:textAlignment="center"/>
</LinearLayout>
</[Link]>
GridAdapter:
package [Link]
import [Link]
import [Link]
import [Link]
import [Link]
import [Link]
import [Link]
class GridAdapter(
var context: Context,
var arratList: ArrayList<Griditem>
):BaseAdapter(){
override fun getCount():Int{
return [Link]
}
override fun getItem(position: Int): Any {
return [Link](position)
}
override fun getItemId(position: Int): Long {
return [Link]()
}
override fun getView(position: Int, convertView: View?, parent: ViewGroup?): View {
var view: View = [Link](context,[Link],null)
var icons: ImageView = [Link]([Link])
var names: TextView = [Link]([Link])
var gridItem: Griditem = [Link](position)
[Link]([Link]!!)
[Link] = [Link]
return view
}
}package [Link]
class Griditem {
var icons: Int? = 0
var name:String? = null
constructor(icons:Int?,name: String){

12
SATISH PRADHAN DNYANASADHANA COLLEGE, THANE [A.Y. 2023-24]
Name : Sahil Ramjan Saiyad Class: SY. [Link]. Computer Science
Subject: Android Application Development- Practical Roll no:52, Batch :B, Div :A
[Link] = icons
[Link] = name
}
}package [Link]
import [Link]
import [Link]
import [Link]
import [Link]
import [Link]
import [Link]
class MainActivity : AppCompatActivity(),[Link] {
private var gridView:GridView? = null
private var arrayList:ArrayList<Griditem>? = null
private var gridAdapter:GridAdapter? = null
override fun onCreate(savedInstanceState: Bundle?) {
[Link](savedInstanceState)
setContentView([Link].activity_main)
gridView = findViewById([Link])
arrayList = ArrayList()
arrayList = setDataList()
gridAdapter = GridAdapter(this,arrayList!!)
gridView?.adapter = gridAdapter
gridView?.onItemClickListener = this
}
private fun setDataList():ArrayList<Griditem> {
val arrayList:ArrayList<Griditem> = ArrayList()
[Link](Griditem([Link].k,"K"))
[Link](Griditem([Link].k2,"K2"))
[Link](Griditem([Link].k3,"K3"))
[Link](Griditem([Link].k4,"K4"))
[Link](Griditem([Link].k5,"K5"))
[Link](Griditem([Link].k6,"K6"))
[Link](Griditem([Link].k7,"K7"))
[Link](Griditem([Link].k8,"K8"))
[Link](Griditem([Link].k9,"K9"))
[Link](Griditem([Link].k3,"K3"))
[Link](Griditem([Link].k6,"K6"))
[Link](Griditem([Link].k9,"K9"))
[Link](Griditem([Link].k3,"K3"))
[Link](Griditem([Link].k6,"K6"))
[Link](Griditem([Link].k,"K"))
return arrayList
}

13
SATISH PRADHAN DNYANASADHANA COLLEGE, THANE [A.Y. 2023-24]
Name : Sahil Ramjan Saiyad Class: SY. [Link]. Computer Science
Subject: Android Application Development- Practical Roll no:52, Batch :B, Div :A
override fun onItemClick(parent: AdapterView<*>?, view: View?, position: Int, id: Long)
{
val griditem:Griditem = arrayList!![position]
[Link](this,[Link],Toast.LENGTH_SHORT).show()
}
}
Output:

14
SATISH PRADHAN DNYANASADHANA COLLEGE, THANE [A.Y. 2023-24]
Name : Sahil Ramjan Saiyad Class: SY. [Link]. Computer Science
Subject: Android Application Development- Practical Roll no:52, Batch :B, Div :A

Practical No. 4
Aim: I. Create an Android application to demonstrate implicit
and explicit intents. ii. Create an application to demonstrate
shared preferences
 [Link]
package [Link].practical4ab

import [Link]
import [Link]
import [Link]
import [Link]
import [Link].*
import [Link]
import [Link]

class MainActivity : AppCompatActivity() {


override fun onCreate(savedInstanceState: Bundle?) {
[Link](savedInstanceState)
setContentView([Link].activity_main)

val impbtn=findViewById<Button>([Link])
val expbtn=findViewById<Button>([Link])
val txtName=findViewById<EditText>([Link])

val sharedPref=getSharedPreferences("Sahil's App",Context.MODE_PRIVATE)


var sharedEdit=[Link]()

[Link]{
startActivity(
Intent(
Intent.ACTION_VIEW,
[Link]("[Link]
)
)
}

[Link](object:[Link]{
override fun onClick(view:View?){
if(([Link])?.isEmpty()==true)
{

15
SATISH PRADHAN DNYANASADHANA COLLEGE, THANE [A.Y. 2023-24]
Name : Sahil Ramjan Saiyad Class: SY. [Link]. Computer Science
Subject: Android Application Development- Practical Roll no:52, Batch :B, Div :A
[Link](this@MainActivity,"Please enter
name:",Toast.LENGTH_SHORT).show()
}else{
[Link]("name",[Link]())
[Link]()
}
startActivity(Intent(this@MainActivity,data::[Link]))
}
})
}
}

 activity_main.xml
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout
xmlns:android="[Link]
xmlns:app="[Link]
xmlns:tools="[Link]
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical"
android:gravity="center"
tools:context=".MainActivity">
<EditText
android:id="@+id/name"
android:layout_width="250dp"
android:layout_height="wrap_content"
android:ems="10"
android:hint="Name"
android:inputType="textPersonName" />
<Button
android:id="@+id/explicitBtn"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Explicit" />
<Button
android:id="@+id/implicitBtn"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Implicit" />
</LinearLayout>
 [Link]

16
SATISH PRADHAN DNYANASADHANA COLLEGE, THANE [A.Y. 2023-24]
Name : Sahil Ramjan Saiyad Class: SY. [Link]. Computer Science
Subject: Android Application Development- Practical Roll no:52, Batch :B, Div :A
package [Link].practical4ab

import [Link]
import [Link]
import [Link]
import [Link]

class data :AppCompatActivity(){


override fun onCreate(savedInstanceState:Bundle?){
[Link](savedInstanceState)
setContentView([Link].activity_data)
val pName=findViewById<TextView>([Link])
val sharedPref=getSharedPreferences("Sahil's App",Context.MODE_PRIVATE)
[Link]=[Link]("name","Text")
}
}

 activity_data.xml
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="[Link]
xmlns:app="[Link]
xmlns:tools="[Link]
android:orientation="vertical"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:gravity="center"
tools:context=".data">

<TextView
android:layout_width="wrap_content"
android:layout_height="match_parent"
android:id="@+id/textView"
android:text="Your name"
android:layout_margin="8dp"
android:textSize="18dp"/>
</LinearLayout>

17
SATISH PRADHAN DNYANASADHANA COLLEGE, THANE [A.Y. 2023-24]
Name : Sahil Ramjan Saiyad Class: SY. [Link]. Computer Science
Subject: Android Application Development- Practical Roll no:52, Batch :B, Div :A

Output:

18
SATISH PRADHAN DNYANASADHANA COLLEGE, THANE [A.Y. 2023-24]
Name : Sahil Ramjan Saiyad Class: SY. [Link]. Computer Science
Subject: Android Application Development- Practical Roll no:52, Batch :B, Div :A

Practical No. 5
Aim: Create an Android application to demonstrate the use of
Broadcast listeners. ii. Create an Android application to create
and use services.
MainActivityXMLFile: -

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


<LinearLayout
xmlns:android="[Link]
xmlns:app="[Link]
xmlns:tools="[Link]
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical"
android:gravity="center"
tools:context=".MainActivity">
<Button
android:id="@+id/startServBtn"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="StartService"/>
<Button
android:id="@+id/stopServBtn"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="StopService"/>
</LinearLayout>

MainactivityFile:-

package [Link].practical5
import [Link]
import [Link]
import [Link]
import [Link]
import [Link]
import [Link]
import [Link]

19
SATISH PRADHAN DNYANASADHANA COLLEGE, THANE [A.Y. 2023-24]
Name : Sahil Ramjan Saiyad Class: SY. [Link]. Computer Science
Subject: Android Application Development- Practical Roll no:52, Batch :B, Div :A
class MainActivity : AppCompatActivity() {
private var mediaPlayer:MediaPlayer?=null
override fun onCreate(savedInstanceState:Bundle?) {
[Link](savedInstanceState)
setContentView([Link].activity_main)
val startbtn=findViewById<Button>([Link])
val stopbtn=findViewById<Button>([Link])
val
sharedPref=getSharedPreferences("DaApp",Context.MODE_PRIVATE)
val sharedEdit=[Link]()
[Link] {
mediaPlayer=[Link](this@MainActivity, [Link])
mediaPlayer?.start()
}
[Link] {
mediaPlayer?.stop()
mediaPlayer?.release()
mediaPlayer=null
}
}
override fun onStop() {
[Link]()
mediaPlayer?.release()
mediaPlayer=null
}
}

[Link]:-

package [Link].practical5
import [Link]
import [Link]
import [Link]
import [Link]

class AndroidService:Service() {
private lateinit var player:MediaPlayer
override fun onStartCommand(intent:Intent?,flags:Int,startId: Int): Int {
player=[Link](this, [Link])

20
SATISH PRADHAN DNYANASADHANA COLLEGE, THANE [A.Y. 2023-24]
Name : Sahil Ramjan Saiyad Class: SY. [Link]. Computer Science
Subject: Android Application Development- Practical Roll no:52, Batch :B, Div :A
[Link]=true
[Link]()
return START_STICKY
}
override fun onDestroy() {
[Link]()
[Link]()
}
override fun onBind(intent:Intent): IBinder? {
return null
}
}

Output:

21
SATISH PRADHAN DNYANASADHANA COLLEGE, THANE [A.Y. 2023-24]
Name : Sahil Ramjan Saiyad Class: SY. [Link]. Computer Science
Subject: Android Application Development- Practical Roll no:52, Batch :B, Div :A

Practical No. 6
Aim: I. Create an Android application to demonstrate XML
based animation
ii. Create an Android application to display canvas and allow the
user to draw on it.
Program

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


<LinearLayout xmlns:android="[Link]
xmlns:tools="[Link]
android:layout_width="match_parent"
android:layout_height="match_parent"
android:gravity="center"
android:orientation="vertical"
tools:context=".MainActivity">

<ImageView
android:id="@+id/imghu"
android:layout_width="200dp"
android:layout_height="200dp"
android:src="@drawable/android" />

<Button
android:id="@+id/button"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_margin="8dp"
android:layout_marginBottom="0dp"
android:text="Animate" />

<Button
android:id="@+id/button1"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_margin="8dp"
android:layout_marginBottom="0dp"
android:text="Blink" />

<Button
android:id="@+id/button2"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_margin="8dp"
android:text="Zoom" />

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

22
SATISH PRADHAN DNYANASADHANA COLLEGE, THANE [A.Y. 2023-24]
Name : Sahil Ramjan Saiyad Class: SY. [Link]. Computer Science
Subject: Android Application Development- Practical Roll no:52, Batch :B, Div :A
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_margin="8dp"
android:text="Draw" />
</LinearLayout>

(activity_draw.xml)
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="[Link]
xmlns:app="[Link]
xmlns:tools="[Link]
android:layout_width="match_parent"
android:layout_height="match_parent"
android:gravity="center"
android:orientation="vertical"
tools:context=".DrawActivity">

<[Link]
android:id="@+id/drawing_view"
android:layout_width="match_parent"
android:layout_height="600dp">

</[Link]>

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

<ImageButton
android:id="@+id/btn_redo"
android:layout_width="100dp"
android:layout_height="match_parent"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintHorizontal_bias="0.5"
app:layout_constraintStart_toEndOf="@+id/btn_color"
app:srcCompat="@drawable/baseline_redo_24"
android:importantForAccessibility="no" />

<ImageButton
android:id="@+id/btn_undo"
android:layout_width="100dp"
android:layout_height="match_parent"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toStartOf="@+id/btn_brush"
app:layout_constraintHorizontal_bias="0.5"
app:layout_constraintStart_toStartOf="parent"
app:srcCompat="@drawable/baseline_undo_24"

23
SATISH PRADHAN DNYANASADHANA COLLEGE, THANE [A.Y. 2023-24]
Name : Sahil Ramjan Saiyad Class: SY. [Link]. Computer Science
Subject: Android Application Development- Practical Roll no:52, Batch :B, Div :A
android:importantForAccessibility="no" />

<ImageButton
android:id="@+id/btn_brush"
android:layout_width="100dp"
android:layout_height="match_parent"
app:srcCompat="@drawable/baseline_brush_24"
android:importantForAccessibility="no" />

<ImageButton
android:id="@+id/btn_clearscreen"
android:layout_width="100dp"
android:layout_height="match_parent"
app:srcCompat="@drawable/baseline_clear_24"
android:importantForAccessibility="no" />
</LinearLayout>
</LinearLayout>

([Link]) package [Link]

import [Link]
import [Link]
import [Link]
import [Link]
import [Link]
import [Link]
import [Link]

class MainActivity : AppCompatActivity() {


override fun onCreate(savedInstanceState: Bundle?) {
[Link](savedInstanceState)
setContentView([Link].activity_main)
val imgView = findViewById<ImageView>([Link])
findViewById<Button>([Link]).setOnClickListener {
val animat = [Link](this, [Link])
imgView!!.visibility = [Link]
[Link](animat)
}
findViewById<Button>([Link].button1).setOnClickListener {
val animat1 = [Link](this, [Link])
imgView!!.visibility = [Link]
[Link](animat1)
}
findViewById<Button>([Link].button2).setOnClickListener {
val animat2 = [Link](this, [Link])
imgView!!.visibility = [Link]
[Link](animat2)
}
findViewById<Button>([Link].btn3).setOnClickListener {

24
SATISH PRADHAN DNYANASADHANA COLLEGE, THANE [A.Y. 2023-24]
Name : Sahil Ramjan Saiyad Class: SY. [Link]. Computer Science
Subject: Android Application Development- Practical Roll no:52, Batch :B, Div :A
startActivity(Intent(this, DrawActivity::[Link]))
}
}
}

([Link]) package
[Link]

import [Link]
import [Link]
import [Link]
import [Link]

class DrawActivity : AppCompatActivity() {


override fun onCreate(savedInstanceState: Bundle?) {
[Link](savedInstanceState)
setContentView([Link].activity_draw)

val drawingView = findViewById<drawingView>([Link].drawing_view) ?: return


findViewById<ImageButton>([Link].btn_undo)?.setOnClickListener {
[Link]() }
findViewById<ImageButton>([Link].btn_redo)?.setOnClickListener {
[Link]() }
findViewById<ImageButton>([Link].btn_brush)?.setOnClickListener {
[Link](25) //0-35
[Link](100) //0-255
[Link]([Link])
}
findViewById<ImageButton>([Link].btn_clearscreen)?.setOnClickListener {
[Link]()
}
}
}

([Link])
pluginManagement {
repositories {
google()
mavenCentral()
gradlePluginPortal()
maven { url = uri("[Link] ) }
}
}
dependencyResolutionManagement {
[Link](RepositoriesMode.FAIL_ON_PROJECT_REPOS)
repositories {
google()
mavenCentral()
maven { url = uri("[Link] ) }

25
SATISH PRADHAN DNYANASADHANA COLLEGE, THANE [A.Y. 2023-24]
Name : Sahil Ramjan Saiyad Class: SY. [Link]. Computer Science
Subject: Android Application Development- Practical Roll no:52, Batch :B, Div :A
}
}

[Link] = "pract"
include(":app")

[Link](module:app)
plugins {
id("[Link]")
id("[Link]")
}

android {
namespace = "[Link]"
compileSdk = 34

defaultConfig {
applicationId = "[Link]"
minSdk = 24
targetSdk = 34
versionCode = 1
versionName = "1.0"

testInstrumentationRunner = "[Link]"
}

buildTypes {
release {
isMinifyEnabled = false
proguardFiles(
getDefaultProguardFile("[Link]"),
"[Link]"
)
}
}
compileOptions {
sourceCompatibility = JavaVersion.VERSION_1_8
targetCompatibility = JavaVersion.VERSION_1_8
}
kotlinOptions {
jvmTarget = "1.8"
}
}

dependencies {

implementation("[Link]:core-ktx:1.12.0")
implementation("[Link]:appcompat:1.6.1")
implementation("[Link]:material:1.11.0")

26
SATISH PRADHAN DNYANASADHANA COLLEGE, THANE [A.Y. 2023-24]
Name : Sahil Ramjan Saiyad Class: SY. [Link]. Computer Science
Subject: Android Application Development- Practical Roll no:52, Batch :B, Div :A
implementation("[Link]:constraintlayout:2.1.4")
testImplementation("junit:junit:4.13.2")
androidTestImplementation("[Link]:junit:1.1.5")
androidTestImplementation("[Link]:espresso-core:3.5.1")

implementation("[Link].Miihir79:DrawingCanvas:1.1.2")
}

([Link])
<?xml version="1.0" encoding="utf-8"?>
<set xmlns:android="[Link]
<alpha
android:duration="600"
android:fromAlpha="0.0"
android:interpolator="@android:anim/accelerate_interpolator"
android:repeatCount="infinite"
android:repeatMode="reverse"
android:toAlpha="1.0" />
</set>

([Link])
<?xml version="1.0" encoding="utf-8"?>
<set xmlns:android="[Link]
android:fillAfter="true">
<alpha
android:duration="1000"
android:fromAlpha="0.0"
android:interpolator="@android:anim/accelerate_interpolator"
android:toAlpha="1.0" />
</set>

([Link])
<?xml version="1.0" encoding="utf-8"?>
<set xmlns:android="[Link]
android:fillAfter="true">
<scale
android:duration="1000"
android:fromXScale="1"
android:fromYScale="1"
android:pivotX="50%"
android:pivotY="50%"
android:toXScale="3"
android:toYScale="3"></scale>
</set>

27
SATISH PRADHAN DNYANASADHANA COLLEGE, THANE [A.Y. 2023-24]
Name : Sahil Ramjan Saiyad Class: SY. [Link]. Computer Science
Subject: Android Application Development- Practical Roll no:52, Batch :B, Div :A

Output:

28
SATISH PRADHAN DNYANASADHANA COLLEGE, THANE [A.Y. 2023-24]
Name : Sahil Ramjan Saiyad Class: SY. [Link]. Computer Science
Subject: Android Application Development- Practical Roll no:52, Batch :B, Div :A

Practical No. 7
Aim: Create a media player application in android that plays
audio. Implement play, pause, and loop features.
([Link])
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout
xmlns:android="[Link]
xmlns:app="[Link]
xmlns:tools="[Link]
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical"
android:gravity="center"
tools:context=".MainActivity">
<ImageView
android:layout_width="250dp"
android:layout_height="250dp"
android:src="@drawable/image"/>
<RelativeLayout
android:layout_width="368dp"
android:layout_height="wrap_content"
android:layout_margin="8dp"
android:layout_marginTop="50dp">
<TextView
android:id="@+id/tv_pass"
android:layout_width="wrap_content"
android:layout_height="wrap_content" />
<TextView
android:id="@+id/tv_due"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentEnd="true"
android:layout_alignParentRight="true" />
<SeekBar
android:id="@+id/seek_bar"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_below="@id/tv_pass"
android:saveEnabled="false" />
</RelativeLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="horizontal"
android:gravity="center">
<Button
android:id="@+id/pauseBtn"
android:layout_width="wrap_content"

29
SATISH PRADHAN DNYANASADHANA COLLEGE, THANE [A.Y. 2023-24]
Name : Sahil Ramjan Saiyad Class: SY. [Link]. Computer Science
Subject: Android Application Development- Practical Roll no:52, Batch :B, Div :A
android:layout_height="wrap_content"
android:layout_margin="8dp"
android:enabled="false"
android:text="Pause" />
<Button
android:id="@+id/playBtn"
android:layout_width="88dp"
android:layout_height="wrap_content"
android:layout_margin="8dp"
android:text="Play" />
<Button
android:id="@+id/stopBtn"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_margin="8dp"
android:enabled="false"
android:text="Stop"/>
</LinearLayout>
</LinearLayout>

([Link])
package [Link].prac7

import [Link]
import [Link]
import [Link]
import [Link]
import [Link]
import [Link]
import [Link]
import [Link]

class MainActivity : AppCompatActivity() {


private lateinit var mediaPlayer: MediaPlayer
private lateinit var runnable: Runnable
private var handler: Handler = Handler()
private var pause: Boolean = false
private var seek_bar: SeekBar? = null
private var tv_pass: TextView? = null
private var tv_due: TextView? = null
override fun onCreate(savedInstanceState: Bundle?) {
[Link](savedInstanceState)
setContentView([Link].activity_main)
seek_bar = findViewById([Link].seek_bar)
tv_due = findViewById<TextView>([Link].tv_due)
tv_pass = findViewById<TextView>([Link].tv_pass)
val playBtn = findViewById<Button>([Link])
val pauseBtn = findViewById<Button>([Link])
val stopBtn = findViewById<Button>([Link])

30
SATISH PRADHAN DNYANASADHANA COLLEGE, THANE [A.Y. 2023-24]
Name : Sahil Ramjan Saiyad Class: SY. [Link]. Computer Science
Subject: Android Application Development- Practical Roll no:52, Batch :B, Div :A
[Link] {
if (pause) {
[Link]([Link])
[Link]()
pause = false
[Link](this, "media playing", Toast.LENGTH_SHORT).show()
} else {
mediaPlayer = [Link](applicationContext, [Link])
[Link]()
[Link](this, "media playing", Toast.LENGTH_SHORT).show()
}
initializeSeekBar()
[Link] = false
[Link] = true
[Link] = true
[Link] {
[Link] = true
[Link] = false
[Link] = false
[Link](this, "end", Toast.LENGTH_SHORT).show()
}
}
[Link] {
if ([Link]) {
[Link]()
pause = true
[Link] = true
[Link] = false
[Link] = true
[Link](this, "media pause", Toast.LENGTH_SHORT).show()
}
}
[Link] {
if ([Link] || [Link](true)) {
pause = false
seek_bar!!.progress = 0
[Link]()
[Link]()
[Link]()
[Link](runnable)
[Link] = true
[Link] = false
[Link] = false
tv_pass!!.text = ""
tv_due!!.text = ""
[Link](this, "media stop", Toast.LENGTH_SHORT).show()
}
}
seek_bar!!.setOnSeekBarChangeListener(object : [Link] {

31
SATISH PRADHAN DNYANASADHANA COLLEGE, THANE [A.Y. 2023-24]
Name : Sahil Ramjan Saiyad Class: SY. [Link]. Computer Science
Subject: Android Application Development- Practical Roll no:52, Batch :B, Div :A
override fun onProgressChanged(seekBar: SeekBar, i: Int, b: Boolean) {
if (b) {
[Link](i * 1000)
}
}

override fun onStartTrackingTouch(seekBar: SeekBar) {}


override fun onStopTrackingTouch(seekBar: SeekBar) {}
})
}

private fun initializeSeekBar() {


seek_bar!!.max = [Link]
runnable = Runnable {
seek_bar!!.progress = [Link]
tv_pass!!.text = "${[Link]} sec"
val diff = [Link] - [Link]
tv_due!!.text = "$diff sec"
[Link](runnable, 1000)
}
[Link](runnable, 1000)
}

val [Link]: Int


get() {
return [Link] / 1000
}
val [Link]: Int
get() {
return [Link] / 1000
}
}

Output:

32
SATISH PRADHAN DNYANASADHANA COLLEGE, THANE [A.Y. 2023-24]
Name : Sahil Ramjan Saiyad Class: SY. [Link]. Computer Science
Subject: Android Application Development- Practical Roll no:52, Batch :B, Div :A

33
SATISH PRADHAN DNYANASADHANA COLLEGE, THANE [A.Y. 2023-24]
Name : Sahil Ramjan Saiyad Class: SY. [Link]. Computer Science
Subject: Android Application Development- Practical Roll no:52, Batch :B, Div :A

Practical No. 8
Aim: Create an Android application to use a camera and capture
image/video and display them on the screen.
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout
xmlns:android="[Link]
xmlns:app="[Link]
xmlns:tools="[Link]
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical"
android:gravity="center"
tools:context=".MainActivity">
<ImageView
android:id="@+id/click_image"
android:layout_width="350dp"
android:layout_height="450dp"
android:layout_marginTop="10dp"
android:layout_marginBottom="70dp" />
<Button
android:id="@+id/camera_button"
android:layout_width="100dp"
android:layout_height="50dp"
android:text="Camera" />
</LinearLayout>

package [Link].prac8

import [Link]
import [Link]
import [Link]
import [Link]
import [Link]
import [Link]
import [Link]

class MainActivity : AppCompatActivity() {


private lateinit var cameraOpenId: Button
private lateinit var clickImageId: ImageView
override fun onCreate(savedInstanceState: Bundle?) {
[Link](savedInstanceState)
setContentView([Link].activity_main)
cameraOpenId = findViewById([Link].camera_button)
clickImageId = findViewById([Link].click_image)
[Link] {
val cameraIntent = Intent(MediaStore.ACTION_IMAGE_CAPTURE)
startActivityForResult(cameraIntent, pic_id)

34
SATISH PRADHAN DNYANASADHANA COLLEGE, THANE [A.Y. 2023-24]
Name : Sahil Ramjan Saiyad Class: SY. [Link]. Computer Science
Subject: Android Application Development- Practical Roll no:52, Batch :B, Div :A
}
}

override fun onActivityResult(requestCode: Int, resultCode: Int, data: Intent?) {


[Link](requestCode, resultCode, data)
if (requestCode == pic_id) {
val photo = data!!.extras!!["data"] as Bitmap?
[Link](photo)
}
}

companion object {
private
const val pic_id = 123
}
}

Output:

35

Common questions

Powered by AI

Practical exercises such as creating media player and image flipper apps enhance learning by providing hands-on experience in applying theoretical knowledge to real-world scenarios. These activities help students understand core Android development concepts, such as managing life cycles, integrating multimedia elements, and implementing event handling in a way that mirrors the complexities found in professional environments. Such projects foster problem-solving skills, encourage creative thinking, and deepen understanding of Android's API, leading to a more robust learning outcome for computer science students .

Implementing UI components like Button, Radio Button, and Spinner is critical for creating interactive Android applications. Buttons trigger actions and events within the app, such as submitting data or navigating between screens. Radio Buttons allow selection between mutually exclusive options, crucial for preference selections. Spinners provide a dropdown list to select items, saving screen space and improving usability. These components enhance user experience by promoting efficient navigation and data input handling within the application .

XML plays a crucial role in designing UI layouts in Android development by providing a flexible and declarative way to define the interface structure. It separates the user interface design from application logic, allowing developers to specify layouts, styles, and components independently of the app's functionality. This not only simplifies UI management and promotes cleaner code but also enables easier customization and use of android's styles and themes for consistent and efficient UX designs .

LinearLayout and RelativeLayout are both used for organizing UI elements in Android but differ in flexibility and complexity. LinearLayout arranges views either horizontally or vertically, making it simple and suitable for straightforward UIs with a single direction hierarchy. RelativeLayout offers more flexibility by allowing position definitions relative to other elements, providing a richer and more dynamic UI construction, ideal for complex interfaces needing varied alignments. While RelativeLayout allows for a more compact and flexible arrangement, it can be more challenging to set up and debug compared to the straightforward nature of LinearLayout .

An Android service in the application is created by subclassing 'Service' and overriding its lifecycle methods such as 'onStartCommand' and 'onDestroy'. The service uses 'MediaPlayer' for continuous audio playback, facilitating tasks without user interaction by running in the background. Benefits of using services include ability to perform long-running operations without disrupting the user interface, enhancing the app's responsiveness and managing tasks that need consistent processing over time, such as playing music or fetching data periodically .

The Kotlin program demonstrates the core object-oriented concepts of inheritance, polymorphism, and encapsulation. Inheritance is shown through the 'Dog' and 'Cat' classes, which both inherit from the 'Animal' superclass. Polymorphism is demonstrated by overriding the 'makeSound' method in both subclasses to provide specific implementations—'Dog' class's method prints "barks loudly!" and 'Cat' class's method prints "meows softly." Each subclass also encapsulates behavior with specific methods like 'fetch' in the 'Dog' class and 'scratch' in the 'Cat' class .

The Kotlin program uses multiple control flow structures: an 'if-else' statement checks if a number is even or odd, a 'for loop' prints numbers from 1 to 5, a 'while loop' executes a countdown from 3 to 1, and a 'when expression' maps integer values to weekdays. These structures are used to demonstrate basic control flow techniques in Kotlin, allowing conditional execution and looping to automate repetitive tasks .

SharedPreferences is beneficial in Android applications for managing small, persistent key-value data, useful for storing user preferences and configuration settings across sessions. It is lightweight and easy to implement as demonstrated in the example where it is used to store UI state and user choices, enhancing user experience by retaining settings between application restarts. The implementation creates or retrieves a SharedPreferences file using 'getSharedPreferences', then uses 'SharedPreferences.Editor' to commit or apply changes, enabling seamless data persistence without complex database interactions .

The Android application demonstrates both implicit and explicit intents. Implicit intents are used to allow components to handle actions that do not explicitly specify the target component, such as opening a URL in a browser or sharing data to other apps. Explicit intents directly target a specific component in the app, such as starting a new activity within a specific module. These intents function by providing mechanisms for activity-to-activity communication and facilitate data sharing, enhancing the modularity and functionality of the application .

The 'MainActivity.kt' file in the Android application manages user interactions through various UI components and listeners. Interaction with EditText is used to capture user input, while Button interactions are handled by an OnClickListener that triggers responses like displaying a welcome message. RadioGroup's listener determines selected options, updating TextView responses accordingly. CheckBoxes affect other TextView outputs depending on whether they are checked, updating preferences for programming language choice. Spinner uses an OnItemSelectedListener to update another TextView showing the selected year of class .

You might also like