0% found this document useful (0 votes)
58 views

Android Studio & Android UI System

Here are the key differences between sp and dp in Android UI units: - sp (scale-independent pixels) is used for text size - it scales with the user's font size preference for the system. - dp (density-independent pixels) is used for dimensions and spacing - it scales based on the device's screen density to maintain consistent visual size on different screens. So in summary: - Use sp for text sizes to ensure the text remains legible as the user scales font size. - Use dp for dimensions and spacing as it allows elements to maintain consistent visual size while adapting to different screen densities.

Uploaded by

Rizca
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
58 views

Android Studio & Android UI System

Here are the key differences between sp and dp in Android UI units: - sp (scale-independent pixels) is used for text size - it scales with the user's font size preference for the system. - dp (density-independent pixels) is used for dimensions and spacing - it scales based on the device's screen density to maintain consistent visual size on different screens. So in summary: - Use sp for text sizes to ensure the text remains legible as the user scales font size. - Use dp for dimensions and spacing as it allows elements to maintain consistent visual size while adapting to different screen densities.

Uploaded by

Rizca
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 24

Lecturer 2 – Understanding Android Studio and Layout System

MOBILE APPLICATION
DEVELOPMENT
Martin C.T. Manullang,(RA), Amirul Iqbal (RB), Arkham Zahri Rahman (RC)

Informatics
Institut Teknologi Sumatera
PENGUMUMAN

• Dikarenakan alasan menjamin kemampuan dan kompetensi


masing-masing mahasiswa dalam pengoperasian android
studio dan pengembangan aplikasi mobile, maka ketentuan
jumlah anggota kelompok yang sebelumnya berjumlah
empat hingga lima orang, diubah menjadi dua orang per
kelompok.
• Hal diatas merupakan hasil keputusan dan kesepakatan tim
dosen pengampu mata kuliah pengembangan aplikasi mobile
INTEGRATED DEVELOPMENT
ENVIRONTMENT (IDE)

• When developing a software, there are many files and it is


hard only to use the command line.
• Therefore, an Integrated Development Environment (IDE)
can be used. An IDE is a software application that provides
comprehensive facilities for developers to build software
applications. It contains code editor, build automation tool
and debugger.
• They provide a complete project structure that makes it
easy to arrange every file necessary for the project.

What IDE can be used for developing android ?


ANDROID STUDIO VS ECLIPSE

• .Android Studio and Eclipse are IDE


• The key difference between Android Studio and Eclipse is
that Android Studio is an Integrated Development
Environment(IDE) specifically developed for Android
applications while Eclipse is an integrated development
environment that is widely used for Java-based application
development.
• Android Studio is specifically designed to build Android
applications but Eclipse is useful for building android as well
as other web and desktop applications. It supports android
through Google ADT plug-in.

Read This
Journal References : http://www.ijfeat.org/papers/march20163.pdf?i=1
ANDROID STUDIO VS ECLIPSE

Android Studio offers:


• Flexible Gradle-based build system
• Build variants and multiple apk file generation
• Code templates to help you build common app features
• Built-in support for Google Cloud Platform, making it easy to
integrate Google Cloud Messaging and App Engine • Rich layout
editor with support for drag and drop theme editing
• lint tools to catch performance, usability, version compatibility,
and other problem
• Built-in support for Google Cloud Platform, making it easy to
integrate Google Cloud Messaging and App Engine • Official
Google Support and usual updates that need no migration

Read This
Journal References : http://www.ijfeat.org/papers/march20163.pdf?i=1
PROS
AND
CONS
PROJECT STRUCTURE

APP
The App folder contains three
subfolders (manifests, java and
res) that make up your
application. They are divided so
that it should be fairly easy to
determine which resources go
in which folder.
PROJECT STRUCTURE

manifests
• A AndroidManifest.xml file is
generated inside manifest folder
by Android Studio when you
create a project.
• This file contains the
configuration parameters of the
project such as permissions,
services and additional libraries.
• A manifest file also provides
information to the OS and
Google Play store about your
app.
PROJECT STRUCTURE

java
• A MainActivity.java is automatically
created in this folder by Android
Studio. All of your classes will be
available here, and Android Studio will
even bundle together the package
path so that you can work with the
files without having to drill down
through the folders that make up
your package.
PROJECT STRUCTURE

generatedJava
• An Auto Generated Java Directory
• The classes you can find here are all
the classes the project will be built
from, including the libraries.
Inspecting these could be useful when
you are having issues with generated
code, such as annotation processors.
PROJECT STRUCTURE

res
• It contains folders that help you
separate and sort the resources of
your application.
• For example, while developing an app,
you need to include resource files
such as the app-logo, photos, sounds,
videos or animations. Each file type
should be added to its own folder to
comply with the Android
development standards.
PROJECT STRUCTURE

Gradle Scripts
• Apk files are built using the gradle
build system, which is integrated in
the Android Studio.
• When we start an app, the gradle
build scripts are automatically
created.
• If you have special requirements for
your project, you can specify these
requirements here.
SISTEM LAYOUT DASAR
• Layout adalah penyusunan dari elemen-elemen desain yang
berhubungan kedalam sebuah bidang sehingga membentuk susunan
artistik.
• Hal ini bisa juga disebut manajemen bentuk dan bidang.
• Tujuan utama layout adalah menampilkan elemen gambar dan teks
agar menjadi komunikatif dalam sebuah cara yang dapat memudahkan
pembaca menerima informasi yang disajikan.
• Dari pengertian tersebut kita bisa simpulkan bahwa layout adalah
sebuah tata letak dari objek atau tampilan desain yang kita buat.
LINEAR LAYOUT

Linear Layout adalah jenis layout dimana user


menempatkan 1 objek per baris atau kolom
secara sejajar. Jadi di dalam setiap baris atau
kolom hanya ada 1 objek yang bisa ditempatkan .

Linear Layout ini ada dua jenis . Yaitu :


• Linear Layout Vertical (Objek per
baris/kesamping)
• Linear Layout Horizontal (Objek per
kolom/kebawah)
LINEAR LAYOUT
RELATIVE LAYOUT

• Relative Layout adalah jenis layout yang


memiliki karakteristik dalam menempatkan
view secara relatif
• Relatif disini berarti posisi dari setiap view
bergantung kepada view yang lain.
• Kita bebas untuk menempatkan objek yang
diinginkan sesuka hati kita. Penempatan satu
objek bisa dimana saja mau di sisi kanan, kiri,
atas, ataupun bawah dari objek lain.
• Jika tidak di tetapkan, maka objek dapat
menumpuk antara satu objek dengan objek
yang lain.
RELATIVE LAYOUT
CONSTRAINT LAYOUT

• Constarint Layout memungkinkan kita


membuat tata letak yang besar dan kompleks
dengan tampilan datar.
• Ini hampir mirip dengan Relative Layout
karena semua tampilan ditata berdasarkan
hubungan antara satu objek dengan yang lain,
tetapi lebih fleksibel daripada RelativeLayout
dan lebih mudah digunakan dengan Editor
Layout Android Studio.
CONSTRAINT LAYOUT
TUGAS DI KELAS

• Carilah aplikasi di play store yang menggunakan prinsip


linear layout minimal 2 buah
• Carilah aplikasi di play store yang menggunakan prinsip
relative atau constraint layout
• Masing-masing mahasiswa harus mampu menjelaskan
perbedaan konsep dari :
• Linear Layout (horizontal maupun vertical)
• Constraint Layout
• Sistem pengembangan UI menggunakan visual dan code
• Fungsi activity_main.xml
EXTRACT RESOURCE
FUNGSI EXTRACT RESOURCE

• Extract Resource memungkinkan developer untuk


melakukan konfigurasi pengaturan UI dengan membuat file
xml baru yang akan ditempatkan pada folder values
• Hal ini akan mempermudah dan memberikan keamanan
serta kenyamanan ketika proses pengembangan karena
mengubah parameter tidak lagi dengan melakukan hard-code
ke dalam activity_main.xml
TASK #2 – UNDERSTANDING UI
SYSTEM

• Lakukan tutorial pada Tugas 2 (halaman 26) dan Tugas 3


(halaman 30) pada modul Android Developer Course
• Buat laporan dalam format pdf dan kumpulkan melalui e-
learning itera
• Jawablah beberapa pertanyaan di slide selanjutnya
TASK #2 – UNDERSTANDING UI
SYSTEM

1. Apa perbedaan Linear Layout – Vertikal dan Linear Layout


– Horizontal ? Jelaskan perbedaannya dengan foto
tampilan android studio kalian masing-masing.
2. Apa perbedaan “sp” dan “dp” dalam satuan ukuran UI ?
(Misalnya 160sp, atau 160dp)

You might also like