SlideShare a Scribd company logo
1 of 43
Download to read offline
Android
Development
Kotlin
Advantages of Kotlin
Kotlin's Basics
Android Development in Kotlin Course
ASJ
Today's
Agenda
What is Kotlin ?
Kotlin is is a cross-platform, statically typed, general-
purpose programming language
OOPS + FP
It was introduced by JetBrains in 2011.
At Google I/O 2017, Google announced first-class
support for Kotlin on Android and announced Kotlin as
an official language for android development
History of Kotlin
2010 Project Started
2016 Kotlin 1.0
2017 Officially Supported Language in
Android
2019 Android Becomes Kotlin first
2020 Kotlin 1.4 Preview
Why Kotlin ?
Kotlin is designed to interoperate fully with Java,
and the JVM version of kotlin's standard library
depends on the Java class library
Google made Kotlin as first preference for developing
apps
30% less code as compared to Java
Time spent on reviews and maintenance is less
60% professional Android developers use Kotlin
Kotlin is an programming language that combines
object-oriented programming and functional features
into a unique platform
main() function - Entry point of the kotlin application
function declaration -- > fun keyword
main() function
Variables in
Kotlin
Kotlin provides 2 types of Variables
var - mutable value
val - immutable value
Keyword
Variable
name
Data Type
Value of the variable
Control Flow
if....else Statements
The if/else statement executes a block of code if a
specified condition is true. If the condition is false,
another block of code can be executed
Control Flow
When Statement
Kotlin when can be used either as an expression or as a statement, simply like
a switch statement in Java. If it is used as an expression, the value of the first
matching branch becomes the value of the overall expression.
Loops
for Loop
a for-loop is a control flow statement for specifying iteration, which allows
code to be executed repeatedly
Loops
While Loop
The while loop loops through a block of code as long as a specified condition
is true.
Loops
do...while Loop
The do..while is similar to the while loop with a difference that the this loop
will execute the code block once, before checking if the condition is true, then
it will repeat the loop as long as the condition is true.
Functions
Kotlin is a statically typed language, hence,
functions play a great role in it.
A function is a block of code which is written
to perform a particular task.
Built - in functions
Kotlin provides a number of built-in functions, we
have used a number of buil-in functions in our
examples. For example print() and println() are the
most commonly used built-in function which we use
to print an output to the screen.
What is
Android Studio ?
Android Studio is the official Integrated Development
Environment (IDE) for android application
development.
It is built on JetBrains' IntelliJ IDEA software and
designed specifically for Android development.
It is available for download on Windows, macOS and
Linux based operating systems
Features of Android
Studio
Gradle-based build support
Template-based wizards to create common Android
designs and components
A rich layout editor that allows users to drag-and-drop UI
components, option to preview layouts on multiple screen
configurations[18]
Built-in support for Google Cloud Platform, enabling
integration with Firebase Cloud Messaging
Android Virtual Device (Emulator) to run and debug apps
in the Android studio.
Steps to Install
Android Studio
Prerequisites :
-> 64-bit Operating System(for Windows and linux)
-> Java installed on your system
-> To check
Go to command prompt and type java -version
Download Android Studio
Menu Bar
Tool Bar
Project Window
Code Editor Window
MAIN WINDOW
OVERVIEW
New – Creates new
Android Application
Open – Opens existing
Android Application
Open Recent – Shows the
list of recently opened
projects and clicking on
one of them would open
the project.
ANDROID FILE MENU
Android Studio
Walk through
In addition to Text Editor,
Activity Layout files could be
edited using XML Design
Editor. The UI elements could
be drag and dropped to the
Layout at center.
ANDROID XML DESIGN
EDITOR
ANDROID TOOL BAR
App components
Activities
Services
Broadcast receivers
Content providers
App components are the essential building blocks of
an Android app. Each component is an entry point
through which the system or a user can enter your
app.
There are four different types of app components:
Activity
An Activity represents a single screen with a user
interface
It deals with the UI and the user interactions to the
screen. In other words, it is a User Interface that
contains activities. These can be one or more
depending upon the App. It starts when the
application is launched.
In an android app at least one activity is always
present which is known as MainActivity.
Main Activity
XML
XML - EXTENSIBLE MARKUP LANGUAGE
XML is a markup language much like HTML used to
describe data. It is derived from Standard
Generalized Markup Language(SMGL).
XML tags define the data and used to store and
organize data. It’s easily scalable and simple to
develop. In Android, the XML is used to implement UI-
related data, and it’s a lightweight markup language
that doesn’t make layout heavy. XML only contains
tags, while implementing they need to be just
invoked.
Basic XML Syntax
Closing Tag
Opening Tag
XML Code in design
In Android Studio you can run your code either in an
physical device or in an android emulator
For running on physical device :
-> Enable Developer options in your android device
-> Enable USB debugging in developer options
-> Connect your phone to your laptop/desktop via a
USB cable
-> Run your code in your device
Run your code
The Android Emulator simulates Android devices on
your computer so that you can test your application
on a variety of devices and Android API levels without
needing to have each physical device.
The emulator provides almost all of the capabilities
of a real Android device. You can simulate incoming
phone calls and text messages, specify the location
of the device, simulate different network speeds,
simulate rotation and other hardware sensors,
access the Google Play Store, and much more.
Android Emulator
Create and manage virtual devices
Select Tools > AVD Manager.
Click AVD Manager in the toolbar.
An Android Virtual Device (AVD) is a
configuration that defines the
characteristics of an Android phone,
tablet, Wear OS, Android TV, or
Automotive OS device that you want to
simulate in the Android Emulator. The
AVD Manager is an interface you can
launch from Android Studio that helps
you create and manage AVDs.
To open the AVD Manager, do one of
the following:
Thank
You!

More Related Content

What's hot

Getting started with appium
Getting started with appiumGetting started with appium
Getting started with appiumPratik Patel
 
Appium basics
Appium basicsAppium basics
Appium basicsSyam Sasi
 
Introduction to Android
Introduction to Android Introduction to Android
Introduction to Android Ranjith Kumar
 
Appium Presentation
Appium Presentation Appium Presentation
Appium Presentation OmarUsman6
 
Android Operating System
Android Operating SystemAndroid Operating System
Android Operating Systemrenoy reji
 
Mobile Application Testing by Javed Ansari
Mobile Application Testing by Javed AnsariMobile Application Testing by Javed Ansari
Mobile Application Testing by Javed AnsariJaved Ansari
 
Mobile application testing
Mobile application testingMobile application testing
Mobile application testingvodQA
 
Unit Testing Android Applications
Unit Testing Android ApplicationsUnit Testing Android Applications
Unit Testing Android ApplicationsRody Middelkoop
 
Android Development: The Basics
Android Development: The BasicsAndroid Development: The Basics
Android Development: The BasicsMike Desjardins
 
Android app development
Android app developmentAndroid app development
Android app developmentTanmoy Roy
 
Kotlin vs Java | Edureka
Kotlin vs Java | EdurekaKotlin vs Java | Edureka
Kotlin vs Java | EdurekaEdureka!
 
Android app development ppt
Android app development pptAndroid app development ppt
Android app development pptsaitej15
 
Mobile Application Testing
Mobile Application TestingMobile Application Testing
Mobile Application TestingSWAAM Tech
 
Android Operating System (Androrid OS)
Android Operating System (Androrid OS)Android Operating System (Androrid OS)
Android Operating System (Androrid OS)Siddharth Belbase
 

What's hot (20)

Getting started with appium
Getting started with appiumGetting started with appium
Getting started with appium
 
Android Presentation
Android PresentationAndroid Presentation
Android Presentation
 
Appium basics
Appium basicsAppium basics
Appium basics
 
Introduction to Android
Introduction to Android Introduction to Android
Introduction to Android
 
Mobile Application Testing
Mobile Application TestingMobile Application Testing
Mobile Application Testing
 
Android ppt
Android pptAndroid ppt
Android ppt
 
Appium Presentation
Appium Presentation Appium Presentation
Appium Presentation
 
Android studio ppt
Android studio pptAndroid studio ppt
Android studio ppt
 
Android Operating System
Android Operating SystemAndroid Operating System
Android Operating System
 
Mobile Application Testing by Javed Ansari
Mobile Application Testing by Javed AnsariMobile Application Testing by Javed Ansari
Mobile Application Testing by Javed Ansari
 
Android Basic Concept
Android Basic Concept Android Basic Concept
Android Basic Concept
 
Mobile application testing
Mobile application testingMobile application testing
Mobile application testing
 
Unit Testing Android Applications
Unit Testing Android ApplicationsUnit Testing Android Applications
Unit Testing Android Applications
 
Android Development: The Basics
Android Development: The BasicsAndroid Development: The Basics
Android Development: The Basics
 
Android app development
Android app developmentAndroid app development
Android app development
 
Kotlin vs Java | Edureka
Kotlin vs Java | EdurekaKotlin vs Java | Edureka
Kotlin vs Java | Edureka
 
Android app development ppt
Android app development pptAndroid app development ppt
Android app development ppt
 
Mobile Application Testing
Mobile Application TestingMobile Application Testing
Mobile Application Testing
 
Android report
Android reportAndroid report
Android report
 
Android Operating System (Androrid OS)
Android Operating System (Androrid OS)Android Operating System (Androrid OS)
Android Operating System (Androrid OS)
 

Similar to Android Session.pdf

Android Study Jams- Hands on Experience!(Day 1)
Android Study Jams- Hands on Experience!(Day 1)Android Study Jams- Hands on Experience!(Day 1)
Android Study Jams- Hands on Experience!(Day 1)GoogleDSC
 
Os eclipse-androidwidget-pdf
Os eclipse-androidwidget-pdfOs eclipse-androidwidget-pdf
Os eclipse-androidwidget-pdfweerabahu
 
Green flag Wrap up Google Solution Challenge.pdf
Green flag Wrap up Google Solution Challenge.pdfGreen flag Wrap up Google Solution Challenge.pdf
Green flag Wrap up Google Solution Challenge.pdfGoogleDeveloperStude22
 
2018 top ide's for andriod development
2018 top ide's for andriod development2018 top ide's for andriod development
2018 top ide's for andriod developmentQamar Abbas
 
Seminar on android app development
Seminar on android app developmentSeminar on android app development
Seminar on android app developmentAbhishekKumar4779
 
Synopsis on android application
Synopsis on android applicationSynopsis on android application
Synopsis on android applicationJawed akhtar
 
Android studio 4.0 new features preview
Android studio 4.0 new features previewAndroid studio 4.0 new features preview
Android studio 4.0 new features previewConcetto Labs
 
Android study jams
Android study jamsAndroid study jams
Android study jamsGDSCIIITR
 
Introduction to Android- A session by Sagar Das
Introduction to Android-  A session by Sagar DasIntroduction to Android-  A session by Sagar Das
Introduction to Android- A session by Sagar Dasdscfetju
 
Android Study Jam - Introduction
Android Study Jam - IntroductionAndroid Study Jam - Introduction
Android Study Jam - IntroductionHitanshDoshi
 
Android application development
Android application developmentAndroid application development
Android application developmentSoni Singh
 
Android | Xamarin | Mobile Application development
Android | Xamarin | Mobile Application developmentAndroid | Xamarin | Mobile Application development
Android | Xamarin | Mobile Application developmentKrishnaMildain
 
Introduction_to_android_and_android_studio
Introduction_to_android_and_android_studioIntroduction_to_android_and_android_studio
Introduction_to_android_and_android_studioAbdul Basit
 
Creating Great Apps with MOTODEV Studio for Android
Creating Great Apps with MOTODEV Studio for AndroidCreating Great Apps with MOTODEV Studio for Android
Creating Great Apps with MOTODEV Studio for AndroidMotorola Mobility - MOTODEV
 
Android presentation
Android presentationAndroid presentation
Android presentationImam Raza
 
MOOC_PRESENTATION_KOTLIN[1].pptx
MOOC_PRESENTATION_KOTLIN[1].pptxMOOC_PRESENTATION_KOTLIN[1].pptx
MOOC_PRESENTATION_KOTLIN[1].pptxkamalkantmaurya1
 

Similar to Android Session.pdf (20)

Android study jam session 1
Android study jam   session 1Android study jam   session 1
Android study jam session 1
 
Android Study Jams- Hands on Experience!(Day 1)
Android Study Jams- Hands on Experience!(Day 1)Android Study Jams- Hands on Experience!(Day 1)
Android Study Jams- Hands on Experience!(Day 1)
 
Os eclipse-androidwidget-pdf
Os eclipse-androidwidget-pdfOs eclipse-androidwidget-pdf
Os eclipse-androidwidget-pdf
 
Green flag Wrap up Google Solution Challenge.pdf
Green flag Wrap up Google Solution Challenge.pdfGreen flag Wrap up Google Solution Challenge.pdf
Green flag Wrap up Google Solution Challenge.pdf
 
Android
AndroidAndroid
Android
 
2018 top ide's for andriod development
2018 top ide's for andriod development2018 top ide's for andriod development
2018 top ide's for andriod development
 
Seminar on android app development
Seminar on android app developmentSeminar on android app development
Seminar on android app development
 
Synopsis on android application
Synopsis on android applicationSynopsis on android application
Synopsis on android application
 
Android studio 4.0 new features preview
Android studio 4.0 new features previewAndroid studio 4.0 new features preview
Android studio 4.0 new features preview
 
Android dev o_auth
Android dev o_authAndroid dev o_auth
Android dev o_auth
 
Android study jams
Android study jamsAndroid study jams
Android study jams
 
Introduction to Android- A session by Sagar Das
Introduction to Android-  A session by Sagar DasIntroduction to Android-  A session by Sagar Das
Introduction to Android- A session by Sagar Das
 
Android Study Jam - Introduction
Android Study Jam - IntroductionAndroid Study Jam - Introduction
Android Study Jam - Introduction
 
Android application development
Android application developmentAndroid application development
Android application development
 
Android | Xamarin | Mobile Application development
Android | Xamarin | Mobile Application developmentAndroid | Xamarin | Mobile Application development
Android | Xamarin | Mobile Application development
 
Introduction_to_android_and_android_studio
Introduction_to_android_and_android_studioIntroduction_to_android_and_android_studio
Introduction_to_android_and_android_studio
 
Creating Great Apps with MOTODEV Studio for Android
Creating Great Apps with MOTODEV Studio for AndroidCreating Great Apps with MOTODEV Studio for Android
Creating Great Apps with MOTODEV Studio for Android
 
Android presentation
Android presentationAndroid presentation
Android presentation
 
MOOC_PRESENTATION_KOTLIN[1].pptx
MOOC_PRESENTATION_KOTLIN[1].pptxMOOC_PRESENTATION_KOTLIN[1].pptx
MOOC_PRESENTATION_KOTLIN[1].pptx
 
moocs_ppt.pptx
moocs_ppt.pptxmoocs_ppt.pptx
moocs_ppt.pptx
 

Recently uploaded

Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...
Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...
Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...Krashi Coaching
 
mini mental status format.docx
mini    mental       status     format.docxmini    mental       status     format.docx
mini mental status format.docxPoojaSen20
 
Enzyme, Pharmaceutical Aids, Miscellaneous Last Part of Chapter no 5th.pdf
Enzyme, Pharmaceutical Aids, Miscellaneous Last Part of Chapter no 5th.pdfEnzyme, Pharmaceutical Aids, Miscellaneous Last Part of Chapter no 5th.pdf
Enzyme, Pharmaceutical Aids, Miscellaneous Last Part of Chapter no 5th.pdfSumit Tiwari
 
Separation of Lanthanides/ Lanthanides and Actinides
Separation of Lanthanides/ Lanthanides and ActinidesSeparation of Lanthanides/ Lanthanides and Actinides
Separation of Lanthanides/ Lanthanides and ActinidesFatimaKhan178732
 
POINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptx
POINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptxPOINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptx
POINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptxSayali Powar
 
call girls in Kamla Market (DELHI) 🔝 >༒9953330565🔝 genuine Escort Service 🔝✔️✔️
call girls in Kamla Market (DELHI) 🔝 >༒9953330565🔝 genuine Escort Service 🔝✔️✔️call girls in Kamla Market (DELHI) 🔝 >༒9953330565🔝 genuine Escort Service 🔝✔️✔️
call girls in Kamla Market (DELHI) 🔝 >༒9953330565🔝 genuine Escort Service 🔝✔️✔️9953056974 Low Rate Call Girls In Saket, Delhi NCR
 
A Critique of the Proposed National Education Policy Reform
A Critique of the Proposed National Education Policy ReformA Critique of the Proposed National Education Policy Reform
A Critique of the Proposed National Education Policy ReformChameera Dedduwage
 
SOCIAL AND HISTORICAL CONTEXT - LFTVD.pptx
SOCIAL AND HISTORICAL CONTEXT - LFTVD.pptxSOCIAL AND HISTORICAL CONTEXT - LFTVD.pptx
SOCIAL AND HISTORICAL CONTEXT - LFTVD.pptxiammrhaywood
 
Crayon Activity Handout For the Crayon A
Crayon Activity Handout For the Crayon ACrayon Activity Handout For the Crayon A
Crayon Activity Handout For the Crayon AUnboundStockton
 
Sanyam Choudhary Chemistry practical.pdf
Sanyam Choudhary Chemistry practical.pdfSanyam Choudhary Chemistry practical.pdf
Sanyam Choudhary Chemistry practical.pdfsanyamsingh5019
 
Interactive Powerpoint_How to Master effective communication
Interactive Powerpoint_How to Master effective communicationInteractive Powerpoint_How to Master effective communication
Interactive Powerpoint_How to Master effective communicationnomboosow
 
Introduction to ArtificiaI Intelligence in Higher Education
Introduction to ArtificiaI Intelligence in Higher EducationIntroduction to ArtificiaI Intelligence in Higher Education
Introduction to ArtificiaI Intelligence in Higher Educationpboyjonauth
 
microwave assisted reaction. General introduction
microwave assisted reaction. General introductionmicrowave assisted reaction. General introduction
microwave assisted reaction. General introductionMaksud Ahmed
 
Software Engineering Methodologies (overview)
Software Engineering Methodologies (overview)Software Engineering Methodologies (overview)
Software Engineering Methodologies (overview)eniolaolutunde
 
Contemporary philippine arts from the regions_PPT_Module_12 [Autosaved] (1).pptx
Contemporary philippine arts from the regions_PPT_Module_12 [Autosaved] (1).pptxContemporary philippine arts from the regions_PPT_Module_12 [Autosaved] (1).pptx
Contemporary philippine arts from the regions_PPT_Module_12 [Autosaved] (1).pptxRoyAbrique
 
MENTAL STATUS EXAMINATION format.docx
MENTAL     STATUS EXAMINATION format.docxMENTAL     STATUS EXAMINATION format.docx
MENTAL STATUS EXAMINATION format.docxPoojaSen20
 
Alper Gobel In Media Res Media Component
Alper Gobel In Media Res Media ComponentAlper Gobel In Media Res Media Component
Alper Gobel In Media Res Media ComponentInMediaRes1
 
BASLIQ CURRENT LOOKBOOK LOOKBOOK(1) (1).pdf
BASLIQ CURRENT LOOKBOOK  LOOKBOOK(1) (1).pdfBASLIQ CURRENT LOOKBOOK  LOOKBOOK(1) (1).pdf
BASLIQ CURRENT LOOKBOOK LOOKBOOK(1) (1).pdfSoniaTolstoy
 

Recently uploaded (20)

Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...
Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...
Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...
 
mini mental status format.docx
mini    mental       status     format.docxmini    mental       status     format.docx
mini mental status format.docx
 
Enzyme, Pharmaceutical Aids, Miscellaneous Last Part of Chapter no 5th.pdf
Enzyme, Pharmaceutical Aids, Miscellaneous Last Part of Chapter no 5th.pdfEnzyme, Pharmaceutical Aids, Miscellaneous Last Part of Chapter no 5th.pdf
Enzyme, Pharmaceutical Aids, Miscellaneous Last Part of Chapter no 5th.pdf
 
Separation of Lanthanides/ Lanthanides and Actinides
Separation of Lanthanides/ Lanthanides and ActinidesSeparation of Lanthanides/ Lanthanides and Actinides
Separation of Lanthanides/ Lanthanides and Actinides
 
POINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptx
POINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptxPOINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptx
POINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptx
 
call girls in Kamla Market (DELHI) 🔝 >༒9953330565🔝 genuine Escort Service 🔝✔️✔️
call girls in Kamla Market (DELHI) 🔝 >༒9953330565🔝 genuine Escort Service 🔝✔️✔️call girls in Kamla Market (DELHI) 🔝 >༒9953330565🔝 genuine Escort Service 🔝✔️✔️
call girls in Kamla Market (DELHI) 🔝 >༒9953330565🔝 genuine Escort Service 🔝✔️✔️
 
A Critique of the Proposed National Education Policy Reform
A Critique of the Proposed National Education Policy ReformA Critique of the Proposed National Education Policy Reform
A Critique of the Proposed National Education Policy Reform
 
SOCIAL AND HISTORICAL CONTEXT - LFTVD.pptx
SOCIAL AND HISTORICAL CONTEXT - LFTVD.pptxSOCIAL AND HISTORICAL CONTEXT - LFTVD.pptx
SOCIAL AND HISTORICAL CONTEXT - LFTVD.pptx
 
Crayon Activity Handout For the Crayon A
Crayon Activity Handout For the Crayon ACrayon Activity Handout For the Crayon A
Crayon Activity Handout For the Crayon A
 
TataKelola dan KamSiber Kecerdasan Buatan v022.pdf
TataKelola dan KamSiber Kecerdasan Buatan v022.pdfTataKelola dan KamSiber Kecerdasan Buatan v022.pdf
TataKelola dan KamSiber Kecerdasan Buatan v022.pdf
 
Sanyam Choudhary Chemistry practical.pdf
Sanyam Choudhary Chemistry practical.pdfSanyam Choudhary Chemistry practical.pdf
Sanyam Choudhary Chemistry practical.pdf
 
Interactive Powerpoint_How to Master effective communication
Interactive Powerpoint_How to Master effective communicationInteractive Powerpoint_How to Master effective communication
Interactive Powerpoint_How to Master effective communication
 
Introduction to ArtificiaI Intelligence in Higher Education
Introduction to ArtificiaI Intelligence in Higher EducationIntroduction to ArtificiaI Intelligence in Higher Education
Introduction to ArtificiaI Intelligence in Higher Education
 
Código Creativo y Arte de Software | Unidad 1
Código Creativo y Arte de Software | Unidad 1Código Creativo y Arte de Software | Unidad 1
Código Creativo y Arte de Software | Unidad 1
 
microwave assisted reaction. General introduction
microwave assisted reaction. General introductionmicrowave assisted reaction. General introduction
microwave assisted reaction. General introduction
 
Software Engineering Methodologies (overview)
Software Engineering Methodologies (overview)Software Engineering Methodologies (overview)
Software Engineering Methodologies (overview)
 
Contemporary philippine arts from the regions_PPT_Module_12 [Autosaved] (1).pptx
Contemporary philippine arts from the regions_PPT_Module_12 [Autosaved] (1).pptxContemporary philippine arts from the regions_PPT_Module_12 [Autosaved] (1).pptx
Contemporary philippine arts from the regions_PPT_Module_12 [Autosaved] (1).pptx
 
MENTAL STATUS EXAMINATION format.docx
MENTAL     STATUS EXAMINATION format.docxMENTAL     STATUS EXAMINATION format.docx
MENTAL STATUS EXAMINATION format.docx
 
Alper Gobel In Media Res Media Component
Alper Gobel In Media Res Media ComponentAlper Gobel In Media Res Media Component
Alper Gobel In Media Res Media Component
 
BASLIQ CURRENT LOOKBOOK LOOKBOOK(1) (1).pdf
BASLIQ CURRENT LOOKBOOK  LOOKBOOK(1) (1).pdfBASLIQ CURRENT LOOKBOOK  LOOKBOOK(1) (1).pdf
BASLIQ CURRENT LOOKBOOK LOOKBOOK(1) (1).pdf
 

Android Session.pdf

  • 2. Kotlin Advantages of Kotlin Kotlin's Basics Android Development in Kotlin Course ASJ Today's Agenda
  • 3. What is Kotlin ? Kotlin is is a cross-platform, statically typed, general- purpose programming language OOPS + FP It was introduced by JetBrains in 2011. At Google I/O 2017, Google announced first-class support for Kotlin on Android and announced Kotlin as an official language for android development
  • 4. History of Kotlin 2010 Project Started 2016 Kotlin 1.0 2017 Officially Supported Language in Android 2019 Android Becomes Kotlin first 2020 Kotlin 1.4 Preview
  • 5. Why Kotlin ? Kotlin is designed to interoperate fully with Java, and the JVM version of kotlin's standard library depends on the Java class library Google made Kotlin as first preference for developing apps 30% less code as compared to Java Time spent on reviews and maintenance is less 60% professional Android developers use Kotlin
  • 6.
  • 7. Kotlin is an programming language that combines object-oriented programming and functional features into a unique platform main() function - Entry point of the kotlin application function declaration -- > fun keyword main() function
  • 8. Variables in Kotlin Kotlin provides 2 types of Variables var - mutable value val - immutable value Keyword Variable name Data Type Value of the variable
  • 9. Control Flow if....else Statements The if/else statement executes a block of code if a specified condition is true. If the condition is false, another block of code can be executed
  • 10. Control Flow When Statement Kotlin when can be used either as an expression or as a statement, simply like a switch statement in Java. If it is used as an expression, the value of the first matching branch becomes the value of the overall expression.
  • 11. Loops for Loop a for-loop is a control flow statement for specifying iteration, which allows code to be executed repeatedly
  • 12. Loops While Loop The while loop loops through a block of code as long as a specified condition is true.
  • 13. Loops do...while Loop The do..while is similar to the while loop with a difference that the this loop will execute the code block once, before checking if the condition is true, then it will repeat the loop as long as the condition is true.
  • 14. Functions Kotlin is a statically typed language, hence, functions play a great role in it. A function is a block of code which is written to perform a particular task. Built - in functions Kotlin provides a number of built-in functions, we have used a number of buil-in functions in our examples. For example print() and println() are the most commonly used built-in function which we use to print an output to the screen.
  • 15. What is Android Studio ? Android Studio is the official Integrated Development Environment (IDE) for android application development. It is built on JetBrains' IntelliJ IDEA software and designed specifically for Android development. It is available for download on Windows, macOS and Linux based operating systems
  • 16. Features of Android Studio Gradle-based build support Template-based wizards to create common Android designs and components A rich layout editor that allows users to drag-and-drop UI components, option to preview layouts on multiple screen configurations[18] Built-in support for Google Cloud Platform, enabling integration with Firebase Cloud Messaging Android Virtual Device (Emulator) to run and debug apps in the Android studio.
  • 17. Steps to Install Android Studio Prerequisites : -> 64-bit Operating System(for Windows and linux) -> Java installed on your system -> To check Go to command prompt and type java -version
  • 19.
  • 20.
  • 21.
  • 22.
  • 23.
  • 24.
  • 25.
  • 26.
  • 27.
  • 28. Menu Bar Tool Bar Project Window Code Editor Window MAIN WINDOW OVERVIEW New – Creates new Android Application Open – Opens existing Android Application Open Recent – Shows the list of recently opened projects and clicking on one of them would open the project. ANDROID FILE MENU Android Studio Walk through In addition to Text Editor, Activity Layout files could be edited using XML Design Editor. The UI elements could be drag and dropped to the Layout at center. ANDROID XML DESIGN EDITOR ANDROID TOOL BAR
  • 29.
  • 30.
  • 31.
  • 32.
  • 33.
  • 34. App components Activities Services Broadcast receivers Content providers App components are the essential building blocks of an Android app. Each component is an entry point through which the system or a user can enter your app. There are four different types of app components:
  • 35. Activity An Activity represents a single screen with a user interface It deals with the UI and the user interactions to the screen. In other words, it is a User Interface that contains activities. These can be one or more depending upon the App. It starts when the application is launched. In an android app at least one activity is always present which is known as MainActivity.
  • 37. XML XML - EXTENSIBLE MARKUP LANGUAGE XML is a markup language much like HTML used to describe data. It is derived from Standard Generalized Markup Language(SMGL). XML tags define the data and used to store and organize data. It’s easily scalable and simple to develop. In Android, the XML is used to implement UI- related data, and it’s a lightweight markup language that doesn’t make layout heavy. XML only contains tags, while implementing they need to be just invoked.
  • 38. Basic XML Syntax Closing Tag Opening Tag
  • 39. XML Code in design
  • 40. In Android Studio you can run your code either in an physical device or in an android emulator For running on physical device : -> Enable Developer options in your android device -> Enable USB debugging in developer options -> Connect your phone to your laptop/desktop via a USB cable -> Run your code in your device Run your code
  • 41. The Android Emulator simulates Android devices on your computer so that you can test your application on a variety of devices and Android API levels without needing to have each physical device. The emulator provides almost all of the capabilities of a real Android device. You can simulate incoming phone calls and text messages, specify the location of the device, simulate different network speeds, simulate rotation and other hardware sensors, access the Google Play Store, and much more. Android Emulator
  • 42. Create and manage virtual devices Select Tools > AVD Manager. Click AVD Manager in the toolbar. An Android Virtual Device (AVD) is a configuration that defines the characteristics of an Android phone, tablet, Wear OS, Android TV, or Automotive OS device that you want to simulate in the Android Emulator. The AVD Manager is an interface you can launch from Android Studio that helps you create and manage AVDs. To open the AVD Manager, do one of the following: