0% found this document useful (0 votes)
18 views3 pages

Android Calculator & Bluetooth UI

The document contains XML code for an Android layout that includes a calculator interface with buttons for addition, subtraction, multiplication, and division, as well as input fields for two numbers. It also features a Bluetooth status display and a toggle button to switch Bluetooth on and off. The layout is structured using LinearLayouts with specified attributes for width, height, padding, and text size.

Uploaded by

Om Mohite
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)
18 views3 pages

Android Calculator & Bluetooth UI

The document contains XML code for an Android layout that includes a calculator interface with buttons for addition, subtraction, multiplication, and division, as well as input fields for two numbers. It also features a Bluetooth status display and a toggle button to switch Bluetooth on and off. The layout is structured using LinearLayouts with specified attributes for width, height, padding, and text size.

Uploaded by

Om Mohite
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/ 3

Practical no.

9 :- android:hint="Enter second number"

android:inputType="numberDecimal"
Name :- sakshi dinesh shinde
android:textSize="20sp"
Roll no :- 85
android:layout_marginBottom="20dp" />
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout
<LinearLayout
xmlns:android="http://schemas.android.com/ android:layout_width="match_parent"
apk/res/android" android:layout_height="wrap_content"
android:layout_width="match_parent" android:orientation="horizontal"
android:layout_height="match_parent" android:gravity="center"
android:orientation="vertical" android:layout_marginBottom="20dp"
android:padding="16dp"> <Button
<TextView android:id="@+id/buttonAdd"
android:id="@+id/resultText" android:layout_width="wrap_content"
android:layout_width="match_parent" android:layout_height="wrap_content"
android:layout_height="wrap_content" android:text="+"
android:text="0" android:textSize="24sp"
android:textSize="40sp" android:layout_marginEnd="10dp"/>
android:gravity="end" <Button
android:layout_marginBottom="20dp" /> android:id="@+id/buttonSubtract"
<EditText android:layout_width="wrap_content"
android:id="@+id/editTextNumber1" android:layout_height="wrap_content"
android:layout_width="match_parent" android:text="-"
android:layout_height="wrap_content" android:textSize="24sp"
android:hint="Enter first number" android:layout_marginEnd="10dp"/>
android:inputType="numberDecimal" <Button
android:textSize="20sp" android:id="@+id/buttonMultiply"
android:layout_marginBottom="10dp" /> android:layout_width="wrap_content"
<EditText android:layout_height="wrap_content"
android:id="@+id/editTextNumber2" android:text="*"
android:layout_width="match_parent" android:textSize="24sp"
android:layout_height="wrap_content" android:layout_marginEnd="10dp"/>
<Button

android:id="@+id/buttonDivide"

android:layout_width="wrap_content"

android:layout_height="wrap_content"

android:text="/"

android:textSize="24sp" />

</LinearLayout>

<Button

android:id="@+id/buttonEqual"

android:layout_width="match_parent"

android:layout_height="wrap_content"

android:text="="

android:textSize="30sp"/>

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

android:padding="16dp"

android:gravity="center">

<!-- TextView to display Bluetooth status -->

<TextView

android:id="@+id/bluetoothStatus"

android:layout_width="wrap_content"

android:layout_height="wrap_content"

android:text="Bluetooth Off"

android:textSize="20sp"

android:layout_marginBottom="20dp"/>

<!-- ToggleButton to switch Bluetooth on/off


-->

<ToggleButton

android:id="@+id/bluetoothToggleButton"

android:layout_width="wrap_content"

android:layout_height="wrap_content"

android:textOn="Bluetooth On"

android:textOff="Bluetooth Off"

android:text="Bluetooth" />

</LinearLayout>

You might also like