0% found this document useful (0 votes)
63 views19 pages

Tugas 1 - Sevthia Nugraha - BM RPL - AndroidStudio

This document summarizes the key tasks from a practical assignment on basic Android Studio layout. It includes 11 XML code snippets for RelativeLayouts that demonstrate different text, button, and layout properties like size, color, alignment, and styles. Each snippet is labeled "Tugas #" and includes sample text or buttons to showcase the targeted layout property.

Uploaded by

Sevthia Nugraha
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)
63 views19 pages

Tugas 1 - Sevthia Nugraha - BM RPL - AndroidStudio

This document summarizes the key tasks from a practical assignment on basic Android Studio layout. It includes 11 XML code snippets for RelativeLayouts that demonstrate different text, button, and layout properties like size, color, alignment, and styles. Each snippet is labeled "Tugas #" and includes sample text or buttons to showcase the targeted layout property.

Uploaded by

Sevthia Nugraha
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/ 19

LAPORAN APLIKASI MOBILE

PRAKTIKUM 1

Pengenalan Dasar Android Studio

Disusun Oleh :
Sevthia Nugraha (1903423010)
BM RPL

PROGRAM STUDI BROADBAND MULTIMEDIA


JURUSAN TEKNIK ELEKTRO
POLITEKNIK NEGERI JAKARTA
2019
Tugas 1

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


<RelativeLayout 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: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="TEXT 1"
android:id="@+id/teks1"/>
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="TEXT 2"
android:id="@+id/text2"
android:layout_below="@+id/teks1"/>

</RelativeLayout>
Tugas 2

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


<RelativeLayout 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: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="teks menggunakan warna primary color"
android:textColor="@color/colorPrimaryDark"
android:id="@+id/teks1"/>
<TextView
android:paddingTop="20dp"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="teks menggunakan warna primary color"
android:textColor="@color/colorAccent"
android:layout_below="@id/teks1"
android:id="@+id/teks2"/>

</RelativeLayout>
Tugas 3
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout 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: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="MENGGUNAKAN UKURAN 14SP"
android:textSize="14sp"
android:id="@+id/teks1"/>
<TextView
android:paddingTop="20dp"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="MENGGUNAKAN UKURAN 20SP"
android:textColor="@color/colorAccent"
android:layout_below="@+id/text1"
android:id="@+id/teks2"
android:textSize="20sp"/>

</RelativeLayout>
Tugas 4
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:layout_width="match_parent"
android:layout_height="match_parent"
tools:context=".MainActivity">

<TextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="DIGUNAKAN UNTUK HEADING"
android:typeface="serif"

android:textAppearance="?android:attr/textAppearanceLarge"
android:id="@+id/teks1"/>
<TextView
android:paddingTop="20dp"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="DIGUNAKAN UNTUK SUB HEADING"
android:typeface="monospace"
android:textColor="@color/colorAccent"
android:layout_below="@id/teks1"
android:id="@+id/text2"
android:textSize="20sp"

android:textAppearance="?android:attr/textAppearanceMedium"/>

</RelativeLayout>

Tugas 5
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout 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: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="TANPA MENGGUNAKAN STYLE"
android:textSize="14sp"
android:id="@+id/teks1"/>
<TextView
android:paddingTop="20dp"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="MENGGUNAKAN STYLE BOLD"
android:textStyle="bold"
android:textColor="@color/colorAccent"
android:layout_below="@id/teks1"
android:id="@+id/teks2"
android:textSize="20sp"/>
<TextView
android:paddingTop="20dp"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="MENGGUNAKAN STYLE ITALIC"
android:textStyle="italic"
android:textColor="@color/colorPrimary"
android:layout_below="@id/teks2"
android:id="@+id/text3"
android:textSize="20sp"/>

</RelativeLayout>

Tugas 6
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
xmlns:app="http://schemas.android.com/apk/res-auto"
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="TANPA MENGGUNAKAN FONT SERIF"
android:typeface="serif"
android:textSize="14sp"
android:id="@+id/teks1"/>
<TextView
android:paddingTop="20dp"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="TANPA MENGGUNAKAN FONT MONOSPACE"
android:typeface="monospace"
android:textColor="@color/colorAccent"
android:layout_below="@id/teks1"
android:id="@+id/text2"
android:textSize="20sp"/>
<TextView
android:paddingTop="20dp"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="TANPA MENGGUNAKAN FONT SANS"
android:typeface="sans"
android:textColor="@color/colorPrimary"
android:layout_below="@id/text2"
android:id="@+id/text3"
android:textSize="20sp"/>

</RelativeLayout>
Tugas 7
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout 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:layout_width="match_parent"
android:layout_height="match_parent"
tools:context=".MainActivity">

<TextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="PERATAAN TENGAH (CENTER)"
android:typeface="serif"
android:textSize="20sp"
android:textAlignment="center"
android:id="@+id/teks1"/>
<TextView
android:paddingTop="20dp"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="TEXT POSISI DEFAULT"
android:typeface="monospace"
android:textColor="@color/colorAccent"
android:layout_below="@id/teks1"
android:id="@+id/text2"
android:textSize="20sp"/>

</RelativeLayout>

Tugas 8
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout 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:layout_width="match_parent"
android:layout_height="match_parent"
tools:context=".MainActivity">

<Button
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:id="@+id/button1"
android:layout_marginBottom="20dp"
android:text="button menyesuaikan isi teks"
android:elevation="0dp"/>
<Button
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginBottom="20dp"
android:layout_below="@+id/button1"
android:id="@+id/button2"
android:text="button menyesuaikan lebar layout"/>
<Button
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_below="@+id/button2"
android:layout_marginBottom="30dp"
android:id="@+id/button3"
android:background="@color/colorPrimary"
android:text="button dengan warna"/>

</RelativeLayout>

Tugas 9
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout 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:layout_width="match_parent"
android:layout_height="match_parent"
tools:context=".MainActivity">

<TextView
android:id="@+id/Mpitstarbucks"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="Mobile Application"
android:layout_centerHorizontal="true"
android:layout_alignParentTop="true"
android:textAlignment="center"
android:textSize="40dp"
android:textStyle="bold"
android:textColor="@color/colorPrimary"/>

</RelativeLayout>

Tugas 10
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout 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:layout_width="match_parent"
android:layout_height="match_parent"
tools:context=".MainActivity">

<Button
android:id="@+id/button"
android:layout_width="wrap_content"
android:layout_height="match_parent"
android:layout_marginTop="16dp"
android:text="Mobile Application"
app:layout_constraintTop_toTopOf="parent"
tools:layout_editor_absoluteX="13dp"/>

</RelativeLayout>
Tugas 11
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout 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:layout_width="match_parent"
android:layout_height="match_parent"
tools:context=".MainActivity">

<Button
android:id="@+id/button"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="16dp"
android:text="contoh penggunaan M_P"
app:layout_constraintTop_toTopOf="parent"
tools:layout_editor_absoluteX="13dp"/>

</RelativeLayout>
Tugas 12
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout 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:layout_width="match_parent"
android:layout_height="match_parent"
tools:context=".MainActivity">

<Button
android:id="@+id/button"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_marginTop="16dp"
android:text="Mobile Application"
app:layout_constraintTop_toTopOf="parent"
tools:layout_editor_absoluteX="13dp"/>

</RelativeLayout>
Tugas 13
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout 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:layout_width="match_parent"
android:layout_height="match_parent"
tools:context=".MainActivity">

<Button
android:id="@+id/button"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="16dp"
android:text="Mobile Application"
app:layout_constraintTop_toTopOf="parent"
tools:layout_editor_absoluteX="13dp"/>

</RelativeLayout>
Tugas 14
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout 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:layout_width="match_parent"
android:layout_height="match_parent"
tools:context=".MainActivity">

<LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical">

<Button
android:id="@+id/btnSave"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="Save" />

<Button
android:id="@+id/btnOpen"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Open" />

<ImageButton
android:id="@+id/btnImage"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:src="@drawable/ic_launcher_foreground" />

<TextView
android:id="@+id/txtName"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:hint="Anda dapat mengisi nilai atau teks disini" />

<CheckBox
android:id="@+id/autoSave"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="AutoSave" />

<CheckBox
android:id="@+id/cbStar"
style="?android:attr/starStyle"
android:layout_width="match_parent"
android:layout_height="wrap_content" />

<RadioGroup
android:id="@+id/rdbGrp1"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical">

<RadioButton
android:id="@+id/rdb1"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="Option 1" />

<RadioButton
android:id="@+id/rd2"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="Option 2" />
</RadioGroup>
<ToggleButton
android:id="@+id/toggle"
android:layout_width="wrap_content"
android:layout_height="wrap_content" />
</LinearLayout>

</RelativeLayout>

You might also like