0% found this document useful (0 votes)
17 views4 pages

Mobile App Development Lab Report

Uploaded by

Aleena Qadir
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)
17 views4 pages

Mobile App Development Lab Report

Uploaded by

Aleena Qadir
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

Department of computer science

Mobile App Development


Lab Report 02

Submitted By
Aleena Qadir
BSCS-RC-205

Submitted To
Ms. Maryam Sajjad
Task 01:

Source Code:
XML File
<?xml version="1.0" encoding="utf-8"?>
<[Link]
xmlns:android="[Link]
xmlns:app="[Link]
xmlns:tools="[Link]
android:id="@+id/main"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="#EDEDED"
tools:context=".MainActivity">
<TextView
android:id="@+id/textView"
android:layout_width="417dp"
android:layout_height="595dp"
android:background="#1BF403"
android:paddingTop="230dp"
android:text="0"
android:textAlignment="center"
android:textColor="#000000"
android:textSize="120sp"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent" />
<Button
android:id="@+id/button"
android:layout_width="405dp"
android:layout_height="66dp"
android:layout_marginBottom="36dp"
android:text="Toast"
android:textColor="#FFFFFF"
app:layout_constraintBottom_toTopOf="@+id/textView"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent"
app:layout_constraintVertical_bias="1.0" />
<Button
android:id="@+id/button2"
android:layout_width="413dp"
android:layout_height="63dp"
android:text="Count"
android:textColor="#FFFFFF"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintHorizontal_bias="0.499"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@+id/textView"
app:layout_constraintVertical_bias="0.069" />
</[Link]>
Java code
package [Link].lab2;

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

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

public class MainActivity extends AppCompatActivity {


private Button btn1;
private Button btn2;
private TextView textView;

int x = 0;
@Override
protected void onCreate(Bundle savedInstanceState) {
[Link](savedInstanceState);
[Link](this);
setContentView([Link].activity_main);
[Link](findViewById([Link]), (v, insets) -> {
Insets systemBars = [Link]([Link]());
[Link]([Link], [Link], [Link], [Link]);
return insets;
});
btn1= (Button) findViewById([Link]);
btn2= (Button) findViewById([Link].button2);
textView= (TextView) findViewById([Link]);
[Link](new [Link]() {
@Override
public void onClick(View v) {
x++;[Link]([Link](x));
}
});
[Link](new [Link]() {
@Override
public void onClick(View v) {
Toast toast = [Link](getApplicationContext(), "Hello Toast",
Toast.LENGTH_LONG);
[Link]();
}
});
}

Output:

You might also like