SlideShare uma empresa Scribd logo
1 de 40
Android
mobilių programėlių kūrimo įvadas
Application Fundamentals
- Android applications are written in the
Java programming language.
- The Android operating system is a
multi-user Linux system in which each
application is a different user.
- Each process has its own virtual
machine (VM), so an application's code
runs in isolation from other applications.
Application Components
- There are four different types of application components. Each type serves a
distinct purpose and has a distinct lifecycle that defines how the component is
created and destroyed:

- Activity
- Service
- Content provider
- Broadcast receiver
Activity
An activity represents a single screen with a
user interface. For example, an email
application might have one activity that
shows a list of new emails, another activity to
compose an email, and another activity for
reading emails.
Activity Lifecycle




A representation of how each new activity in a task adds an item to the back
stack. When the user presses the Back button, the current activity is destroyed
and the previous activity resumes.
Activity Lifecycle
onCreate() - Called when the activity is first created. This
is where you should do all of your normal static set up —
create views, bind data to lists, and so on.

onRestart() - Called after the activity has been stopped,
just prior to it being started again.

onStart() - Called just before the activity becomes visible
to the user.

onResume() - Called just before the activity starts
interacting with the user.
Activity Lifecycle
onPause() - Called when the system is about to start
resuming another activity. This method is typically used
to commit unsaved changes to persistent data, stop
animations and other things that may be consuming
CPU, and so on. It should do whatever it does very
quickly, because the next activity will not be resumed
until it returns.

onStop() - Called when the activity is no longer visible to
the user.

onDestroy() - Called before the activity is destroyed. This
is the final call that the activity will receive.
Fragment
A Fragment represents a behavior or a
portion of user interface in an Activity. You
can combine multiple fragments in a single
activity to build a multi-pane UI and reuse a
fragment in multiple activities.
Fragment Lifecycle
onAttach() - Called when the fragment has been
associated with the activity.

onCreate() - The system calls this when creating the
fragment.

onCreateView() - The system calls this when it's time for
the fragment to draw its user interface for the first time.

onActivityCreated() - Called when the activity's
onCreate() method has returned.

onStart(), onResume() - Same as Activity.
Fragment Lifecycle
onPause() - The system calls this method as the first
indication that the user is leaving the fragment (though it
does not always mean the fragment is being destroyed).

onStop() - Called when the Fragment is no longer started.

onDestroyView() - Called when the view hierarchy
associated with the fragment is being removed.

onDestroy() - Called when the fragment is no longer in
use.

onDetach() - Called when the fragment is being
disassociated from the activity.
Service
A Service is an application component that can perform
long-running operations in the background and does not
provide a user interface.

Started - A service is "started" when an application
component (such as an activity) starts it by calling
startService().

Bound - A service is "bound" when an application
component binds to it by calling bindService().

A service runs in the main thread of its hosting process -
the service does not create its own thread and does not
run in a separate process (unless you specify otherwise).
Content Provider
A content provider manages access to a central
repository of data. A provider is part of an Android
application, which often provides its own UI for working
with the data.

Decide if you need a content provider. You need to build
a content provider if you want to provide one or more of
the following features:
- You want to offer complex data or files to other
applications.
- You want to allow users to copy complex data from your
app into other apps.
- You want to provide custom search suggestions using
the search framework.
Broadcast receivers
A broadcast receiver is a
component that responds to
system-wide broadcast
announcements. Many
broadcasts originate from the
system—for example, a
broadcast announcing that the
screen has turned off, the
battery is low, or a picture was
captured.
Intents and Intent Filters



Three of the core components of an application - activities,
services, and broadcast receivers - are activated through
messages, called intents.
User Interface
All user interface elements in an
Android app are built using View
and ViewGroup objects.

A View is an object that draws
something on the screen that the
user can interact with.

A ViewGroup is an object that
holds other View (and
ViewGroup) objects in order to
define the layout of the interface.
User Interface
All user interface elements in an
Android app are built using View
and ViewGroup objects.

A View is an object that draws
something on the screen that the
user can interact with.

A ViewGroup is an object that
holds other View (and
ViewGroup) objects in order to
define the layout of the interface.
Linear Layout
LinearLayout is a view group that aligns all
children in a single direction, vertically or
horizontally. You can specify the layout direction
with the android:orientation attribute.
Linear Layout Example
All children of a LinearLayout are
stacked one after the other, so a
vertical list will only have one
child per row, no matter how wide
they are, and a horizontal list will
only be one row high (the height
of the tallest child, plus padding).
Relative Layout
RelativeLayout is a view group that displays child
views in relative positions. The position of each
view can be specified as relative to sibling
elements (such as to the left-of or below another
view) or in positions relative to the parent
RelativeLayout area (such as aligned to the
bottom, left of center).
Relative Layout Example
RelativeLayout lets child views
specify their position relative to
the parent view or to each other
(specified by ID). So you can
align two elements by right
border, or make one below
another, centered in the screen,
centered left, and so on. By
default, all child views are drawn
at the top-left of the layout, so you
must define the position of each
view using the various layout
properties available from
RelativeLayout.LayoutParams.
List View
ListView is a view group that displays a list of
scrollable items. The list items are automatically
inserted to the list using an Adapter that pulls
content from a source such as an array or
database query and converts each item result
into a view that's placed into the list.
Grid View
GridView is a ViewGroup that displays items in a
two-dimensional, scrollable grid. The grid items
are automatically inserted to the layout using a
ListAdapter.
Input Controls
Input controls are the interactive components in
your app's user interface. Android provides a
wide variety of controls you can use in your UI,
such as buttons, text fields, seek bars,
checkboxes, zoom buttons, toggle buttons, and
many more.
Buttons


          Depending on whether you
          want a button with text, an
          icon, or both, you can
          create the button in your
          layout in three ways.
Text Fields
Input controls are the interactive components in
your app's user interface. Android provides a
wide variety of controls you can use in your UI,
such as buttons, text fields, seek bars,
checkboxes, zoom buttons, toggle buttons, and
many more.
Text Fields
You can specify the type of keyboard you want for your EditText
object with the android:inputType attribute.

There are several different input types available for different
situations. Here are some of the more common values for
android:inputType:

"text" - Normal text keyboard.
"textEmailAddress" -Normal text keyboard with the @ character.
"textUri" - Normal text keyboard with the / character.
"number" - Basic number keypad.
"phone" - Phone-style keypad.
Checkboxes / Radio Buttons
Checkboxes allow the user to select one or more
options from a set. Typically, you should present
each checkbox option in a vertical list.




Radio buttons allow the user to select one option
from a set. You should use radio buttons for
optional sets that are mutually exclusive if you
think that the user needs to see all available
options side-by-side.
Setup IDE

      http://developer.android.com/tools/
Create Android project
Create Android project
Android project structure
            src – Java code

            assets – external files

            libs – external libraries

            res – application resources

            AndroidManifest.xml – the "manifest" file
MainActivity.java
activity_main.xml / strings.xml
Hello world Result
Create Result Activity Manifest file
Create Result Activity
Update Main Activity
Update Main Activity
Update Main Activity
Q&A
v.valkaitis@appcamp.lt

Mais conteúdo relacionado

Mais procurados

Android Tutorial For Beginners Part-1
Android Tutorial For Beginners Part-1Android Tutorial For Beginners Part-1
Android Tutorial For Beginners Part-1Amit Saxena
 
04 user interfaces
04 user interfaces04 user interfaces
04 user interfacesC.o. Nieto
 
Android User Interface Tutorial: DatePicker, TimePicker & Spinner
Android User Interface Tutorial: DatePicker, TimePicker & SpinnerAndroid User Interface Tutorial: DatePicker, TimePicker & Spinner
Android User Interface Tutorial: DatePicker, TimePicker & SpinnerAhsanul Karim
 
Marakana Android User Interface
Marakana Android User InterfaceMarakana Android User Interface
Marakana Android User InterfaceMarko Gargenta
 
Lecture 05. UI programming for Mobile Apps
Lecture 05. UI programming for Mobile AppsLecture 05. UI programming for Mobile Apps
Lecture 05. UI programming for Mobile AppsMaksym Davydov
 
Day: 2 Environment Setup for Android Application Development
Day: 2 Environment Setup for Android Application DevelopmentDay: 2 Environment Setup for Android Application Development
Day: 2 Environment Setup for Android Application DevelopmentAhsanul Karim
 
Android Application Component: BroadcastReceiver Tutorial
Android Application Component: BroadcastReceiver TutorialAndroid Application Component: BroadcastReceiver Tutorial
Android Application Component: BroadcastReceiver TutorialAhsanul Karim
 
Day 4: Android: UI Widgets
Day 4: Android: UI WidgetsDay 4: Android: UI Widgets
Day 4: Android: UI WidgetsAhsanul Karim
 
Android MapView and MapActivity
Android MapView and MapActivityAndroid MapView and MapActivity
Android MapView and MapActivityAhsanul Karim
 
Day 8: Dealing with Lists and ListViews
Day 8: Dealing with Lists and ListViewsDay 8: Dealing with Lists and ListViews
Day 8: Dealing with Lists and ListViewsAhsanul Karim
 
Building a simple user interface lesson2
Building a simple user interface lesson2Building a simple user interface lesson2
Building a simple user interface lesson2Kalluri Vinay Reddy
 
Android Workshop: Day 1 Part 3
Android Workshop: Day 1 Part 3Android Workshop: Day 1 Part 3
Android Workshop: Day 1 Part 3Ahsanul Karim
 
How to create ui using droid draw
How to create ui using droid drawHow to create ui using droid draw
How to create ui using droid drawinfo_zybotech
 
Android Screen Containers & Layouts
Android Screen Containers & LayoutsAndroid Screen Containers & Layouts
Android Screen Containers & LayoutsVijay Rastogi
 

Mais procurados (20)

Android Tutorial For Beginners Part-1
Android Tutorial For Beginners Part-1Android Tutorial For Beginners Part-1
Android Tutorial For Beginners Part-1
 
04 user interfaces
04 user interfaces04 user interfaces
04 user interfaces
 
Android UI Fundamentals part 1
Android UI Fundamentals part 1Android UI Fundamentals part 1
Android UI Fundamentals part 1
 
Android User Interface Tutorial: DatePicker, TimePicker & Spinner
Android User Interface Tutorial: DatePicker, TimePicker & SpinnerAndroid User Interface Tutorial: DatePicker, TimePicker & Spinner
Android User Interface Tutorial: DatePicker, TimePicker & Spinner
 
Marakana Android User Interface
Marakana Android User InterfaceMarakana Android User Interface
Marakana Android User Interface
 
Lecture 05. UI programming for Mobile Apps
Lecture 05. UI programming for Mobile AppsLecture 05. UI programming for Mobile Apps
Lecture 05. UI programming for Mobile Apps
 
Day: 2 Environment Setup for Android Application Development
Day: 2 Environment Setup for Android Application DevelopmentDay: 2 Environment Setup for Android Application Development
Day: 2 Environment Setup for Android Application Development
 
Android Lesson 2
Android Lesson 2Android Lesson 2
Android Lesson 2
 
Android UI Patterns
Android UI PatternsAndroid UI Patterns
Android UI Patterns
 
Android development session 3 - layout
Android development   session 3 - layoutAndroid development   session 3 - layout
Android development session 3 - layout
 
Android Application Component: BroadcastReceiver Tutorial
Android Application Component: BroadcastReceiver TutorialAndroid Application Component: BroadcastReceiver Tutorial
Android Application Component: BroadcastReceiver Tutorial
 
Day 4: Android: UI Widgets
Day 4: Android: UI WidgetsDay 4: Android: UI Widgets
Day 4: Android: UI Widgets
 
Android MapView and MapActivity
Android MapView and MapActivityAndroid MapView and MapActivity
Android MapView and MapActivity
 
Day 8: Dealing with Lists and ListViews
Day 8: Dealing with Lists and ListViewsDay 8: Dealing with Lists and ListViews
Day 8: Dealing with Lists and ListViews
 
Building a simple user interface lesson2
Building a simple user interface lesson2Building a simple user interface lesson2
Building a simple user interface lesson2
 
Android Workshop: Day 1 Part 3
Android Workshop: Day 1 Part 3Android Workshop: Day 1 Part 3
Android Workshop: Day 1 Part 3
 
Android Basic Components
Android Basic ComponentsAndroid Basic Components
Android Basic Components
 
Android Widget
Android WidgetAndroid Widget
Android Widget
 
How to create ui using droid draw
How to create ui using droid drawHow to create ui using droid draw
How to create ui using droid draw
 
Android Screen Containers & Layouts
Android Screen Containers & LayoutsAndroid Screen Containers & Layouts
Android Screen Containers & Layouts
 

Destaque

Presentatie 5febr [autosaved]
Presentatie 5febr [autosaved]Presentatie 5febr [autosaved]
Presentatie 5febr [autosaved]Kim Raes
 
Hipertensión arterial
Hipertensión arterialHipertensión arterial
Hipertensión arterialBlanca BF
 
Info avond 1oktober Stand van zaken hopmarktproject (vzw AHA)
Info avond 1oktober Stand van zaken hopmarktproject (vzw AHA)Info avond 1oktober Stand van zaken hopmarktproject (vzw AHA)
Info avond 1oktober Stand van zaken hopmarktproject (vzw AHA)Kim Raes
 
презентация ооо оптэлко
презентация ооо оптэлкопрезентация ооо оптэлко
презентация ооо оптэлкоneevinata
 
Suson eye specialists_guide_new
Suson eye specialists_guide_newSuson eye specialists_guide_new
Suson eye specialists_guide_newJohn Suson
 
"Android" mobilių programėlių kūrimo įvadas #4
"Android" mobilių programėlių kūrimo įvadas #4"Android" mobilių programėlių kūrimo įvadas #4
"Android" mobilių programėlių kūrimo įvadas #4Tadas Jurelevičius
 
Top 10 Comparison Shopping Engines
Top 10 Comparison Shopping EnginesTop 10 Comparison Shopping Engines
Top 10 Comparison Shopping EnginesConvertro
 
Automatic light project
Automatic light projectAutomatic light project
Automatic light projectkspece0928
 
hipertensión arterial
hipertensión arterial hipertensión arterial
hipertensión arterial Blanca BF
 
mutual funds of pakistan
mutual funds of pakistanmutual funds of pakistan
mutual funds of pakistanChandni Saleem
 
Turkey vs pakistan (1)
Turkey vs pakistan (1)Turkey vs pakistan (1)
Turkey vs pakistan (1)Chandni Saleem
 

Destaque (14)

Presentatie 5febr [autosaved]
Presentatie 5febr [autosaved]Presentatie 5febr [autosaved]
Presentatie 5febr [autosaved]
 
Eric ittah
Eric ittahEric ittah
Eric ittah
 
Hipertensión arterial
Hipertensión arterialHipertensión arterial
Hipertensión arterial
 
Ai
AiAi
Ai
 
Info avond 1oktober Stand van zaken hopmarktproject (vzw AHA)
Info avond 1oktober Stand van zaken hopmarktproject (vzw AHA)Info avond 1oktober Stand van zaken hopmarktproject (vzw AHA)
Info avond 1oktober Stand van zaken hopmarktproject (vzw AHA)
 
презентация ооо оптэлко
презентация ооо оптэлкопрезентация ооо оптэлко
презентация ооо оптэлко
 
RELESTED.PDF
RELESTED.PDFRELESTED.PDF
RELESTED.PDF
 
Suson eye specialists_guide_new
Suson eye specialists_guide_newSuson eye specialists_guide_new
Suson eye specialists_guide_new
 
"Android" mobilių programėlių kūrimo įvadas #4
"Android" mobilių programėlių kūrimo įvadas #4"Android" mobilių programėlių kūrimo įvadas #4
"Android" mobilių programėlių kūrimo įvadas #4
 
Top 10 Comparison Shopping Engines
Top 10 Comparison Shopping EnginesTop 10 Comparison Shopping Engines
Top 10 Comparison Shopping Engines
 
Automatic light project
Automatic light projectAutomatic light project
Automatic light project
 
hipertensión arterial
hipertensión arterial hipertensión arterial
hipertensión arterial
 
mutual funds of pakistan
mutual funds of pakistanmutual funds of pakistan
mutual funds of pakistan
 
Turkey vs pakistan (1)
Turkey vs pakistan (1)Turkey vs pakistan (1)
Turkey vs pakistan (1)
 

Semelhante a "Android" mobilių programėlių kūrimo įvadas #2

Nativa Android Applications development
Nativa Android Applications developmentNativa Android Applications development
Nativa Android Applications developmentAlfredo Morresi
 
Android apps development
Android apps developmentAndroid apps development
Android apps developmentMonir Zzaman
 
Android Bootcamp Tanzania:understanding ui in_android
Android Bootcamp Tanzania:understanding ui in_androidAndroid Bootcamp Tanzania:understanding ui in_android
Android Bootcamp Tanzania:understanding ui in_androidDenis Minja
 
Introduction to Android Development
Introduction to Android DevelopmentIntroduction to Android Development
Introduction to Android DevelopmentAly Abdelkareem
 
Android 101 Session @thejunction32
Android 101 Session @thejunction32Android 101 Session @thejunction32
Android 101 Session @thejunction32Eden Shochat
 
mobile application development -unit-3-
mobile application development  -unit-3-mobile application development  -unit-3-
mobile application development -unit-3-TejamFandat
 
Android application model
Android application modelAndroid application model
Android application modelmagicshui
 
Android Jumpstart Jfokus
Android Jumpstart JfokusAndroid Jumpstart Jfokus
Android Jumpstart JfokusLars Vogel
 
Android Tutorial
Android TutorialAndroid Tutorial
Android TutorialFun2Do Labs
 
Beginning android
Beginning android Beginning android
Beginning android Igor R
 
Day 3: Getting Active Through Activities
Day 3: Getting Active Through ActivitiesDay 3: Getting Active Through Activities
Day 3: Getting Active Through ActivitiesAhsanul Karim
 
ANDROID LAB MANUAL.doc
ANDROID LAB MANUAL.docANDROID LAB MANUAL.doc
ANDROID LAB MANUAL.docPalakjaiswal43
 
Android app fundamentals
Android app fundamentalsAndroid app fundamentals
Android app fundamentalsAmr Salman
 
Android apps development
Android apps developmentAndroid apps development
Android apps developmentRaman Pandey
 
Beginning Native Android Apps
Beginning Native Android AppsBeginning Native Android Apps
Beginning Native Android AppsGil Irizarry
 
Industrial Training in Android Application
Industrial Training in Android ApplicationIndustrial Training in Android Application
Industrial Training in Android ApplicationArcadian Learning
 
行動App開發管理實務 unit2
行動App開發管理實務 unit2行動App開發管理實務 unit2
行動App開發管理實務 unit2Xavier Yin
 

Semelhante a "Android" mobilių programėlių kūrimo įvadas #2 (20)

Nativa Android Applications development
Nativa Android Applications developmentNativa Android Applications development
Nativa Android Applications development
 
Android apps development
Android apps developmentAndroid apps development
Android apps development
 
Android Bootcamp Tanzania:understanding ui in_android
Android Bootcamp Tanzania:understanding ui in_androidAndroid Bootcamp Tanzania:understanding ui in_android
Android Bootcamp Tanzania:understanding ui in_android
 
Android beginners David
Android beginners DavidAndroid beginners David
Android beginners David
 
Introduction to Android Development
Introduction to Android DevelopmentIntroduction to Android Development
Introduction to Android Development
 
Android 101 Session @thejunction32
Android 101 Session @thejunction32Android 101 Session @thejunction32
Android 101 Session @thejunction32
 
Android app development
Android app developmentAndroid app development
Android app development
 
Android Development Basics
Android Development BasicsAndroid Development Basics
Android Development Basics
 
mobile application development -unit-3-
mobile application development  -unit-3-mobile application development  -unit-3-
mobile application development -unit-3-
 
Android application model
Android application modelAndroid application model
Android application model
 
Android Jumpstart Jfokus
Android Jumpstart JfokusAndroid Jumpstart Jfokus
Android Jumpstart Jfokus
 
Android Tutorial
Android TutorialAndroid Tutorial
Android Tutorial
 
Beginning android
Beginning android Beginning android
Beginning android
 
Day 3: Getting Active Through Activities
Day 3: Getting Active Through ActivitiesDay 3: Getting Active Through Activities
Day 3: Getting Active Through Activities
 
ANDROID LAB MANUAL.doc
ANDROID LAB MANUAL.docANDROID LAB MANUAL.doc
ANDROID LAB MANUAL.doc
 
Android app fundamentals
Android app fundamentalsAndroid app fundamentals
Android app fundamentals
 
Android apps development
Android apps developmentAndroid apps development
Android apps development
 
Beginning Native Android Apps
Beginning Native Android AppsBeginning Native Android Apps
Beginning Native Android Apps
 
Industrial Training in Android Application
Industrial Training in Android ApplicationIndustrial Training in Android Application
Industrial Training in Android Application
 
行動App開發管理實務 unit2
行動App開發管理實務 unit2行動App開發管理實務 unit2
行動App開發管理實務 unit2
 

Último

Proudly South Africa powerpoint Thorisha.pptx
Proudly South Africa powerpoint Thorisha.pptxProudly South Africa powerpoint Thorisha.pptx
Proudly South Africa powerpoint Thorisha.pptxthorishapillay1
 
Keynote by Prof. Wurzer at Nordex about IP-design
Keynote by Prof. Wurzer at Nordex about IP-designKeynote by Prof. Wurzer at Nordex about IP-design
Keynote by Prof. Wurzer at Nordex about IP-designMIPLM
 
Incoming and Outgoing Shipments in 3 STEPS Using Odoo 17
Incoming and Outgoing Shipments in 3 STEPS Using Odoo 17Incoming and Outgoing Shipments in 3 STEPS Using Odoo 17
Incoming and Outgoing Shipments in 3 STEPS Using Odoo 17Celine George
 
How to do quick user assign in kanban in Odoo 17 ERP
How to do quick user assign in kanban in Odoo 17 ERPHow to do quick user assign in kanban in Odoo 17 ERP
How to do quick user assign in kanban in Odoo 17 ERPCeline George
 
Gas measurement O2,Co2,& ph) 04/2024.pptx
Gas measurement O2,Co2,& ph) 04/2024.pptxGas measurement O2,Co2,& ph) 04/2024.pptx
Gas measurement O2,Co2,& ph) 04/2024.pptxDr.Ibrahim Hassaan
 
Karra SKD Conference Presentation Revised.pptx
Karra SKD Conference Presentation Revised.pptxKarra SKD Conference Presentation Revised.pptx
Karra SKD Conference Presentation Revised.pptxAshokKarra1
 
AMERICAN LANGUAGE HUB_Level2_Student'sBook_Answerkey.pdf
AMERICAN LANGUAGE HUB_Level2_Student'sBook_Answerkey.pdfAMERICAN LANGUAGE HUB_Level2_Student'sBook_Answerkey.pdf
AMERICAN LANGUAGE HUB_Level2_Student'sBook_Answerkey.pdfphamnguyenenglishnb
 
ENGLISH6-Q4-W3.pptxqurter our high choom
ENGLISH6-Q4-W3.pptxqurter our high choomENGLISH6-Q4-W3.pptxqurter our high choom
ENGLISH6-Q4-W3.pptxqurter our high choomnelietumpap1
 
Earth Day Presentation wow hello nice great
Earth Day Presentation wow hello nice greatEarth Day Presentation wow hello nice great
Earth Day Presentation wow hello nice greatYousafMalik24
 
Field Attribute Index Feature in Odoo 17
Field Attribute Index Feature in Odoo 17Field Attribute Index Feature in Odoo 17
Field Attribute Index Feature in Odoo 17Celine George
 
ACC 2024 Chronicles. Cardiology. Exam.pdf
ACC 2024 Chronicles. Cardiology. Exam.pdfACC 2024 Chronicles. Cardiology. Exam.pdf
ACC 2024 Chronicles. Cardiology. Exam.pdfSpandanaRallapalli
 
Procuring digital preservation CAN be quick and painless with our new dynamic...
Procuring digital preservation CAN be quick and painless with our new dynamic...Procuring digital preservation CAN be quick and painless with our new dynamic...
Procuring digital preservation CAN be quick and painless with our new dynamic...Jisc
 
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
 
ANG SEKTOR NG agrikultura.pptx QUARTER 4
ANG SEKTOR NG agrikultura.pptx QUARTER 4ANG SEKTOR NG agrikultura.pptx QUARTER 4
ANG SEKTOR NG agrikultura.pptx QUARTER 4MiaBumagat1
 
Choosing the Right CBSE School A Comprehensive Guide for Parents
Choosing the Right CBSE School A Comprehensive Guide for ParentsChoosing the Right CBSE School A Comprehensive Guide for Parents
Choosing the Right CBSE School A Comprehensive Guide for Parentsnavabharathschool99
 
ECONOMIC CONTEXT - PAPER 1 Q3: NEWSPAPERS.pptx
ECONOMIC CONTEXT - PAPER 1 Q3: NEWSPAPERS.pptxECONOMIC CONTEXT - PAPER 1 Q3: NEWSPAPERS.pptx
ECONOMIC CONTEXT - PAPER 1 Q3: NEWSPAPERS.pptxiammrhaywood
 
ENGLISH 7_Q4_LESSON 2_ Employing a Variety of Strategies for Effective Interp...
ENGLISH 7_Q4_LESSON 2_ Employing a Variety of Strategies for Effective Interp...ENGLISH 7_Q4_LESSON 2_ Employing a Variety of Strategies for Effective Interp...
ENGLISH 7_Q4_LESSON 2_ Employing a Variety of Strategies for Effective Interp...JhezDiaz1
 

Último (20)

Proudly South Africa powerpoint Thorisha.pptx
Proudly South Africa powerpoint Thorisha.pptxProudly South Africa powerpoint Thorisha.pptx
Proudly South Africa powerpoint Thorisha.pptx
 
Keynote by Prof. Wurzer at Nordex about IP-design
Keynote by Prof. Wurzer at Nordex about IP-designKeynote by Prof. Wurzer at Nordex about IP-design
Keynote by Prof. Wurzer at Nordex about IP-design
 
Incoming and Outgoing Shipments in 3 STEPS Using Odoo 17
Incoming and Outgoing Shipments in 3 STEPS Using Odoo 17Incoming and Outgoing Shipments in 3 STEPS Using Odoo 17
Incoming and Outgoing Shipments in 3 STEPS Using Odoo 17
 
YOUVE_GOT_EMAIL_PRELIMS_EL_DORADO_2024.pptx
YOUVE_GOT_EMAIL_PRELIMS_EL_DORADO_2024.pptxYOUVE_GOT_EMAIL_PRELIMS_EL_DORADO_2024.pptx
YOUVE_GOT_EMAIL_PRELIMS_EL_DORADO_2024.pptx
 
How to do quick user assign in kanban in Odoo 17 ERP
How to do quick user assign in kanban in Odoo 17 ERPHow to do quick user assign in kanban in Odoo 17 ERP
How to do quick user assign in kanban in Odoo 17 ERP
 
Gas measurement O2,Co2,& ph) 04/2024.pptx
Gas measurement O2,Co2,& ph) 04/2024.pptxGas measurement O2,Co2,& ph) 04/2024.pptx
Gas measurement O2,Co2,& ph) 04/2024.pptx
 
YOUVE GOT EMAIL_FINALS_EL_DORADO_2024.pptx
YOUVE GOT EMAIL_FINALS_EL_DORADO_2024.pptxYOUVE GOT EMAIL_FINALS_EL_DORADO_2024.pptx
YOUVE GOT EMAIL_FINALS_EL_DORADO_2024.pptx
 
Karra SKD Conference Presentation Revised.pptx
Karra SKD Conference Presentation Revised.pptxKarra SKD Conference Presentation Revised.pptx
Karra SKD Conference Presentation Revised.pptx
 
AMERICAN LANGUAGE HUB_Level2_Student'sBook_Answerkey.pdf
AMERICAN LANGUAGE HUB_Level2_Student'sBook_Answerkey.pdfAMERICAN LANGUAGE HUB_Level2_Student'sBook_Answerkey.pdf
AMERICAN LANGUAGE HUB_Level2_Student'sBook_Answerkey.pdf
 
ENGLISH6-Q4-W3.pptxqurter our high choom
ENGLISH6-Q4-W3.pptxqurter our high choomENGLISH6-Q4-W3.pptxqurter our high choom
ENGLISH6-Q4-W3.pptxqurter our high choom
 
Earth Day Presentation wow hello nice great
Earth Day Presentation wow hello nice greatEarth Day Presentation wow hello nice great
Earth Day Presentation wow hello nice great
 
Field Attribute Index Feature in Odoo 17
Field Attribute Index Feature in Odoo 17Field Attribute Index Feature in Odoo 17
Field Attribute Index Feature in Odoo 17
 
ACC 2024 Chronicles. Cardiology. Exam.pdf
ACC 2024 Chronicles. Cardiology. Exam.pdfACC 2024 Chronicles. Cardiology. Exam.pdf
ACC 2024 Chronicles. Cardiology. Exam.pdf
 
Procuring digital preservation CAN be quick and painless with our new dynamic...
Procuring digital preservation CAN be quick and painless with our new dynamic...Procuring digital preservation CAN be quick and painless with our new dynamic...
Procuring digital preservation CAN be quick and painless with our new dynamic...
 
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 🔝✔️✔️
 
ANG SEKTOR NG agrikultura.pptx QUARTER 4
ANG SEKTOR NG agrikultura.pptx QUARTER 4ANG SEKTOR NG agrikultura.pptx QUARTER 4
ANG SEKTOR NG agrikultura.pptx QUARTER 4
 
Choosing the Right CBSE School A Comprehensive Guide for Parents
Choosing the Right CBSE School A Comprehensive Guide for ParentsChoosing the Right CBSE School A Comprehensive Guide for Parents
Choosing the Right CBSE School A Comprehensive Guide for Parents
 
ECONOMIC CONTEXT - PAPER 1 Q3: NEWSPAPERS.pptx
ECONOMIC CONTEXT - PAPER 1 Q3: NEWSPAPERS.pptxECONOMIC CONTEXT - PAPER 1 Q3: NEWSPAPERS.pptx
ECONOMIC CONTEXT - PAPER 1 Q3: NEWSPAPERS.pptx
 
ENGLISH 7_Q4_LESSON 2_ Employing a Variety of Strategies for Effective Interp...
ENGLISH 7_Q4_LESSON 2_ Employing a Variety of Strategies for Effective Interp...ENGLISH 7_Q4_LESSON 2_ Employing a Variety of Strategies for Effective Interp...
ENGLISH 7_Q4_LESSON 2_ Employing a Variety of Strategies for Effective Interp...
 
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
 

"Android" mobilių programėlių kūrimo įvadas #2

  • 2. Application Fundamentals - Android applications are written in the Java programming language. - The Android operating system is a multi-user Linux system in which each application is a different user. - Each process has its own virtual machine (VM), so an application's code runs in isolation from other applications.
  • 3. Application Components - There are four different types of application components. Each type serves a distinct purpose and has a distinct lifecycle that defines how the component is created and destroyed: - Activity - Service - Content provider - Broadcast receiver
  • 4. Activity An activity represents a single screen with a user interface. For example, an email application might have one activity that shows a list of new emails, another activity to compose an email, and another activity for reading emails.
  • 5. Activity Lifecycle A representation of how each new activity in a task adds an item to the back stack. When the user presses the Back button, the current activity is destroyed and the previous activity resumes.
  • 6. Activity Lifecycle onCreate() - Called when the activity is first created. This is where you should do all of your normal static set up — create views, bind data to lists, and so on. onRestart() - Called after the activity has been stopped, just prior to it being started again. onStart() - Called just before the activity becomes visible to the user. onResume() - Called just before the activity starts interacting with the user.
  • 7. Activity Lifecycle onPause() - Called when the system is about to start resuming another activity. This method is typically used to commit unsaved changes to persistent data, stop animations and other things that may be consuming CPU, and so on. It should do whatever it does very quickly, because the next activity will not be resumed until it returns. onStop() - Called when the activity is no longer visible to the user. onDestroy() - Called before the activity is destroyed. This is the final call that the activity will receive.
  • 8. Fragment A Fragment represents a behavior or a portion of user interface in an Activity. You can combine multiple fragments in a single activity to build a multi-pane UI and reuse a fragment in multiple activities.
  • 9. Fragment Lifecycle onAttach() - Called when the fragment has been associated with the activity. onCreate() - The system calls this when creating the fragment. onCreateView() - The system calls this when it's time for the fragment to draw its user interface for the first time. onActivityCreated() - Called when the activity's onCreate() method has returned. onStart(), onResume() - Same as Activity.
  • 10. Fragment Lifecycle onPause() - The system calls this method as the first indication that the user is leaving the fragment (though it does not always mean the fragment is being destroyed). onStop() - Called when the Fragment is no longer started. onDestroyView() - Called when the view hierarchy associated with the fragment is being removed. onDestroy() - Called when the fragment is no longer in use. onDetach() - Called when the fragment is being disassociated from the activity.
  • 11. Service A Service is an application component that can perform long-running operations in the background and does not provide a user interface. Started - A service is "started" when an application component (such as an activity) starts it by calling startService(). Bound - A service is "bound" when an application component binds to it by calling bindService(). A service runs in the main thread of its hosting process - the service does not create its own thread and does not run in a separate process (unless you specify otherwise).
  • 12. Content Provider A content provider manages access to a central repository of data. A provider is part of an Android application, which often provides its own UI for working with the data. Decide if you need a content provider. You need to build a content provider if you want to provide one or more of the following features: - You want to offer complex data or files to other applications. - You want to allow users to copy complex data from your app into other apps. - You want to provide custom search suggestions using the search framework.
  • 13. Broadcast receivers A broadcast receiver is a component that responds to system-wide broadcast announcements. Many broadcasts originate from the system—for example, a broadcast announcing that the screen has turned off, the battery is low, or a picture was captured.
  • 14. Intents and Intent Filters Three of the core components of an application - activities, services, and broadcast receivers - are activated through messages, called intents.
  • 15. User Interface All user interface elements in an Android app are built using View and ViewGroup objects. A View is an object that draws something on the screen that the user can interact with. A ViewGroup is an object that holds other View (and ViewGroup) objects in order to define the layout of the interface.
  • 16. User Interface All user interface elements in an Android app are built using View and ViewGroup objects. A View is an object that draws something on the screen that the user can interact with. A ViewGroup is an object that holds other View (and ViewGroup) objects in order to define the layout of the interface.
  • 17. Linear Layout LinearLayout is a view group that aligns all children in a single direction, vertically or horizontally. You can specify the layout direction with the android:orientation attribute.
  • 18. Linear Layout Example All children of a LinearLayout are stacked one after the other, so a vertical list will only have one child per row, no matter how wide they are, and a horizontal list will only be one row high (the height of the tallest child, plus padding).
  • 19. Relative Layout RelativeLayout is a view group that displays child views in relative positions. The position of each view can be specified as relative to sibling elements (such as to the left-of or below another view) or in positions relative to the parent RelativeLayout area (such as aligned to the bottom, left of center).
  • 20. Relative Layout Example RelativeLayout lets child views specify their position relative to the parent view or to each other (specified by ID). So you can align two elements by right border, or make one below another, centered in the screen, centered left, and so on. By default, all child views are drawn at the top-left of the layout, so you must define the position of each view using the various layout properties available from RelativeLayout.LayoutParams.
  • 21. List View ListView is a view group that displays a list of scrollable items. The list items are automatically inserted to the list using an Adapter that pulls content from a source such as an array or database query and converts each item result into a view that's placed into the list.
  • 22. Grid View GridView is a ViewGroup that displays items in a two-dimensional, scrollable grid. The grid items are automatically inserted to the layout using a ListAdapter.
  • 23. Input Controls Input controls are the interactive components in your app's user interface. Android provides a wide variety of controls you can use in your UI, such as buttons, text fields, seek bars, checkboxes, zoom buttons, toggle buttons, and many more.
  • 24. Buttons Depending on whether you want a button with text, an icon, or both, you can create the button in your layout in three ways.
  • 25. Text Fields Input controls are the interactive components in your app's user interface. Android provides a wide variety of controls you can use in your UI, such as buttons, text fields, seek bars, checkboxes, zoom buttons, toggle buttons, and many more.
  • 26. Text Fields You can specify the type of keyboard you want for your EditText object with the android:inputType attribute. There are several different input types available for different situations. Here are some of the more common values for android:inputType: "text" - Normal text keyboard. "textEmailAddress" -Normal text keyboard with the @ character. "textUri" - Normal text keyboard with the / character. "number" - Basic number keypad. "phone" - Phone-style keypad.
  • 27. Checkboxes / Radio Buttons Checkboxes allow the user to select one or more options from a set. Typically, you should present each checkbox option in a vertical list. Radio buttons allow the user to select one option from a set. You should use radio buttons for optional sets that are mutually exclusive if you think that the user needs to see all available options side-by-side.
  • 28. Setup IDE http://developer.android.com/tools/
  • 31. Android project structure src – Java code assets – external files libs – external libraries res – application resources AndroidManifest.xml – the "manifest" file
  • 35. Create Result Activity Manifest file