Slide 1

Slide 1 text

This work is licensed under the Apache 2.0 License Simplify Your Android Development With XML Fachridan Tio Mu’afa Software Engineer - Android Nusantara Beta Studio (NBS)

Slide 2

Slide 2 text

This work is licensed under the Apache 2.0 License Fachridan Tio Mu’afa Latest Work Experiences: ● Software Engineer - Android, NBS 2024 - Present ● Android Developer, Amanah Corp. 2023 - 2024 ● Android Developer, Fishku Indonesia 2022 - 2023 ● Mobile Development (Android) Mentor 2023 - 2024 ● Mobile Development (Android) Instructor & Advisor 2024 - Present Education: ● UIN Syarif Hidayatullah Jakarta 2019 - 2024 Bachelor of Computer Science Others ● Discord Manager Lead, GoogleDevsID 2022 - Present ● GDG Co-Organizer, GDG Jakarta 2023 - Present ● GDSC Lead, UIN Syarif Hidayatullah 2021 - 2022 About Me

Slide 3

Slide 3 text

This work is licensed under the Apache 2.0 License Android Native Timeline Reference: 10 years of Android Development: The Retrospective - Speaker Deck

Slide 4

Slide 4 text

This work is licensed under the Apache 2.0 License What is your first Android Version?

Slide 5

Slide 5 text

This work is licensed under the Apache 2.0 License Platform Version API level VERSION_CODE Android 15 35 VANILLA_ICE_CREAM Android 14 34 UPSIDE_DOWN_CAKE Android 13 33 TIRAMISU Android 12 31 S Android 11 30 R Android 10 29 Q Android 9 28 P Android 8.0 26 O Android 7.0 24 N Android 6.0 23 M Android 5.0 21 LOLLIPOP Android 4.4 19 KITKAT Android 4.1, 4.1.1 16 JELLY_BEAN

Slide 6

Slide 6 text

This work is licensed under the Apache 2.0 License View & ViewGroup

Slide 7

Slide 7 text

This work is licensed under the Apache 2.0 License View

Slide 8

Slide 8 text

This work is licensed under the Apache 2.0 License View attributes in XML android:="@+id/view_id" android:id="@+id/btn_calculate" android:="" android:layout_width="match_parent" android:layout_height="wrap_content" android:="@/resource_id" android:text="@string/calculate" android:textColor="@color/white" android:backgroundTint="@android:color/holo_red_dark"

Slide 9

Slide 9 text

This work is licensed under the Apache 2.0 License ViewGroup

Slide 10

Slide 10 text

This work is licensed under the Apache 2.0 License ConstraintLayout ● Acts as a default layout for new Android Studio project. ● As a ViewGroup, ConstraintLayout offers flexibility for layout design. ● Provides constraints to determine positions and alignment of UI elements.

Slide 11

Slide 11 text

This work is licensed under the Apache 2.0 License Scroll View ● Used to make your layout can be scrollable. ● Note that a ScrollView can only have one direct child. ● If you have list inside ScrollView, use NestedScrollView instead.

Slide 12

Slide 12 text

This work is licensed under the Apache 2.0 License Activity

Slide 13

Slide 13 text

This work is licensed under the Apache 2.0 License Lifecycle of Activity

Slide 14

Slide 14 text

This work is licensed under the Apache 2.0 License Lifecycle of Activity - Case Study

Slide 15

Slide 15 text

This work is licensed under the Apache 2.0 License Intent

Slide 16

Slide 16 text

This work is licensed under the Apache 2.0 License Explicit Intent VS Implicit Intent

Slide 17

Slide 17 text

This work is licensed under the Apache 2.0 License Explicit Intent val moveIntent = Intent( this@MainActivity, DetailActivity::class.java ) startActivity(moveIntent)

Slide 18

Slide 18 text

This work is licensed under the Apache 2.0 License Implicit Intent val phoneNumber = "081210841382" val dialPhoneIntent = Intent( Intent.ACTION_DIAL, Uri.parse("tel:$phoneNumber") ) startActivity(dialPhoneIntent)

Slide 19

Slide 19 text

This work is licensed under the Apache 2.0 License Various Action of Implicit Intent val web = Intent( Intent.ACTION_VIEW, Uri.parse("http://www.bps.go.id") ) startActivity(web) val dialPhoneIntent = Intent( Intent.ACTION_DIAL, Uri.parse("tel:081210841382") ) startActivity(dialPhoneIntent) And many more … https://developer.android.com/guide/components/intents-common val maps = Intent( Intent.ACTION_VIEW, Uri.parse("geo:-7.053948,110.4318891,z=15")) startActivity(maps) val sms = Intent( Intent.ACTION_SENDTO, Uri.parse("smsto:0831") ) sms.putExtra("sms_body", "Hello, how are you?") startActivity(sms)

Slide 20

Slide 20 text

This work is licensed under the Apache 2.0 License Styles & Theme

Slide 21

Slide 21 text

This work is licensed under the Apache 2.0 License Using Styles <item name="android:layout_width">match_parent</item> <item name="android:layout_height">wrap_content</item> <item name="android:textColor">@color/white</item> <item name="android:margin">16dp</item> <item name="android:padding">16dp</item> <item name="android:textSize">24sp</item> <item name="android:textStyle">bold</item> Styles in themes.xml

Slide 22

Slide 22 text

This work is licensed under the Apache 2.0 License Using Themes

Slide 23

Slide 23 text

This work is licensed under the Apache 2.0 License Material 3 Color Roles In general, a Theme should consist of five essential color groups with the role assignments are: ● Primary ● Secondary ● Tertiary ● Neutral ● Neutral Variant Learn more: https://m3.material.io/styles/color/roles On Primary Primary Secondary On Secondary

Slide 24

Slide 24 text

This work is licensed under the Apache 2.0 License Create your custom Material 3 Theme Custom Material 3 Builder: https://m3.material.io/them e-builder#/custom

Slide 25

Slide 25 text

This work is licensed under the Apache 2.0 License RecyclerView

Slide 26

Slide 26 text

This work is licensed under the Apache 2.0 License RecyclerView ● A successor of the ListView component. ● Has a light memory and good performance.

Slide 27

Slide 27 text

This work is licensed under the Apache 2.0 License ListView and RecyclerView Comparison

Slide 28

Slide 28 text

This work is licensed under the Apache 2.0 License More about RecyclerView ● Contains ViewHolder by default. ● Easy animations for adding, updating, or removing items. ● Support LayoutManager to change layout. ● Support vertical and horizontal scrolling. ● Can be used together with DiffUtil.

Slide 29

Slide 29 text

This work is licensed under the Apache 2.0 License RecyclerView Components ● DataSource — ArrayList or List that contain set of data to be displayed ● Adapter — connects data to the RecyclerView ● Layout Item — XML file for one row of item ● ViewHolder — has view information for displaying one item ● LayoutManager — handles the organization of UI components in a View

Slide 30

Slide 30 text

This work is licensed under the Apache 2.0 License Demo Let’s head over to our Android Studio! RecyclerView - Case Study Demo Link: https://github.com/fachridantm/RecyclerView

Slide 31

Slide 31 text

This work is licensed under the Apache 2.0 License Let’s keep connected! THANK YOU fachridantm.me Deck is available at fachridantm.me/deck