Professional Documents
Culture Documents
Roll no :- 23
Practical 24
Xml File:-
<Rela veLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:padding="16dp"
xmlns:android="h p://schemas.android.com/apk/res/android">
<Bu on
android:id="@+id/turnOnBu on"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="Turn On Bluetooth"/>
<Bu on
android:id="@+id/getVisibleBu on"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_below="@id/turnOnBu on"
android:layout_marginTop="16dp"
android:text="Get Visible"/>
<ListView
android:id="@+id/devicesListView"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_below="@id/getVisibleBu on"
android:layout_marginTop="16dp"/>
<Bu on
android:id="@+id/turnOffBu on"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_below="@id/devicesListView"
android:layout_marginTop="16dp"
android:text="Turn Off Bluetooth"/>
</Rela veLayout>
Java File:-
package com.example.practical24;
import android.os.Bundle
import androidx.activity.enableEdgeToEdge
import androidx.appcompat.app.AppCompatActivity
import androidx.core.view.ViewCompat
import androidx.core.view.WindowInsetsCompat