AppDev WK2
AppDev WK2
Development
Introduction to Android Studio
Agenda
• How to Install Android Studio
• Virtualization
• Project Structure
• Basic Input
START 05/21/2025 2
Android
Studio
First Steps into Mobile
Development
START 05/21/2025 3
Installation
START 05/21/2025 4
Installation
START 05/21/2025 5
First Project
START 05/21/2025 6
Virtualization
is a technology that
allows the creation of
multiple simulated
environments or
dedicated resources from
a single physical
hardware system.
START 05/21/2025 7
Android
Studio
What if we want to run on our
mobile device?
START 05/21/2025 8
Android Phone Setup
START 05/21/2025 9
Android Phone Setup
START 05/21/2025 10
Android
Studio
Project Structure
START 05/21/2025 11
Project Structure
Manifest Folder • It acts as an
• contains intermediator between
AndroidManifest.xml for
creating our android android OS and our
application. application.
• This file contains information
about our application such as
the Android version, metadata,
states package for Java file, and
other application components.
START 05/21/2025 12
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools">
<application
android:allowBackup="true"
android:dataExtractionRules="@xml/data_extraction_rules"
android:fullBackupContent="@xml/backup_rules"
android:icon="@mipmap/ic_launcher"
android:label="@string/app_name"
android:roundIcon="@mipmap/ic_launcher_round"
android:supportsRtl="true"
android:theme="@style/Theme.Sampleppt"
tools:targetApi="31">
<activity
android:name=".MainActivity"
android:exported="true">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
</manifest>
Project Structure
Java Folder
• contains all the java and
Kotlin source code (.java)
files that we create during
the app development,
including other Test files.
• This is where we add
functions to our code.
START 05/21/2025 14
package com.example.sampleppt;
import android.os.Bundle;
import androidx.activity.EdgeToEdge;
import androidx.appcompat.app.AppCompatActivity;
import androidx.core.graphics.Insets;
import androidx.core.view.ViewCompat;
import androidx.core.view.WindowInsetsCompat;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
EdgeToEdge.enable(this);
setContentView(R.layout.activity_main);
ViewCompat.setOnApplyWindowInsetsListener(findViewById(R.id.main), (v, insets) -> {
Insets systemBars = insets.getInsets(WindowInsetsCompat.Type.systemBars());
v.setPadding(systemBars.left, systemBars.top, systemBars.right, systemBars.bottom);
return insets;
});
}
}
Project Structure
START 05/21/2025 16
Project Structure
drawable Folder
• It contains the different
types of images used
for the development of
the application.
START 05/21/2025 17
Project Structure
layout Folder
• contains all XML layout
files which we used to
define the user interface
of our application.
• It contains the
activity_main.xml file.
START 05/21/2025 18
<?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:id="@+id/main"
android:layout_width="match_parent"
android:layout_height="match_parent"
tools:context=".MainActivity">
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Hello World!"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent" />
</androidx.constraintlayout.widget.ConstraintLayout>
Project Structure
layout Folder
• This what you will see
once you open the
activity_main.xml
file.
START 05/21/2025 20
Split View
Code View
Design View
Project Structure
mipmap Folder
• contains launcher.xml
files to define icons
that are used to show
on the home screen.
START 05/21/2025 24
Project Structure
values Folder
• contains a number of XML
files like strings, dimensions,
colors, and style definitions.
• One of the most important
files is the strings.xml file
which contains the
resources.
START 05/21/2025 25
<resources>
<string
name="app_name">sampleppt</string>
</resources>
Project Structure
Gradle Scripts Folder
• Gradle means automated
build system and it
contains a number of files
that are used to define a
build configuration that
can be applied to all
modules in our application.
START 05/21/2025 27
Live Demo
Basic Input and Output
START 05/21/2025 28
Key Notes
TextView OnClick
• A basic event used
• A label used in an app.
commonly on buttons.
EditText Imports
• Where you input text • Like android.view.View;
and android.widget.*; is
Button important for us to access
• Where events are certain components in our
added app.
START 05/21/2025 29
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
EdgeToEdge.enable(this);
setContentView(R.layout.activity_main);
ViewCompat.setOnApplyWindowInsetsListener(findViewById(R.id.main),
(v, insets) -> {
Insets systemBars =
insets.getInsets(WindowInsetsCompat.Type.systemBars());
v.setPadding(systemBars.left, systemBars.top, systemBars.right,
systemBars.bottom);
return insets;
});
}
Key Notes
<Button
android:id="@+id/btn_confirm"
android:layout_width="196dp"
android:layout_height="48dp"
android:layout_marginTop="20dp"
public void displayText(View view){ android:backgroundTint="#009688"
android:text="Confirm"
tv1.setText("Hello " + android:textSize="20sp"
et1.getText()); android:onClick="displayText"
} app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintHorizontal_bias="0.5"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@+id/tv_di
splay" />
START 05/21/2025 31
Any
Questions
?
As long as it is related to
the topic
START 05/21/2025 32