SlideShare a Scribd company logo
Android: Designing starter
Contents
• What is Android and what is Android Studio?(Quick review)
• Setting up Android studio
• Activity and its life cycle.
• Android project Structure
• Layout and Types of Layout
• Guide to res Folder
Know this…
• There are no stupid questions!
What is Android?
• Open-source Linux-based operating
system
• Developed by Open Handset
Alliance(Business alliance of around 80
companies) lead by Google.
• Source code is called Android Open-Source
Project(AOSP)
• Launched in 2007 for the first time
(Android 1.0)
• Programming languages: Java, Kotlin,
XML,C++
• Current Android version is Android 11
• Development tool: Android Studio
What is Android studio?
• Official IDE for development of
Android applications
• Comes with gradle
• GitHub integration
• C++ and NDK(Native Development
Kit) support
• Built-in support for Google Cloud
Platform.
Setting Up Android Studio
• Download Android Studio From the link: https://developer.android.com/studio
Click this button
Setting up Android Studio
• Click on the check box and click download button
Setting up Android Studio
Setting up Android Studio
Setting up Android Studio
Activity
• An activity represents a single screen with a user interface just like window.
Below are the 3 different activities.
B-but they are all WhatsApp!
Activity
• An activity is a single, focused thing
that the user can do.
• Almost all activities interact with the
user, so the Activity class takes care
of creating a window for you in
which you can place your UI with
setContentView(View)
Life cycle
of Activity
• onCreate()
• onStart()
• onResume()
• onPause()
• onStop()
• onDestroy()
onCreate()
• Called when the activity is first created.
• Initialize your objects here.
• Always followed by onStart().
• Called only once in a life of an Activity.
onStart()
• Called when the activity is becoming visible to the user.
• User cannot interact with it yet
• Very short gap between onResume() and onStart().
• Followed by onResume().
onResume()
• This is the state in which the app interacts with the user.
• The app stays in this state until something happens to take focus away from the
app.
• Initiates the running state of an App.
onPause()
• It is called when your activity is not focused
• The system calls this method as the first indication that the user is leaving your
activity
• In Android 7.0 (API level 24) or higher, multiple apps run in multi-window mode.
Because only one of the apps (windows) has focus at any time, the system
pauses all of the other apps.
• A new, semi-transparent activity (such as a dialog) opens. As long as the activity
is still partially visible but not in focus, it remains paused.
onStop()
• When your activity is no longer visible to the user, it has entered the Stopped
state.
• This may occur, for example, when a newly launched activity covers the entire
screen
• The system may also call onStop() when the activity has finished running, and is
about to be terminated.
• Your app might pause animations or switch from fine-grained to coarse-grained
location updates.
onDestroy()
• Called before the activity is destroyed. The system invokes this callback either
because:
• The activity is finishing (due to the user completely dismissing the activity or due
to finish() being called on the activity), or
• The system is temporarily destroying the activity due to a configuration change
(such as device rotation or multi-window mode)
Moving on!
Project Structure of Android
Three main folders:
1. java
2. manifest
3. res
4. Gradle scripts
java folder
• This folder contains all the logical
source code that performs functions
• Android studio also adds packages
for unit testing
• You can add activities, simple java
classes or packages as you need.
manifest folder
• It contains only one file i.e
AndroidManifest.xml
• The AndroidManifest.xml file contains
information of your package, including
components of the application such as
activities, services, broadcast receivers,
content providers etc.
• Why is this needed? To tell the device
information about the app.
res folder
• This folder contains external
resources that the app is going to
use
• Images, layouts, icons, colors etc.
• These are xml files.
Gradle Scripts
• Gradle is a build system (open
source) which is used to automate
building, testing, deployment etc.
• Simply put, a gradle takes all the
source files (java and XML) and
apply appropriate tools, e.g.,
converts the java files into dex files
and compresses all of them into a
single file known as apk that is
actually used.
Guide to res folder
Layout, What is it?
• A view objects are usually called
"widgets" and can be one of many
subclasses.
• A ViewGroup objects are usually
called "layouts" can be one of many
types that provide a different layout
structure.
• A layout defines the structure for a
user interface in your app, such as in
an activity. All elements in the layout
are built using a hierarchy of view
and viewgroup objects.
Layout
attributes
• Every View or ViewGroup have
XML attributes that define the
properties of the component
• Some attributes are common
(such as id attribute) while
other are not (such as textSize
is only for text related views)
Types of Layout
• Linear Layout
• Constraint Layout
• Relative Layout
• Frame Layout
• Table Layout
Linear Layout
• Android LinearLayout is a view group that aligns all children in either vertically or
horizontally.
Relative Layout
• Android RelativeLayout enables you
to specify how child views are
positioned relative to each other.
The position of each view can be
specified as relative to sibling
elements or relative to the parent.
Constraint Layout
• Constraint Layout is a ViewGroup
(i.e. a view that holds other views)
which allows you to create large and
complex layouts with a flat view
hierarchy, and also allows you to
position and size widgets in a very
flexible way.
Frame Layout
• Frame Layout is designed to block
out an area on the screen to display
a single item. Generally,
FrameLayout should be used to hold
a single child view, because it can be
difficult to organize child views in a
way that's scalable to different
screen sizes without the children
overlapping each other.
Table Layout
• Android TableLayout going to be
arranged groups of views into rows
and columns. You will use the
<TableRow> element to build a row
in the table. Each row has zero or
more cells; each cell can hold one
View object.
Views
• View is the basic building block of UI(User Interface) in android.
• TextView, EditText, Buttons.
That’s a lot of theory, right?
LET’S MAKE A SIMPLE APP UI!!!
Android bootcamp-day1

More Related Content

Similar to Android bootcamp-day1

Workshop Android for Java Developers
Workshop Android for Java DevelopersWorkshop Android for Java Developers
Workshop Android for Java Developers
mhant
 
Android app devolopment
Android app devolopmentAndroid app devolopment
Android app devolopment
SitCom Solutions
 
Matteo Gazzurelli - Introduction to Android Development - Have a break edition
Matteo Gazzurelli - Introduction to Android Development - Have a break editionMatteo Gazzurelli - Introduction to Android Development - Have a break edition
Matteo Gazzurelli - Introduction to Android Development - Have a break edition
DuckMa
 
Android Jumpstart Jfokus
Android Jumpstart JfokusAndroid Jumpstart Jfokus
Android Jumpstart Jfokus
Lars Vogel
 
Android
AndroidAndroid
Android development first steps
Android development   first stepsAndroid development   first steps
Android development first steps
christoforosnalmpantis
 
Innovation Generation - The Mobile Meetup: Android Best Practices
Innovation Generation - The Mobile Meetup: Android Best PracticesInnovation Generation - The Mobile Meetup: Android Best Practices
Innovation Generation - The Mobile Meetup: Android Best Practices
Solstice Mobile Argentina
 
Introduction to Android and Android Studio
Introduction to Android and Android StudioIntroduction to Android and Android Studio
Introduction to Android and Android Studio
Suyash Srijan
 
From Containerization to Modularity
From Containerization to ModularityFrom Containerization to Modularity
From Containerization to Modularity
oasisfeng
 
11.11.2020 - Unit 5-3 ACTIVITY, MENU AND SQLITE DATABASE.pptx
11.11.2020 - Unit 5-3  ACTIVITY, MENU AND SQLITE DATABASE.pptx11.11.2020 - Unit 5-3  ACTIVITY, MENU AND SQLITE DATABASE.pptx
11.11.2020 - Unit 5-3 ACTIVITY, MENU AND SQLITE DATABASE.pptx
MugiiiReee
 
Introduction to android sessions new
Introduction to android   sessions newIntroduction to android   sessions new
Introduction to android sessions new
Joe Jacob
 
Android webinar class_1
Android webinar class_1Android webinar class_1
Android webinar class_1
Edureka!
 
Matteo Gazzurelli - Andorid introduction - Google Dev Fest 2013
Matteo Gazzurelli - Andorid introduction - Google Dev Fest 2013Matteo Gazzurelli - Andorid introduction - Google Dev Fest 2013
Matteo Gazzurelli - Andorid introduction - Google Dev Fest 2013
DuckMa
 
Lec005 android start_program
Lec005 android start_programLec005 android start_program
Lec005 android start_program
Eyad Almasri
 
Android architecture
Android architectureAndroid architecture
Android architecture
Deepa Rahul
 
Android Workshop Part 1
Android Workshop Part 1Android Workshop Part 1
Android Workshop Part 1
NAILBITER
 
Android app development
Android app developmentAndroid app development
Android app development
Abhishek Saini
 
Android app development by abhi android
Android app development by abhi androidAndroid app development by abhi android
Android app development by abhi android
susijanny
 
Introduction to Android Development.pptx
Introduction to Android Development.pptxIntroduction to Android Development.pptx
Introduction to Android Development.pptx
asmeerana605
 
Project a day 2 android application fundamentals
Project a day 2   android application fundamentalsProject a day 2   android application fundamentals
Project a day 2 android application fundamentals
Goran Djonovic
 

Similar to Android bootcamp-day1 (20)

Workshop Android for Java Developers
Workshop Android for Java DevelopersWorkshop Android for Java Developers
Workshop Android for Java Developers
 
Android app devolopment
Android app devolopmentAndroid app devolopment
Android app devolopment
 
Matteo Gazzurelli - Introduction to Android Development - Have a break edition
Matteo Gazzurelli - Introduction to Android Development - Have a break editionMatteo Gazzurelli - Introduction to Android Development - Have a break edition
Matteo Gazzurelli - Introduction to Android Development - Have a break edition
 
Android Jumpstart Jfokus
Android Jumpstart JfokusAndroid Jumpstart Jfokus
Android Jumpstart Jfokus
 
Android
AndroidAndroid
Android
 
Android development first steps
Android development   first stepsAndroid development   first steps
Android development first steps
 
Innovation Generation - The Mobile Meetup: Android Best Practices
Innovation Generation - The Mobile Meetup: Android Best PracticesInnovation Generation - The Mobile Meetup: Android Best Practices
Innovation Generation - The Mobile Meetup: Android Best Practices
 
Introduction to Android and Android Studio
Introduction to Android and Android StudioIntroduction to Android and Android Studio
Introduction to Android and Android Studio
 
From Containerization to Modularity
From Containerization to ModularityFrom Containerization to Modularity
From Containerization to Modularity
 
11.11.2020 - Unit 5-3 ACTIVITY, MENU AND SQLITE DATABASE.pptx
11.11.2020 - Unit 5-3  ACTIVITY, MENU AND SQLITE DATABASE.pptx11.11.2020 - Unit 5-3  ACTIVITY, MENU AND SQLITE DATABASE.pptx
11.11.2020 - Unit 5-3 ACTIVITY, MENU AND SQLITE DATABASE.pptx
 
Introduction to android sessions new
Introduction to android   sessions newIntroduction to android   sessions new
Introduction to android sessions new
 
Android webinar class_1
Android webinar class_1Android webinar class_1
Android webinar class_1
 
Matteo Gazzurelli - Andorid introduction - Google Dev Fest 2013
Matteo Gazzurelli - Andorid introduction - Google Dev Fest 2013Matteo Gazzurelli - Andorid introduction - Google Dev Fest 2013
Matteo Gazzurelli - Andorid introduction - Google Dev Fest 2013
 
Lec005 android start_program
Lec005 android start_programLec005 android start_program
Lec005 android start_program
 
Android architecture
Android architectureAndroid architecture
Android architecture
 
Android Workshop Part 1
Android Workshop Part 1Android Workshop Part 1
Android Workshop Part 1
 
Android app development
Android app developmentAndroid app development
Android app development
 
Android app development by abhi android
Android app development by abhi androidAndroid app development by abhi android
Android app development by abhi android
 
Introduction to Android Development.pptx
Introduction to Android Development.pptxIntroduction to Android Development.pptx
Introduction to Android Development.pptx
 
Project a day 2 android application fundamentals
Project a day 2   android application fundamentalsProject a day 2   android application fundamentals
Project a day 2 android application fundamentals
 

More from FatimaYousif11

Day 2 react bootcamp
Day 2 react bootcampDay 2 react bootcamp
Day 2 react bootcamp
FatimaYousif11
 
The concept of vector art
The concept of vector artThe concept of vector art
The concept of vector art
FatimaYousif11
 
CV/resume writing
CV/resume writingCV/resume writing
CV/resume writing
FatimaYousif11
 
Day 8 sketchware
Day 8  sketchwareDay 8  sketchware
Day 8 sketchware
FatimaYousif11
 
Firebase
Firebase Firebase
Firebase
FatimaYousif11
 
Android local databases
Android local databasesAndroid local databases
Android local databases
FatimaYousif11
 
Day 5 android app code advancement
Day 5  android app code advancementDay 5  android app code advancement
Day 5 android app code advancement
FatimaYousif11
 
Day 4 android bootcamp
Day 4  android bootcampDay 4  android bootcamp
Day 4 android bootcamp
FatimaYousif11
 
Android app code mediator
Android app code mediatorAndroid app code mediator
Android app code mediator
FatimaYousif11
 
Android App code starter
Android App code starterAndroid App code starter
Android App code starter
FatimaYousif11
 
Getting started with android development
Getting started with android developmentGetting started with android development
Getting started with android development
FatimaYousif11
 
Oop
OopOop
Hello to Kotlin
Hello to KotlinHello to Kotlin
Hello to Kotlin
FatimaYousif11
 
Hacktoberfest slides
Hacktoberfest slidesHacktoberfest slides
Hacktoberfest slides
FatimaYousif11
 
Info session about dsc
Info session  about dscInfo session  about dsc
Info session about dsc
FatimaYousif11
 

More from FatimaYousif11 (15)

Day 2 react bootcamp
Day 2 react bootcampDay 2 react bootcamp
Day 2 react bootcamp
 
The concept of vector art
The concept of vector artThe concept of vector art
The concept of vector art
 
CV/resume writing
CV/resume writingCV/resume writing
CV/resume writing
 
Day 8 sketchware
Day 8  sketchwareDay 8  sketchware
Day 8 sketchware
 
Firebase
Firebase Firebase
Firebase
 
Android local databases
Android local databasesAndroid local databases
Android local databases
 
Day 5 android app code advancement
Day 5  android app code advancementDay 5  android app code advancement
Day 5 android app code advancement
 
Day 4 android bootcamp
Day 4  android bootcampDay 4  android bootcamp
Day 4 android bootcamp
 
Android app code mediator
Android app code mediatorAndroid app code mediator
Android app code mediator
 
Android App code starter
Android App code starterAndroid App code starter
Android App code starter
 
Getting started with android development
Getting started with android developmentGetting started with android development
Getting started with android development
 
Oop
OopOop
Oop
 
Hello to Kotlin
Hello to KotlinHello to Kotlin
Hello to Kotlin
 
Hacktoberfest slides
Hacktoberfest slidesHacktoberfest slides
Hacktoberfest slides
 
Info session about dsc
Info session  about dscInfo session  about dsc
Info session about dsc
 

Recently uploaded

20240605 QFM017 Machine Intelligence Reading List May 2024
20240605 QFM017 Machine Intelligence Reading List May 202420240605 QFM017 Machine Intelligence Reading List May 2024
20240605 QFM017 Machine Intelligence Reading List May 2024
Matthew Sinclair
 
Securing your Kubernetes cluster_ a step-by-step guide to success !
Securing your Kubernetes cluster_ a step-by-step guide to success !Securing your Kubernetes cluster_ a step-by-step guide to success !
Securing your Kubernetes cluster_ a step-by-step guide to success !
KatiaHIMEUR1
 
Full-RAG: A modern architecture for hyper-personalization
Full-RAG: A modern architecture for hyper-personalizationFull-RAG: A modern architecture for hyper-personalization
Full-RAG: A modern architecture for hyper-personalization
Zilliz
 
PCI PIN Basics Webinar from the Controlcase Team
PCI PIN Basics Webinar from the Controlcase TeamPCI PIN Basics Webinar from the Controlcase Team
PCI PIN Basics Webinar from the Controlcase Team
ControlCase
 
Cosa hanno in comune un mattoncino Lego e la backdoor XZ?
Cosa hanno in comune un mattoncino Lego e la backdoor XZ?Cosa hanno in comune un mattoncino Lego e la backdoor XZ?
Cosa hanno in comune un mattoncino Lego e la backdoor XZ?
Speck&Tech
 
Microsoft - Power Platform_G.Aspiotis.pdf
Microsoft - Power Platform_G.Aspiotis.pdfMicrosoft - Power Platform_G.Aspiotis.pdf
Microsoft - Power Platform_G.Aspiotis.pdf
Uni Systems S.M.S.A.
 
RESUME BUILDER APPLICATION Project for students
RESUME BUILDER APPLICATION Project for studentsRESUME BUILDER APPLICATION Project for students
RESUME BUILDER APPLICATION Project for students
KAMESHS29
 
Pushing the limits of ePRTC: 100ns holdover for 100 days
Pushing the limits of ePRTC: 100ns holdover for 100 daysPushing the limits of ePRTC: 100ns holdover for 100 days
Pushing the limits of ePRTC: 100ns holdover for 100 days
Adtran
 
20240609 QFM020 Irresponsible AI Reading List May 2024
20240609 QFM020 Irresponsible AI Reading List May 202420240609 QFM020 Irresponsible AI Reading List May 2024
20240609 QFM020 Irresponsible AI Reading List May 2024
Matthew Sinclair
 
A tale of scale & speed: How the US Navy is enabling software delivery from l...
A tale of scale & speed: How the US Navy is enabling software delivery from l...A tale of scale & speed: How the US Navy is enabling software delivery from l...
A tale of scale & speed: How the US Navy is enabling software delivery from l...
sonjaschweigert1
 
TrustArc Webinar - 2024 Global Privacy Survey
TrustArc Webinar - 2024 Global Privacy SurveyTrustArc Webinar - 2024 Global Privacy Survey
TrustArc Webinar - 2024 Global Privacy Survey
TrustArc
 
Removing Uninteresting Bytes in Software Fuzzing
Removing Uninteresting Bytes in Software FuzzingRemoving Uninteresting Bytes in Software Fuzzing
Removing Uninteresting Bytes in Software Fuzzing
Aftab Hussain
 
GraphSummit Singapore | Enhancing Changi Airport Group's Passenger Experience...
GraphSummit Singapore | Enhancing Changi Airport Group's Passenger Experience...GraphSummit Singapore | Enhancing Changi Airport Group's Passenger Experience...
GraphSummit Singapore | Enhancing Changi Airport Group's Passenger Experience...
Neo4j
 
20240607 QFM018 Elixir Reading List May 2024
20240607 QFM018 Elixir Reading List May 202420240607 QFM018 Elixir Reading List May 2024
20240607 QFM018 Elixir Reading List May 2024
Matthew Sinclair
 
How to use Firebase Data Connect For Flutter
How to use Firebase Data Connect For FlutterHow to use Firebase Data Connect For Flutter
How to use Firebase Data Connect For Flutter
Daiki Mogmet Ito
 
“I’m still / I’m still / Chaining from the Block”
“I’m still / I’m still / Chaining from the Block”“I’m still / I’m still / Chaining from the Block”
“I’m still / I’m still / Chaining from the Block”
Claudio Di Ciccio
 
Let's Integrate MuleSoft RPA, COMPOSER, APM with AWS IDP along with Slack
Let's Integrate MuleSoft RPA, COMPOSER, APM with AWS IDP along with SlackLet's Integrate MuleSoft RPA, COMPOSER, APM with AWS IDP along with Slack
Let's Integrate MuleSoft RPA, COMPOSER, APM with AWS IDP along with Slack
shyamraj55
 
Video Streaming: Then, Now, and in the Future
Video Streaming: Then, Now, and in the FutureVideo Streaming: Then, Now, and in the Future
Video Streaming: Then, Now, and in the Future
Alpen-Adria-Universität
 
Goodbye Windows 11: Make Way for Nitrux Linux 3.5.0!
Goodbye Windows 11: Make Way for Nitrux Linux 3.5.0!Goodbye Windows 11: Make Way for Nitrux Linux 3.5.0!
Goodbye Windows 11: Make Way for Nitrux Linux 3.5.0!
SOFTTECHHUB
 
How to Get CNIC Information System with Paksim Ga.pptx
How to Get CNIC Information System with Paksim Ga.pptxHow to Get CNIC Information System with Paksim Ga.pptx
How to Get CNIC Information System with Paksim Ga.pptx
danishmna97
 

Recently uploaded (20)

20240605 QFM017 Machine Intelligence Reading List May 2024
20240605 QFM017 Machine Intelligence Reading List May 202420240605 QFM017 Machine Intelligence Reading List May 2024
20240605 QFM017 Machine Intelligence Reading List May 2024
 
Securing your Kubernetes cluster_ a step-by-step guide to success !
Securing your Kubernetes cluster_ a step-by-step guide to success !Securing your Kubernetes cluster_ a step-by-step guide to success !
Securing your Kubernetes cluster_ a step-by-step guide to success !
 
Full-RAG: A modern architecture for hyper-personalization
Full-RAG: A modern architecture for hyper-personalizationFull-RAG: A modern architecture for hyper-personalization
Full-RAG: A modern architecture for hyper-personalization
 
PCI PIN Basics Webinar from the Controlcase Team
PCI PIN Basics Webinar from the Controlcase TeamPCI PIN Basics Webinar from the Controlcase Team
PCI PIN Basics Webinar from the Controlcase Team
 
Cosa hanno in comune un mattoncino Lego e la backdoor XZ?
Cosa hanno in comune un mattoncino Lego e la backdoor XZ?Cosa hanno in comune un mattoncino Lego e la backdoor XZ?
Cosa hanno in comune un mattoncino Lego e la backdoor XZ?
 
Microsoft - Power Platform_G.Aspiotis.pdf
Microsoft - Power Platform_G.Aspiotis.pdfMicrosoft - Power Platform_G.Aspiotis.pdf
Microsoft - Power Platform_G.Aspiotis.pdf
 
RESUME BUILDER APPLICATION Project for students
RESUME BUILDER APPLICATION Project for studentsRESUME BUILDER APPLICATION Project for students
RESUME BUILDER APPLICATION Project for students
 
Pushing the limits of ePRTC: 100ns holdover for 100 days
Pushing the limits of ePRTC: 100ns holdover for 100 daysPushing the limits of ePRTC: 100ns holdover for 100 days
Pushing the limits of ePRTC: 100ns holdover for 100 days
 
20240609 QFM020 Irresponsible AI Reading List May 2024
20240609 QFM020 Irresponsible AI Reading List May 202420240609 QFM020 Irresponsible AI Reading List May 2024
20240609 QFM020 Irresponsible AI Reading List May 2024
 
A tale of scale & speed: How the US Navy is enabling software delivery from l...
A tale of scale & speed: How the US Navy is enabling software delivery from l...A tale of scale & speed: How the US Navy is enabling software delivery from l...
A tale of scale & speed: How the US Navy is enabling software delivery from l...
 
TrustArc Webinar - 2024 Global Privacy Survey
TrustArc Webinar - 2024 Global Privacy SurveyTrustArc Webinar - 2024 Global Privacy Survey
TrustArc Webinar - 2024 Global Privacy Survey
 
Removing Uninteresting Bytes in Software Fuzzing
Removing Uninteresting Bytes in Software FuzzingRemoving Uninteresting Bytes in Software Fuzzing
Removing Uninteresting Bytes in Software Fuzzing
 
GraphSummit Singapore | Enhancing Changi Airport Group's Passenger Experience...
GraphSummit Singapore | Enhancing Changi Airport Group's Passenger Experience...GraphSummit Singapore | Enhancing Changi Airport Group's Passenger Experience...
GraphSummit Singapore | Enhancing Changi Airport Group's Passenger Experience...
 
20240607 QFM018 Elixir Reading List May 2024
20240607 QFM018 Elixir Reading List May 202420240607 QFM018 Elixir Reading List May 2024
20240607 QFM018 Elixir Reading List May 2024
 
How to use Firebase Data Connect For Flutter
How to use Firebase Data Connect For FlutterHow to use Firebase Data Connect For Flutter
How to use Firebase Data Connect For Flutter
 
“I’m still / I’m still / Chaining from the Block”
“I’m still / I’m still / Chaining from the Block”“I’m still / I’m still / Chaining from the Block”
“I’m still / I’m still / Chaining from the Block”
 
Let's Integrate MuleSoft RPA, COMPOSER, APM with AWS IDP along with Slack
Let's Integrate MuleSoft RPA, COMPOSER, APM with AWS IDP along with SlackLet's Integrate MuleSoft RPA, COMPOSER, APM with AWS IDP along with Slack
Let's Integrate MuleSoft RPA, COMPOSER, APM with AWS IDP along with Slack
 
Video Streaming: Then, Now, and in the Future
Video Streaming: Then, Now, and in the FutureVideo Streaming: Then, Now, and in the Future
Video Streaming: Then, Now, and in the Future
 
Goodbye Windows 11: Make Way for Nitrux Linux 3.5.0!
Goodbye Windows 11: Make Way for Nitrux Linux 3.5.0!Goodbye Windows 11: Make Way for Nitrux Linux 3.5.0!
Goodbye Windows 11: Make Way for Nitrux Linux 3.5.0!
 
How to Get CNIC Information System with Paksim Ga.pptx
How to Get CNIC Information System with Paksim Ga.pptxHow to Get CNIC Information System with Paksim Ga.pptx
How to Get CNIC Information System with Paksim Ga.pptx
 

Android bootcamp-day1

  • 2. Contents • What is Android and what is Android Studio?(Quick review) • Setting up Android studio • Activity and its life cycle. • Android project Structure • Layout and Types of Layout • Guide to res Folder
  • 3. Know this… • There are no stupid questions!
  • 4.
  • 5. What is Android? • Open-source Linux-based operating system • Developed by Open Handset Alliance(Business alliance of around 80 companies) lead by Google. • Source code is called Android Open-Source Project(AOSP) • Launched in 2007 for the first time (Android 1.0) • Programming languages: Java, Kotlin, XML,C++ • Current Android version is Android 11 • Development tool: Android Studio
  • 6. What is Android studio? • Official IDE for development of Android applications • Comes with gradle • GitHub integration • C++ and NDK(Native Development Kit) support • Built-in support for Google Cloud Platform.
  • 7. Setting Up Android Studio • Download Android Studio From the link: https://developer.android.com/studio Click this button
  • 8. Setting up Android Studio • Click on the check box and click download button
  • 10.
  • 13. Activity • An activity represents a single screen with a user interface just like window. Below are the 3 different activities.
  • 14. B-but they are all WhatsApp!
  • 15. Activity • An activity is a single, focused thing that the user can do. • Almost all activities interact with the user, so the Activity class takes care of creating a window for you in which you can place your UI with setContentView(View)
  • 16. Life cycle of Activity • onCreate() • onStart() • onResume() • onPause() • onStop() • onDestroy()
  • 17. onCreate() • Called when the activity is first created. • Initialize your objects here. • Always followed by onStart(). • Called only once in a life of an Activity.
  • 18. onStart() • Called when the activity is becoming visible to the user. • User cannot interact with it yet • Very short gap between onResume() and onStart(). • Followed by onResume().
  • 19. onResume() • This is the state in which the app interacts with the user. • The app stays in this state until something happens to take focus away from the app. • Initiates the running state of an App.
  • 20. onPause() • It is called when your activity is not focused • The system calls this method as the first indication that the user is leaving your activity • In Android 7.0 (API level 24) or higher, multiple apps run in multi-window mode. Because only one of the apps (windows) has focus at any time, the system pauses all of the other apps. • A new, semi-transparent activity (such as a dialog) opens. As long as the activity is still partially visible but not in focus, it remains paused.
  • 21. onStop() • When your activity is no longer visible to the user, it has entered the Stopped state. • This may occur, for example, when a newly launched activity covers the entire screen • The system may also call onStop() when the activity has finished running, and is about to be terminated. • Your app might pause animations or switch from fine-grained to coarse-grained location updates.
  • 22. onDestroy() • Called before the activity is destroyed. The system invokes this callback either because: • The activity is finishing (due to the user completely dismissing the activity or due to finish() being called on the activity), or • The system is temporarily destroying the activity due to a configuration change (such as device rotation or multi-window mode)
  • 23.
  • 24.
  • 26. Project Structure of Android Three main folders: 1. java 2. manifest 3. res 4. Gradle scripts
  • 27. java folder • This folder contains all the logical source code that performs functions • Android studio also adds packages for unit testing • You can add activities, simple java classes or packages as you need.
  • 28. manifest folder • It contains only one file i.e AndroidManifest.xml • The AndroidManifest.xml file contains information of your package, including components of the application such as activities, services, broadcast receivers, content providers etc. • Why is this needed? To tell the device information about the app.
  • 29. res folder • This folder contains external resources that the app is going to use • Images, layouts, icons, colors etc. • These are xml files.
  • 30. Gradle Scripts • Gradle is a build system (open source) which is used to automate building, testing, deployment etc. • Simply put, a gradle takes all the source files (java and XML) and apply appropriate tools, e.g., converts the java files into dex files and compresses all of them into a single file known as apk that is actually used.
  • 31. Guide to res folder
  • 32. Layout, What is it? • A view objects are usually called "widgets" and can be one of many subclasses. • A ViewGroup objects are usually called "layouts" can be one of many types that provide a different layout structure. • A layout defines the structure for a user interface in your app, such as in an activity. All elements in the layout are built using a hierarchy of view and viewgroup objects.
  • 33. Layout attributes • Every View or ViewGroup have XML attributes that define the properties of the component • Some attributes are common (such as id attribute) while other are not (such as textSize is only for text related views)
  • 34. Types of Layout • Linear Layout • Constraint Layout • Relative Layout • Frame Layout • Table Layout
  • 35. Linear Layout • Android LinearLayout is a view group that aligns all children in either vertically or horizontally.
  • 36. Relative Layout • Android RelativeLayout enables you to specify how child views are positioned relative to each other. The position of each view can be specified as relative to sibling elements or relative to the parent.
  • 37. Constraint Layout • Constraint Layout is a ViewGroup (i.e. a view that holds other views) which allows you to create large and complex layouts with a flat view hierarchy, and also allows you to position and size widgets in a very flexible way.
  • 38. Frame Layout • Frame Layout is designed to block out an area on the screen to display a single item. Generally, FrameLayout should be used to hold a single child view, because it can be difficult to organize child views in a way that's scalable to different screen sizes without the children overlapping each other.
  • 39. Table Layout • Android TableLayout going to be arranged groups of views into rows and columns. You will use the <TableRow> element to build a row in the table. Each row has zero or more cells; each cell can hold one View object.
  • 40. Views • View is the basic building block of UI(User Interface) in android. • TextView, EditText, Buttons.
  • 41. That’s a lot of theory, right?
  • 42. LET’S MAKE A SIMPLE APP UI!!!

Editor's Notes

  1. 1-https://developer.android.com/guide/topics/graphics/prop-animation