SlideShare a Scribd company logo
1 of 21
Kotlin with Jetpack
Compose
RISHIKA KUMARI
Software Consultant (KOTLIN)
Lack of etiquette and manners is a huge turn off.
KnolX Etiquettes
 Punctuality
Join the session 5 minutes prior to the session start time. We start on
time and conclude on time!
 Feedback
Make sure to submit a constructive feedback for all sessions as it is very
helpful for the presenter.
 Silent Mode
Keep your mobile devices in silent mode, feel free to move out of session
in case you need to attend an urgent call.
 Avoid Disturbance
Avoid unwanted chit chat during the session.
1. Getting Start with Kotlin
2. Kotlin's Features and Advantages
3. Traditional XML-based approach :
- Introduction to XML
- Building UI with XML
4. Modern Jetpack Compose approach:
- Basic Concepts
- Importance
- Building UI with Jetpack Compose
5. Comparing XML Layout with Jetpack Compose
- XML Layouts
- Jetpack Compose
6. Advantages of Jetpack Compose over XML
7. When to Use?
8.Future Scope
Getting start with Kotlin
Introduction to Kotlin:
 Kotlin, developed by JetBrains, is a statically-typed language running on JVM, compiling to
JavaScript or native code. It seamlessly integrates with Java, leveraging existing libraries.
 Addressing Java pain points like boilerplate code and null pointer exceptions, Kotlin offers
seamless interoperability, allowing gradual migration to Kotlin from Java codebases.
 With modern features and concise syntax, Kotlin accelerates Android app development and
simplifies maintenance, promoting faster iterations and robust applications.
 Many popular Android libraries like Retrofit, Room, and Jetpack offer first-class support for
Kotlin, enhancing its adoption and providing developers with powerful tools.
 Kotlin's JVM compatibility and comprehensive tooling ecosystem make it a versatile choice for
modern software development, offering a smooth transition path and enhanced productivity.
Key features and advantages:
 Null safety: Kotlin's type system distinguishes between nullable and non-nullable types, reducing
the occurrence of NullPointerExceptions at runtime.
 Concise syntax: Kotlin offers a more concise syntax compared to Java, resulting in less
boilerplate code and increased code readability.
 Extension functions: Developers can add new functionality to existing classes without modifying
their source code, promoting code reuse and modularity.
 Data classes: Kotlin provides a built-in feature for creating data classes, which automatically
generate boilerplate code for properties, equals(), hashCode(), and toString() methods.
 Coroutines: Kotlin's coroutines simplify asynchronous programming by providing a lightweight,
sequential approach to concurrency, making code more readable and maintainable.
Kotlin's interoperability with Java:
 Kotlin was designed to seamlessly interoperate with Java, allowing developers to call Kotlin
code from Java and vice versa without any additional configuration.
 Kotlin code can leverage existing Java libraries and frameworks directly, enabling a smooth
transition for projects with established Java codebases.
 Developers can gradually introduce Kotlin into existing Java projects, allowing for incremental
adoption and integration.
 Kotlin offers advanced interoperability features such as annotation processing, reflection, and
nullability handling, ensuring compatibility with Java's ecosystem and tooling.
Introduction to XML:
 XML stands for eXtensible Markup Language.
 It is a markup language that defines a set of rules for encoding documents in a format that is both
human-readable and machine-readable.
 It provides a structured and hierarchical way to describe the visual elements of an Android
application's user interface.
 In Android, XML is used to define the layout of activities, fragments, and views. Layout XML
files describe the arrangement and appearance of UI elements such as buttons, text views, and
images.
 XML enables a clear separation of concerns between the UI structure and the application logic.
 Developers can focus on designing UI layouts in XML files, while Java or Kotlin code handles
the application's behavior.
 Developers can use drag-and-drop functionality and visual editors to create and modify XML
layout files efficiently.
Composable Functions: State Management:
Declarative Nature:
 Jetpack Compose adopts a
declarative approach to UI
development, where
developers describe the UI's
appearance and behaviour
based on its current state.
 This approach focuses on what
the UI should look like rather
than how it should be
constructed, enhancing
readability and maintainability.
 UI components in Jetpack
Compose are built using
composable functions, regular
Kotlin functions annotated with
@Composable.
 Composable functions represent
individual UI elements and can be
composed together to create
complex UIs.
 It promotes code reuse,
maintainability, and testability by
breaking down UIs into smaller,
reusable components.
 Jetpack Compose provides a
reactive approach to state
management within composable
functions.
 UI state, represented using state
objects, can change over time
based on user interactions or data
updates.
 When the state changes, Jetpack
Compose automatically
recomposes the affected parts of
the UI, ensuring a consistent user
experience.
Basic concepts of Jetpack Compose:
Importance of Jetpack Compose in Android
Development:
 Jetpack Compose introduces a modern, declarative approach to UI development, using Kotlin
syntax, which is more concise and intuitive.
 This modernization streamlines the UI development process, making it faster, more efficient, and
less error-prone.
 Jetpack Compose offers features like instant preview in Android Studio, allowing developers to see
changes to their UI components in real-time.
 Developers can iterate quickly on UI design without needing to rebuild and run the entire
application, resulting in faster development cycles and improved productivity.
 Jetpack Compose promotes the creation of reusable UI components through its composable
function-based approach.
 Developers can easily create custom UI elements and compose them together to build complex
UIs, improving code modularity and maintainability.
Building User Interfaces: XML vs. Jetpack Compose
 Imperative Approach
 Separation of Concerns
 Visual Editor Support
 Static Nature
 Resource Management
 Verbose Syntax
XML Layouts:
 Declarative Approach
 Composability
 Dynamic UIs
 Type Safety and IDE Support
 Integration with Kotlin
 Immediate Preview in IDE
Jetpack Compose:
XML Layouts:
01 02
03
05 06
04
XML layouts follow an imperative
approach where UI elements are
defined in a hierarchical structure using
XML tags and attributes.
Imperative Approach
XML layouts promote a separation of
concerns by separating the UI
presentation from the application logic.
Separation of Concerns
XML layouts are typically stored in
separate resource files within the "res"
directory of an Android project.
Resource Management
Developers can use drag-and-drop tools to
design UI layouts visually, which can be
helpful for prototyping and quick iterations.
Visual Editor Support
XML layouts are static in nature, meaning that UI
elements are defined statically in XML files and
cannot be manipulated dynamically at runtime
without additional coding.
Static Nature
XML layouts can become verbose and
repetitive, especially for complex UI
designs.
Verbose Syntax
Jetpack Compose:
01 02
03
05 06
04
Developers specify the desired UI layout
and behavior using Kotlin code, which is
more concise and expressive compared
to XML layouts.
Declarative Approach
Jetpack Compose promotes
composability by breaking down UIs into
small, reusable components called
"composables."
Composability
Developers can use Kotlin's concise
syntax and powerful abstractions to
express complex UI logic more
efficiently.
Integration with Kotlin
With Jetpack Compose, UI elements
can be updated dynamically in response
to changes in state or user interactions.
Dynamic UIs
Jetpack Compose leverages Kotlin's
type safety and IDE support, providing
features like code completion,
refactoring, and error checking.
Type Safety and IDE Support
It allows developers to see the UI
changes in real-time as they write
code.
Immediate Preview in IDE
Advantages of Jetpack Compose over XML Layouts:
 Reduced Boilerplate: Jetpack Compose eliminates the need for verbose XML markup, reducing
boilerplate code and making UI development more efficient.
 Improved Readability: Kotlin code in Jetpack Compose is often more readable and
maintainable compared to XML layouts, thanks to its concise syntax and expressive nature.
 Unified Language: Jetpack Compose allows developers to use a single language (Kotlin) for
both application logic and UI development, simplifying the development workflow and reducing
context switching.
 Better Performance: Jetpack Compose offers better performance compared to XML layouts, as
UI elements are created and updated more efficiently using a reactive programming model.
When to use ?
 Use XML for existing projects or when
working with legacy codebases that rely on
the traditional Android UI toolkit.
 XML may be suitable for simple UI layouts
or when working with designers who are
more familiar with visual layout editors like
Android Studio's Layout Editor.
XML
 Use Jetpack Compose for new projects or
when starting fresh UI development.
 Jetpack Compose is well-suited for building
modern and dynamic user interfaces with
complex interactions and animations.
 Consider Jetpack Compose for projects
where you want to leverage the benefits of
declarative UI programming, improved
productivity, and better performance.
Jetpack Compose
Future Scope:
Maturity and Stabilization
Tooling and Ecosystem Support
Feature Expansion
Cross-Platform Compatibility
Jetpack Compose is still evolving, and future releases will likely
focus on stabilizing the API, improving performance, and
addressing feedback from developers.
Jetpack Compose will continue to expand its feature
set, introducing new components, layouts, and
capabilities to empower developers to create modern
and feature-rich user interfaces.
Integration with other frameworks and
technologies, such as Kotlin
Multiplatform and Flutter, may further
enhance Jetpack Compose's cross-
platform capabilities.
Google and third-party tools and libraries will continue to
improve tooling support for Jetpack Compose, including IDE
integrations, code generation tools, and debugging utilities.
Kotlin With JetPack Compose Presentation

More Related Content

Similar to Kotlin With JetPack Compose Presentation

Kotlin native for iOS and Android
Kotlin native for iOS and AndroidKotlin native for iOS and Android
Kotlin native for iOS and AndroidShady Selim
 
Why Use Kotlin for Android App Development-Here’s a Guide.pdf
Why Use Kotlin for Android App Development-Here’s a Guide.pdfWhy Use Kotlin for Android App Development-Here’s a Guide.pdf
Why Use Kotlin for Android App Development-Here’s a Guide.pdfTechugo
 
Android Development with Kotlin course
Android Development  with Kotlin courseAndroid Development  with Kotlin course
Android Development with Kotlin courseGoogleDevelopersLeba
 
Kotlin for Web Development Possibilities and Challenges.pptx
Kotlin for Web Development Possibilities and Challenges.pptxKotlin for Web Development Possibilities and Challenges.pptx
Kotlin for Web Development Possibilities and Challenges.pptxEllocent Labs
 
Learn Kotlin and Build Robust Android Apps with Bcoder.pdf
Learn Kotlin and Build Robust Android Apps with Bcoder.pdfLearn Kotlin and Build Robust Android Apps with Bcoder.pdf
Learn Kotlin and Build Robust Android Apps with Bcoder.pdfBcoder Dev
 
Why to Choose Kotlin in 2023 to Build Mobile Apps Faster?
Why to Choose Kotlin in 2023 to Build Mobile Apps Faster?Why to Choose Kotlin in 2023 to Build Mobile Apps Faster?
Why to Choose Kotlin in 2023 to Build Mobile Apps Faster?9 series
 
Android with Kotlin Course - SkillIQ.pdf
Android with Kotlin Course - SkillIQ.pdfAndroid with Kotlin Course - SkillIQ.pdf
Android with Kotlin Course - SkillIQ.pdfSkilliQCourse
 
Kotlin Overview
Kotlin OverviewKotlin Overview
Kotlin OverviewEkta Raj
 
Kotlin for Android
Kotlin for AndroidKotlin for Android
Kotlin for AndroidHan Yin
 
Kotlin vs Java: Which is Better for Android App Development?
Kotlin vs Java: Which is Better for Android App Development?Kotlin vs Java: Which is Better for Android App Development?
Kotlin vs Java: Which is Better for Android App Development?Marie Weaver
 
Advantages of Kotlin for Android App Development
Advantages of Kotlin for Android App DevelopmentAdvantages of Kotlin for Android App Development
Advantages of Kotlin for Android App DevelopmentXcelTec pvt ltd
 
Multiplatform shared codebase with Kotlin/Native - UA Mobile 2019
Multiplatform shared codebase with Kotlin/Native - UA Mobile 2019Multiplatform shared codebase with Kotlin/Native - UA Mobile 2019
Multiplatform shared codebase with Kotlin/Native - UA Mobile 2019Eugene Kurko
 
Multiplatform shared codebase with Kotlin/Native - UA Mobile 2019
Multiplatform shared codebase with Kotlin/Native - UA Mobile 2019Multiplatform shared codebase with Kotlin/Native - UA Mobile 2019
Multiplatform shared codebase with Kotlin/Native - UA Mobile 2019UA Mobile
 
1 get started with c#
1   get started with c#1   get started with c#
1 get started with c#Tuan Ngo
 
Kotlin vs flutter which is better for doing business
Kotlin vs flutter  which is better for doing business Kotlin vs flutter  which is better for doing business
Kotlin vs flutter which is better for doing business Concetto Labs
 

Similar to Kotlin With JetPack Compose Presentation (20)

Kotlin native for iOS and Android
Kotlin native for iOS and AndroidKotlin native for iOS and Android
Kotlin native for iOS and Android
 
Why Use Kotlin for Android App Development-Here’s a Guide.pdf
Why Use Kotlin for Android App Development-Here’s a Guide.pdfWhy Use Kotlin for Android App Development-Here’s a Guide.pdf
Why Use Kotlin for Android App Development-Here’s a Guide.pdf
 
Android Development with Kotlin course
Android Development  with Kotlin courseAndroid Development  with Kotlin course
Android Development with Kotlin course
 
Android with kotlin course
Android with kotlin courseAndroid with kotlin course
Android with kotlin course
 
Kotlin for Web Development Possibilities and Challenges.pptx
Kotlin for Web Development Possibilities and Challenges.pptxKotlin for Web Development Possibilities and Challenges.pptx
Kotlin for Web Development Possibilities and Challenges.pptx
 
Learn Kotlin and Build Robust Android Apps with Bcoder.pdf
Learn Kotlin and Build Robust Android Apps with Bcoder.pdfLearn Kotlin and Build Robust Android Apps with Bcoder.pdf
Learn Kotlin and Build Robust Android Apps with Bcoder.pdf
 
Kotlin
KotlinKotlin
Kotlin
 
Why to Choose Kotlin in 2023 to Build Mobile Apps Faster?
Why to Choose Kotlin in 2023 to Build Mobile Apps Faster?Why to Choose Kotlin in 2023 to Build Mobile Apps Faster?
Why to Choose Kotlin in 2023 to Build Mobile Apps Faster?
 
Android with Kotlin Course - SkillIQ.pdf
Android with Kotlin Course - SkillIQ.pdfAndroid with Kotlin Course - SkillIQ.pdf
Android with Kotlin Course - SkillIQ.pdf
 
Kotlin Overview
Kotlin OverviewKotlin Overview
Kotlin Overview
 
Kotlin for Android
Kotlin for AndroidKotlin for Android
Kotlin for Android
 
Kotlin vs Java: Which is Better for Android App Development?
Kotlin vs Java: Which is Better for Android App Development?Kotlin vs Java: Which is Better for Android App Development?
Kotlin vs Java: Which is Better for Android App Development?
 
Angular 9
Angular 9 Angular 9
Angular 9
 
Advantages of Kotlin for Android App Development
Advantages of Kotlin for Android App DevelopmentAdvantages of Kotlin for Android App Development
Advantages of Kotlin for Android App Development
 
Multiplatform shared codebase with Kotlin/Native - UA Mobile 2019
Multiplatform shared codebase with Kotlin/Native - UA Mobile 2019Multiplatform shared codebase with Kotlin/Native - UA Mobile 2019
Multiplatform shared codebase with Kotlin/Native - UA Mobile 2019
 
Multiplatform shared codebase with Kotlin/Native - UA Mobile 2019
Multiplatform shared codebase with Kotlin/Native - UA Mobile 2019Multiplatform shared codebase with Kotlin/Native - UA Mobile 2019
Multiplatform shared codebase with Kotlin/Native - UA Mobile 2019
 
Android study jam session 1
Android study jam   session 1Android study jam   session 1
Android study jam session 1
 
1 get started with c#
1   get started with c#1   get started with c#
1 get started with c#
 
Kotlin vs flutter which is better for doing business
Kotlin vs flutter  which is better for doing business Kotlin vs flutter  which is better for doing business
Kotlin vs flutter which is better for doing business
 
Why Choose Kotlin For Android Application Development.pptx
Why Choose Kotlin For Android Application Development.pptxWhy Choose Kotlin For Android Application Development.pptx
Why Choose Kotlin For Android Application Development.pptx
 

More from Knoldus Inc.

Authentication in Svelte using cookies.pptx
Authentication in Svelte using cookies.pptxAuthentication in Svelte using cookies.pptx
Authentication in Svelte using cookies.pptxKnoldus Inc.
 
OAuth2 Implementation Presentation (Java)
OAuth2 Implementation Presentation (Java)OAuth2 Implementation Presentation (Java)
OAuth2 Implementation Presentation (Java)Knoldus Inc.
 
Supply chain security with Kubeclarity.pptx
Supply chain security with Kubeclarity.pptxSupply chain security with Kubeclarity.pptx
Supply chain security with Kubeclarity.pptxKnoldus Inc.
 
Mastering Web Scraping with JSoup Unlocking the Secrets of HTML Parsing
Mastering Web Scraping with JSoup Unlocking the Secrets of HTML ParsingMastering Web Scraping with JSoup Unlocking the Secrets of HTML Parsing
Mastering Web Scraping with JSoup Unlocking the Secrets of HTML ParsingKnoldus Inc.
 
Akka gRPC Essentials A Hands-On Introduction
Akka gRPC Essentials A Hands-On IntroductionAkka gRPC Essentials A Hands-On Introduction
Akka gRPC Essentials A Hands-On IntroductionKnoldus Inc.
 
Entity Core with Core Microservices.pptx
Entity Core with Core Microservices.pptxEntity Core with Core Microservices.pptx
Entity Core with Core Microservices.pptxKnoldus Inc.
 
Introduction to Redis and its features.pptx
Introduction to Redis and its features.pptxIntroduction to Redis and its features.pptx
Introduction to Redis and its features.pptxKnoldus Inc.
 
GraphQL with .NET Core Microservices.pdf
GraphQL with .NET Core Microservices.pdfGraphQL with .NET Core Microservices.pdf
GraphQL with .NET Core Microservices.pdfKnoldus Inc.
 
NuGet Packages Presentation (DoT NeT).pptx
NuGet Packages Presentation (DoT NeT).pptxNuGet Packages Presentation (DoT NeT).pptx
NuGet Packages Presentation (DoT NeT).pptxKnoldus Inc.
 
Data Quality in Test Automation Navigating the Path to Reliable Testing
Data Quality in Test Automation Navigating the Path to Reliable TestingData Quality in Test Automation Navigating the Path to Reliable Testing
Data Quality in Test Automation Navigating the Path to Reliable TestingKnoldus Inc.
 
K8sGPTThe AI​ way to diagnose Kubernetes
K8sGPTThe AI​ way to diagnose KubernetesK8sGPTThe AI​ way to diagnose Kubernetes
K8sGPTThe AI​ way to diagnose KubernetesKnoldus Inc.
 
Introduction to Circle Ci Presentation.pptx
Introduction to Circle Ci Presentation.pptxIntroduction to Circle Ci Presentation.pptx
Introduction to Circle Ci Presentation.pptxKnoldus Inc.
 
Robusta -Tool Presentation (DevOps).pptx
Robusta -Tool Presentation (DevOps).pptxRobusta -Tool Presentation (DevOps).pptx
Robusta -Tool Presentation (DevOps).pptxKnoldus Inc.
 
Optimizing Kubernetes using GOLDILOCKS.pptx
Optimizing Kubernetes using GOLDILOCKS.pptxOptimizing Kubernetes using GOLDILOCKS.pptx
Optimizing Kubernetes using GOLDILOCKS.pptxKnoldus Inc.
 
Azure Function App Exception Handling.pptx
Azure Function App Exception Handling.pptxAzure Function App Exception Handling.pptx
Azure Function App Exception Handling.pptxKnoldus Inc.
 
CQRS Design Pattern Presentation (Java).pptx
CQRS Design Pattern Presentation (Java).pptxCQRS Design Pattern Presentation (Java).pptx
CQRS Design Pattern Presentation (Java).pptxKnoldus Inc.
 
ETL Observability: Azure to Snowflake Presentation
ETL Observability: Azure to Snowflake PresentationETL Observability: Azure to Snowflake Presentation
ETL Observability: Azure to Snowflake PresentationKnoldus Inc.
 
Scripting with K6 - Beyond the Basics Presentation
Scripting with K6 - Beyond the Basics PresentationScripting with K6 - Beyond the Basics Presentation
Scripting with K6 - Beyond the Basics PresentationKnoldus Inc.
 
Getting started with dotnet core Web APIs
Getting started with dotnet core Web APIsGetting started with dotnet core Web APIs
Getting started with dotnet core Web APIsKnoldus Inc.
 
Introduction To Rust part II Presentation
Introduction To Rust part II PresentationIntroduction To Rust part II Presentation
Introduction To Rust part II PresentationKnoldus Inc.
 

More from Knoldus Inc. (20)

Authentication in Svelte using cookies.pptx
Authentication in Svelte using cookies.pptxAuthentication in Svelte using cookies.pptx
Authentication in Svelte using cookies.pptx
 
OAuth2 Implementation Presentation (Java)
OAuth2 Implementation Presentation (Java)OAuth2 Implementation Presentation (Java)
OAuth2 Implementation Presentation (Java)
 
Supply chain security with Kubeclarity.pptx
Supply chain security with Kubeclarity.pptxSupply chain security with Kubeclarity.pptx
Supply chain security with Kubeclarity.pptx
 
Mastering Web Scraping with JSoup Unlocking the Secrets of HTML Parsing
Mastering Web Scraping with JSoup Unlocking the Secrets of HTML ParsingMastering Web Scraping with JSoup Unlocking the Secrets of HTML Parsing
Mastering Web Scraping with JSoup Unlocking the Secrets of HTML Parsing
 
Akka gRPC Essentials A Hands-On Introduction
Akka gRPC Essentials A Hands-On IntroductionAkka gRPC Essentials A Hands-On Introduction
Akka gRPC Essentials A Hands-On Introduction
 
Entity Core with Core Microservices.pptx
Entity Core with Core Microservices.pptxEntity Core with Core Microservices.pptx
Entity Core with Core Microservices.pptx
 
Introduction to Redis and its features.pptx
Introduction to Redis and its features.pptxIntroduction to Redis and its features.pptx
Introduction to Redis and its features.pptx
 
GraphQL with .NET Core Microservices.pdf
GraphQL with .NET Core Microservices.pdfGraphQL with .NET Core Microservices.pdf
GraphQL with .NET Core Microservices.pdf
 
NuGet Packages Presentation (DoT NeT).pptx
NuGet Packages Presentation (DoT NeT).pptxNuGet Packages Presentation (DoT NeT).pptx
NuGet Packages Presentation (DoT NeT).pptx
 
Data Quality in Test Automation Navigating the Path to Reliable Testing
Data Quality in Test Automation Navigating the Path to Reliable TestingData Quality in Test Automation Navigating the Path to Reliable Testing
Data Quality in Test Automation Navigating the Path to Reliable Testing
 
K8sGPTThe AI​ way to diagnose Kubernetes
K8sGPTThe AI​ way to diagnose KubernetesK8sGPTThe AI​ way to diagnose Kubernetes
K8sGPTThe AI​ way to diagnose Kubernetes
 
Introduction to Circle Ci Presentation.pptx
Introduction to Circle Ci Presentation.pptxIntroduction to Circle Ci Presentation.pptx
Introduction to Circle Ci Presentation.pptx
 
Robusta -Tool Presentation (DevOps).pptx
Robusta -Tool Presentation (DevOps).pptxRobusta -Tool Presentation (DevOps).pptx
Robusta -Tool Presentation (DevOps).pptx
 
Optimizing Kubernetes using GOLDILOCKS.pptx
Optimizing Kubernetes using GOLDILOCKS.pptxOptimizing Kubernetes using GOLDILOCKS.pptx
Optimizing Kubernetes using GOLDILOCKS.pptx
 
Azure Function App Exception Handling.pptx
Azure Function App Exception Handling.pptxAzure Function App Exception Handling.pptx
Azure Function App Exception Handling.pptx
 
CQRS Design Pattern Presentation (Java).pptx
CQRS Design Pattern Presentation (Java).pptxCQRS Design Pattern Presentation (Java).pptx
CQRS Design Pattern Presentation (Java).pptx
 
ETL Observability: Azure to Snowflake Presentation
ETL Observability: Azure to Snowflake PresentationETL Observability: Azure to Snowflake Presentation
ETL Observability: Azure to Snowflake Presentation
 
Scripting with K6 - Beyond the Basics Presentation
Scripting with K6 - Beyond the Basics PresentationScripting with K6 - Beyond the Basics Presentation
Scripting with K6 - Beyond the Basics Presentation
 
Getting started with dotnet core Web APIs
Getting started with dotnet core Web APIsGetting started with dotnet core Web APIs
Getting started with dotnet core Web APIs
 
Introduction To Rust part II Presentation
Introduction To Rust part II PresentationIntroduction To Rust part II Presentation
Introduction To Rust part II Presentation
 

Recently uploaded

Six Myths about Ontologies: The Basics of Formal Ontology
Six Myths about Ontologies: The Basics of Formal OntologySix Myths about Ontologies: The Basics of Formal Ontology
Six Myths about Ontologies: The Basics of Formal Ontologyjohnbeverley2021
 
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...DianaGray10
 
Stronger Together: Developing an Organizational Strategy for Accessible Desig...
Stronger Together: Developing an Organizational Strategy for Accessible Desig...Stronger Together: Developing an Organizational Strategy for Accessible Desig...
Stronger Together: Developing an Organizational Strategy for Accessible Desig...caitlingebhard1
 
AI in Action: Real World Use Cases by Anitaraj
AI in Action: Real World Use Cases by AnitarajAI in Action: Real World Use Cases by Anitaraj
AI in Action: Real World Use Cases by AnitarajAnitaRaj43
 
MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024MIND CTI
 
Finding Java's Hidden Performance Traps @ DevoxxUK 2024
Finding Java's Hidden Performance Traps @ DevoxxUK 2024Finding Java's Hidden Performance Traps @ DevoxxUK 2024
Finding Java's Hidden Performance Traps @ DevoxxUK 2024Victor Rentea
 
Quantum Leap in Next-Generation Computing
Quantum Leap in Next-Generation ComputingQuantum Leap in Next-Generation Computing
Quantum Leap in Next-Generation ComputingWSO2
 
Decarbonising Commercial Real Estate: The Role of Operational Performance
Decarbonising Commercial Real Estate: The Role of Operational PerformanceDecarbonising Commercial Real Estate: The Role of Operational Performance
Decarbonising Commercial Real Estate: The Role of Operational PerformanceIES VE
 
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost SavingRepurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost SavingEdi Saputra
 
The Zero-ETL Approach: Enhancing Data Agility and Insight
The Zero-ETL Approach: Enhancing Data Agility and InsightThe Zero-ETL Approach: Enhancing Data Agility and Insight
The Zero-ETL Approach: Enhancing Data Agility and InsightSafe Software
 
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FMESafe Software
 
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024Victor Rentea
 
Rising Above_ Dubai Floods and the Fortitude of Dubai International Airport.pdf
Rising Above_ Dubai Floods and the Fortitude of Dubai International Airport.pdfRising Above_ Dubai Floods and the Fortitude of Dubai International Airport.pdf
Rising Above_ Dubai Floods and the Fortitude of Dubai International Airport.pdfOrbitshub
 
ChatGPT and Beyond - Elevating DevOps Productivity
ChatGPT and Beyond - Elevating DevOps ProductivityChatGPT and Beyond - Elevating DevOps Productivity
ChatGPT and Beyond - Elevating DevOps ProductivityVictorSzoltysek
 
DEV meet-up UiPath Document Understanding May 7 2024 Amsterdam
DEV meet-up UiPath Document Understanding May 7 2024 AmsterdamDEV meet-up UiPath Document Understanding May 7 2024 Amsterdam
DEV meet-up UiPath Document Understanding May 7 2024 AmsterdamUiPathCommunity
 
WSO2 Micro Integrator for Enterprise Integration in a Decentralized, Microser...
WSO2 Micro Integrator for Enterprise Integration in a Decentralized, Microser...WSO2 Micro Integrator for Enterprise Integration in a Decentralized, Microser...
WSO2 Micro Integrator for Enterprise Integration in a Decentralized, Microser...WSO2
 
TrustArc Webinar - Unified Trust Center for Privacy, Security, Compliance, an...
TrustArc Webinar - Unified Trust Center for Privacy, Security, Compliance, an...TrustArc Webinar - Unified Trust Center for Privacy, Security, Compliance, an...
TrustArc Webinar - Unified Trust Center for Privacy, Security, Compliance, an...TrustArc
 
Architecting Cloud Native Applications
Architecting Cloud Native ApplicationsArchitecting Cloud Native Applications
Architecting Cloud Native ApplicationsWSO2
 
WSO2's API Vision: Unifying Control, Empowering Developers
WSO2's API Vision: Unifying Control, Empowering DevelopersWSO2's API Vision: Unifying Control, Empowering Developers
WSO2's API Vision: Unifying Control, Empowering DevelopersWSO2
 
Exploring Multimodal Embeddings with Milvus
Exploring Multimodal Embeddings with MilvusExploring Multimodal Embeddings with Milvus
Exploring Multimodal Embeddings with MilvusZilliz
 

Recently uploaded (20)

Six Myths about Ontologies: The Basics of Formal Ontology
Six Myths about Ontologies: The Basics of Formal OntologySix Myths about Ontologies: The Basics of Formal Ontology
Six Myths about Ontologies: The Basics of Formal Ontology
 
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
 
Stronger Together: Developing an Organizational Strategy for Accessible Desig...
Stronger Together: Developing an Organizational Strategy for Accessible Desig...Stronger Together: Developing an Organizational Strategy for Accessible Desig...
Stronger Together: Developing an Organizational Strategy for Accessible Desig...
 
AI in Action: Real World Use Cases by Anitaraj
AI in Action: Real World Use Cases by AnitarajAI in Action: Real World Use Cases by Anitaraj
AI in Action: Real World Use Cases by Anitaraj
 
MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024
 
Finding Java's Hidden Performance Traps @ DevoxxUK 2024
Finding Java's Hidden Performance Traps @ DevoxxUK 2024Finding Java's Hidden Performance Traps @ DevoxxUK 2024
Finding Java's Hidden Performance Traps @ DevoxxUK 2024
 
Quantum Leap in Next-Generation Computing
Quantum Leap in Next-Generation ComputingQuantum Leap in Next-Generation Computing
Quantum Leap in Next-Generation Computing
 
Decarbonising Commercial Real Estate: The Role of Operational Performance
Decarbonising Commercial Real Estate: The Role of Operational PerformanceDecarbonising Commercial Real Estate: The Role of Operational Performance
Decarbonising Commercial Real Estate: The Role of Operational Performance
 
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost SavingRepurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
 
The Zero-ETL Approach: Enhancing Data Agility and Insight
The Zero-ETL Approach: Enhancing Data Agility and InsightThe Zero-ETL Approach: Enhancing Data Agility and Insight
The Zero-ETL Approach: Enhancing Data Agility and Insight
 
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
 
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
 
Rising Above_ Dubai Floods and the Fortitude of Dubai International Airport.pdf
Rising Above_ Dubai Floods and the Fortitude of Dubai International Airport.pdfRising Above_ Dubai Floods and the Fortitude of Dubai International Airport.pdf
Rising Above_ Dubai Floods and the Fortitude of Dubai International Airport.pdf
 
ChatGPT and Beyond - Elevating DevOps Productivity
ChatGPT and Beyond - Elevating DevOps ProductivityChatGPT and Beyond - Elevating DevOps Productivity
ChatGPT and Beyond - Elevating DevOps Productivity
 
DEV meet-up UiPath Document Understanding May 7 2024 Amsterdam
DEV meet-up UiPath Document Understanding May 7 2024 AmsterdamDEV meet-up UiPath Document Understanding May 7 2024 Amsterdam
DEV meet-up UiPath Document Understanding May 7 2024 Amsterdam
 
WSO2 Micro Integrator for Enterprise Integration in a Decentralized, Microser...
WSO2 Micro Integrator for Enterprise Integration in a Decentralized, Microser...WSO2 Micro Integrator for Enterprise Integration in a Decentralized, Microser...
WSO2 Micro Integrator for Enterprise Integration in a Decentralized, Microser...
 
TrustArc Webinar - Unified Trust Center for Privacy, Security, Compliance, an...
TrustArc Webinar - Unified Trust Center for Privacy, Security, Compliance, an...TrustArc Webinar - Unified Trust Center for Privacy, Security, Compliance, an...
TrustArc Webinar - Unified Trust Center for Privacy, Security, Compliance, an...
 
Architecting Cloud Native Applications
Architecting Cloud Native ApplicationsArchitecting Cloud Native Applications
Architecting Cloud Native Applications
 
WSO2's API Vision: Unifying Control, Empowering Developers
WSO2's API Vision: Unifying Control, Empowering DevelopersWSO2's API Vision: Unifying Control, Empowering Developers
WSO2's API Vision: Unifying Control, Empowering Developers
 
Exploring Multimodal Embeddings with Milvus
Exploring Multimodal Embeddings with MilvusExploring Multimodal Embeddings with Milvus
Exploring Multimodal Embeddings with Milvus
 

Kotlin With JetPack Compose Presentation

  • 1. Kotlin with Jetpack Compose RISHIKA KUMARI Software Consultant (KOTLIN)
  • 2. Lack of etiquette and manners is a huge turn off. KnolX Etiquettes  Punctuality Join the session 5 minutes prior to the session start time. We start on time and conclude on time!  Feedback Make sure to submit a constructive feedback for all sessions as it is very helpful for the presenter.  Silent Mode Keep your mobile devices in silent mode, feel free to move out of session in case you need to attend an urgent call.  Avoid Disturbance Avoid unwanted chit chat during the session.
  • 3. 1. Getting Start with Kotlin 2. Kotlin's Features and Advantages 3. Traditional XML-based approach : - Introduction to XML - Building UI with XML 4. Modern Jetpack Compose approach: - Basic Concepts - Importance - Building UI with Jetpack Compose 5. Comparing XML Layout with Jetpack Compose - XML Layouts - Jetpack Compose 6. Advantages of Jetpack Compose over XML 7. When to Use? 8.Future Scope
  • 5. Introduction to Kotlin:  Kotlin, developed by JetBrains, is a statically-typed language running on JVM, compiling to JavaScript or native code. It seamlessly integrates with Java, leveraging existing libraries.  Addressing Java pain points like boilerplate code and null pointer exceptions, Kotlin offers seamless interoperability, allowing gradual migration to Kotlin from Java codebases.  With modern features and concise syntax, Kotlin accelerates Android app development and simplifies maintenance, promoting faster iterations and robust applications.  Many popular Android libraries like Retrofit, Room, and Jetpack offer first-class support for Kotlin, enhancing its adoption and providing developers with powerful tools.  Kotlin's JVM compatibility and comprehensive tooling ecosystem make it a versatile choice for modern software development, offering a smooth transition path and enhanced productivity.
  • 6. Key features and advantages:  Null safety: Kotlin's type system distinguishes between nullable and non-nullable types, reducing the occurrence of NullPointerExceptions at runtime.  Concise syntax: Kotlin offers a more concise syntax compared to Java, resulting in less boilerplate code and increased code readability.  Extension functions: Developers can add new functionality to existing classes without modifying their source code, promoting code reuse and modularity.  Data classes: Kotlin provides a built-in feature for creating data classes, which automatically generate boilerplate code for properties, equals(), hashCode(), and toString() methods.  Coroutines: Kotlin's coroutines simplify asynchronous programming by providing a lightweight, sequential approach to concurrency, making code more readable and maintainable.
  • 7. Kotlin's interoperability with Java:  Kotlin was designed to seamlessly interoperate with Java, allowing developers to call Kotlin code from Java and vice versa without any additional configuration.  Kotlin code can leverage existing Java libraries and frameworks directly, enabling a smooth transition for projects with established Java codebases.  Developers can gradually introduce Kotlin into existing Java projects, allowing for incremental adoption and integration.  Kotlin offers advanced interoperability features such as annotation processing, reflection, and nullability handling, ensuring compatibility with Java's ecosystem and tooling.
  • 8. Introduction to XML:  XML stands for eXtensible Markup Language.  It is a markup language that defines a set of rules for encoding documents in a format that is both human-readable and machine-readable.  It provides a structured and hierarchical way to describe the visual elements of an Android application's user interface.  In Android, XML is used to define the layout of activities, fragments, and views. Layout XML files describe the arrangement and appearance of UI elements such as buttons, text views, and images.  XML enables a clear separation of concerns between the UI structure and the application logic.  Developers can focus on designing UI layouts in XML files, while Java or Kotlin code handles the application's behavior.  Developers can use drag-and-drop functionality and visual editors to create and modify XML layout files efficiently.
  • 9.
  • 10.
  • 11. Composable Functions: State Management: Declarative Nature:  Jetpack Compose adopts a declarative approach to UI development, where developers describe the UI's appearance and behaviour based on its current state.  This approach focuses on what the UI should look like rather than how it should be constructed, enhancing readability and maintainability.  UI components in Jetpack Compose are built using composable functions, regular Kotlin functions annotated with @Composable.  Composable functions represent individual UI elements and can be composed together to create complex UIs.  It promotes code reuse, maintainability, and testability by breaking down UIs into smaller, reusable components.  Jetpack Compose provides a reactive approach to state management within composable functions.  UI state, represented using state objects, can change over time based on user interactions or data updates.  When the state changes, Jetpack Compose automatically recomposes the affected parts of the UI, ensuring a consistent user experience. Basic concepts of Jetpack Compose:
  • 12. Importance of Jetpack Compose in Android Development:  Jetpack Compose introduces a modern, declarative approach to UI development, using Kotlin syntax, which is more concise and intuitive.  This modernization streamlines the UI development process, making it faster, more efficient, and less error-prone.  Jetpack Compose offers features like instant preview in Android Studio, allowing developers to see changes to their UI components in real-time.  Developers can iterate quickly on UI design without needing to rebuild and run the entire application, resulting in faster development cycles and improved productivity.  Jetpack Compose promotes the creation of reusable UI components through its composable function-based approach.  Developers can easily create custom UI elements and compose them together to build complex UIs, improving code modularity and maintainability.
  • 13.
  • 14.
  • 15. Building User Interfaces: XML vs. Jetpack Compose  Imperative Approach  Separation of Concerns  Visual Editor Support  Static Nature  Resource Management  Verbose Syntax XML Layouts:  Declarative Approach  Composability  Dynamic UIs  Type Safety and IDE Support  Integration with Kotlin  Immediate Preview in IDE Jetpack Compose:
  • 16. XML Layouts: 01 02 03 05 06 04 XML layouts follow an imperative approach where UI elements are defined in a hierarchical structure using XML tags and attributes. Imperative Approach XML layouts promote a separation of concerns by separating the UI presentation from the application logic. Separation of Concerns XML layouts are typically stored in separate resource files within the "res" directory of an Android project. Resource Management Developers can use drag-and-drop tools to design UI layouts visually, which can be helpful for prototyping and quick iterations. Visual Editor Support XML layouts are static in nature, meaning that UI elements are defined statically in XML files and cannot be manipulated dynamically at runtime without additional coding. Static Nature XML layouts can become verbose and repetitive, especially for complex UI designs. Verbose Syntax
  • 17. Jetpack Compose: 01 02 03 05 06 04 Developers specify the desired UI layout and behavior using Kotlin code, which is more concise and expressive compared to XML layouts. Declarative Approach Jetpack Compose promotes composability by breaking down UIs into small, reusable components called "composables." Composability Developers can use Kotlin's concise syntax and powerful abstractions to express complex UI logic more efficiently. Integration with Kotlin With Jetpack Compose, UI elements can be updated dynamically in response to changes in state or user interactions. Dynamic UIs Jetpack Compose leverages Kotlin's type safety and IDE support, providing features like code completion, refactoring, and error checking. Type Safety and IDE Support It allows developers to see the UI changes in real-time as they write code. Immediate Preview in IDE
  • 18. Advantages of Jetpack Compose over XML Layouts:  Reduced Boilerplate: Jetpack Compose eliminates the need for verbose XML markup, reducing boilerplate code and making UI development more efficient.  Improved Readability: Kotlin code in Jetpack Compose is often more readable and maintainable compared to XML layouts, thanks to its concise syntax and expressive nature.  Unified Language: Jetpack Compose allows developers to use a single language (Kotlin) for both application logic and UI development, simplifying the development workflow and reducing context switching.  Better Performance: Jetpack Compose offers better performance compared to XML layouts, as UI elements are created and updated more efficiently using a reactive programming model.
  • 19. When to use ?  Use XML for existing projects or when working with legacy codebases that rely on the traditional Android UI toolkit.  XML may be suitable for simple UI layouts or when working with designers who are more familiar with visual layout editors like Android Studio's Layout Editor. XML  Use Jetpack Compose for new projects or when starting fresh UI development.  Jetpack Compose is well-suited for building modern and dynamic user interfaces with complex interactions and animations.  Consider Jetpack Compose for projects where you want to leverage the benefits of declarative UI programming, improved productivity, and better performance. Jetpack Compose
  • 20. Future Scope: Maturity and Stabilization Tooling and Ecosystem Support Feature Expansion Cross-Platform Compatibility Jetpack Compose is still evolving, and future releases will likely focus on stabilizing the API, improving performance, and addressing feedback from developers. Jetpack Compose will continue to expand its feature set, introducing new components, layouts, and capabilities to empower developers to create modern and feature-rich user interfaces. Integration with other frameworks and technologies, such as Kotlin Multiplatform and Flutter, may further enhance Jetpack Compose's cross- platform capabilities. Google and third-party tools and libraries will continue to improve tooling support for Jetpack Compose, including IDE integrations, code generation tools, and debugging utilities.