SlideShare a Scribd company logo
1 of 44
Mobile application
development
Android introduction
Alberto Rubalcaba
Oracle Certified Professional, Java SE Programmer
¿What is Android?
 Open source, open platform for mobile development
 All the SDK, API and platform source is available
 No need for licence or app review
 You can replace any system app with your own
 Official development site: developer.android.com
How it works?
Components architecture model
Every component provides his interface
Java programming
Useful programming tips
Avoid creating objects
Use native functions
Prefer static
Avoid internal getter o setter
Declare constants final
Avoid floats and enums
Android Architecture
Project architecture
Design principles
Delight me in surprising
Real objects are more fun than buttons and menus
Let me make it mine
Get to know me
Keep it brief
Pictures are faster than words
Decide for me, but let me have the final say
http://developer.android.com/design/get-started/principles.html
App components
Activities
Services
Content providers
Broadcast receivers
Activity life cycle
Services
Perform long operations on background
Runs trough applications
A component can bind to a service to interact with and perform
interprocess communication (IPC)
Service states
Started
Bound
http://developer.android.com/guide/components/services.html
Content providers
Manages access to structured set of data
Provide mechanisms for defining data security
Connects data in one process with code running in another process
http://developer.android.com/guide/topics/providers/content-
providers.html
Broadcast receivers
Send broadcasts across applications
Registered by the context of the application dynamically
Registered statically in the android manifest
http://developer.android.com/reference/android/content/BroadcastRe
ceiver.html
Intents
Abstract description of an operation to be performed
Can be used to start activities, send broadcasts, start or bind services
Intent structure
Action. The general action to be performed
Data. The data to operate on, such a record on contacts, as a URI
Category. Gives additional information about the action to execute
Type. Specifies an explicit type (MIME types) of the intent data
Extras. This is a Bundle of additional information
http://developer.android.com/reference/android/content/Intent.html
Application Context
Interface to global information about an application environment
Abstract class whose implementation is provided by Android system
Allows access to application-specific resources and classes
Calls for application-level operations such as launching activities,
broadcasting and receiving intents
http://developer.android.com/reference/android/content/Context.htm
l
Bundle
Mapping to String values to various Parcelable types (Serializable)
Has methods to put <key,value>’s to the map
Has methods to get <key,value>’s from the map
Has a method to clear() the whole map
http://developer.android.com/reference/android/os/Bundle.html
Manifest
All applications must have a manifest in the root directory
Presents essential information the system must have before running
the app
It names the java package for the application
It describes the components of the application
It determines which processes will host application components
Declares permissions to access protected parts of the API
http://developer.android.com/guide/topics/manifest/manifest-
intro.html
User interface
Built using View and ViewGroup objects
A View is an object that draws something on the screen to interact
with
A ViewGroup is an object that holds other View’s and ViewGroup’s
objects in order to define the layout of the app
http://developer.android.com/guide/topics/ui/index.html
User interface layout
User interface layout
The effective way to define your layout is via XML
The name of the XML element is respective to the Android class it
represents
http://developer.android.com/guide/topics/ui/declaring-layout.html
Example
Layouts
Defines the visual structure for a user interface
After declaring a layout in XML, it should be saved in the res/layout
project directory
When you compile your app, each layout is compiled into a View
resource
The layout should be loaded in the Activity.onCreate(Bundle b)
method
Call setContentView(R.layout.my_view)
Common Layouts
Linear layout
Relative layout
Web view
List view
Grid view
Input controls
Interactive components in your UI
Just add the control to the xml
http://developer.android.com/guide/topics/ui/controls.html
Common controls
Event listeners
Event listener example
Menus
Common UI component
Appears when the user touch the menu soft/hard button
Types of menus
Options menu and action bar
Context menu and contextual action menu
Pop up menu
http://developer.android.com/guide/topics/ui/menus.html
Defining a menu in XML
Defined in res/menu
Inflate the menu in the onCreate(Bundle b) method
Easier to visualize the menu structure in XML
Separates the content of the menu from the behavioral code
Allows to create alternative menu configurations
Allows to create submenus
Menu example
Handling menu events
Dialogs
AlertDialog
DatePickerDialog
TimePickerDialog
CustomDialogs
http://developer.android.com/guide/topics/ui/dialogs.html
Dialogs (1)
Dialogs content
Title
Optional, should be used only when the content area is occupied by a detailed message,
list or custom layout
Content area
This can display a message, a list or a custom layout
Action buttons
There should be no more than 3 action buttons in a dialog
Dialogs (2)
The alertDialog.Builder class provides API’s that allow you to create
an AlertDialog with the kinds of contents, including custom layouts
Dialogs (3)
To add action buttons call the setPositiveButton() and
setNegativeButton() methods
Dialogs (4)
Traditional single-choice list
Persistent single-choice list (radio buttons)
Persistent multiple-choice list (check boxes)
Toasts
Provides a simple feedback about an operation in a small popup
Fills the amount of space required for the message
http://developer.android.com/guide/topics/ui/notifiers/toasts.html
Toasts (1)
Instantiate a Toast object with one of the makeToast() methods
This method takes three parameters
Application context
String message
Toast duration (millis)
Custom Toasts
 You can create customized layout for your toast notification
 Define a view XML layout
 Pass the root view object to the setView(View) method
Custom Toasts
You must use the ID of your custom layout to inflate it from the XML
Sensors
Sensors (1)
Sensor framwork
SensorManager
Sensor
SensorEvent
SensorEventListener
http://developer.android.com/guide/topics/sensors/index.html
Sensors (2)
Identifying sensors
Get the sensor service
Get the sensor that you are looking for
Sensors (3)
• Monitoring events
Let’s code 

More Related Content

What's hot

03 android application structure
03 android application structure03 android application structure
03 android application structureSokngim Sa
 
01 introduction to android
01 introduction to android01 introduction to android
01 introduction to androidSokngim Sa
 
View groups containers
View groups containersView groups containers
View groups containersMani Selvaraj
 
Beginning android
Beginning android Beginning android
Beginning android Igor R
 
01 11 - graphical user interface - fonts-web-tab
01  11 - graphical user interface - fonts-web-tab01  11 - graphical user interface - fonts-web-tab
01 11 - graphical user interface - fonts-web-tabSiva Kumar reddy Vasipally
 
Android app fundamentals
Android app fundamentalsAndroid app fundamentals
Android app fundamentalsAmr Salman
 
Day 4: Android: UI Widgets
Day 4: Android: UI WidgetsDay 4: Android: UI Widgets
Day 4: Android: UI WidgetsAhsanul Karim
 
Android development orientation for starters v4 seminar
Android development orientation for starters v4   seminarAndroid development orientation for starters v4   seminar
Android development orientation for starters v4 seminarJoemarie Amparo
 
Android development orientation for starters v2
Android development orientation for starters v2Android development orientation for starters v2
Android development orientation for starters v2Joemarie Amparo
 
Learn Xamarin Absolute Beginners - Permissions, Building the App GUI & Menus
Learn Xamarin Absolute Beginners - Permissions, Building the App GUI & MenusLearn Xamarin Absolute Beginners - Permissions, Building the App GUI & Menus
Learn Xamarin Absolute Beginners - Permissions, Building the App GUI & MenusEng Teong Cheah
 

What's hot (20)

03 android application structure
03 android application structure03 android application structure
03 android application structure
 
Ppt 2 android_basics
Ppt 2 android_basicsPpt 2 android_basics
Ppt 2 android_basics
 
01 introduction to android
01 introduction to android01 introduction to android
01 introduction to android
 
View groups containers
View groups containersView groups containers
View groups containers
 
Android resources in android-chapter9
Android resources in android-chapter9Android resources in android-chapter9
Android resources in android-chapter9
 
Beginning android
Beginning android Beginning android
Beginning android
 
Android session 3
Android session 3Android session 3
Android session 3
 
Lesson 10
Lesson 10Lesson 10
Lesson 10
 
Android session 2
Android session 2Android session 2
Android session 2
 
Android programming basics
Android programming basicsAndroid programming basics
Android programming basics
 
Android session 1
Android session 1Android session 1
Android session 1
 
01 08 - graphical user interface - layouts
01  08 - graphical user interface - layouts01  08 - graphical user interface - layouts
01 08 - graphical user interface - layouts
 
01 11 - graphical user interface - fonts-web-tab
01  11 - graphical user interface - fonts-web-tab01  11 - graphical user interface - fonts-web-tab
01 11 - graphical user interface - fonts-web-tab
 
Android app fundamentals
Android app fundamentalsAndroid app fundamentals
Android app fundamentals
 
Android Programming.pptx
Android Programming.pptxAndroid Programming.pptx
Android Programming.pptx
 
Day 4: Android: UI Widgets
Day 4: Android: UI WidgetsDay 4: Android: UI Widgets
Day 4: Android: UI Widgets
 
Android development orientation for starters v4 seminar
Android development orientation for starters v4   seminarAndroid development orientation for starters v4   seminar
Android development orientation for starters v4 seminar
 
Android development orientation for starters v2
Android development orientation for starters v2Android development orientation for starters v2
Android development orientation for starters v2
 
Learn Xamarin Absolute Beginners - Permissions, Building the App GUI & Menus
Learn Xamarin Absolute Beginners - Permissions, Building the App GUI & MenusLearn Xamarin Absolute Beginners - Permissions, Building the App GUI & Menus
Learn Xamarin Absolute Beginners - Permissions, Building the App GUI & Menus
 
Android tutorial
Android tutorialAndroid tutorial
Android tutorial
 

Viewers also liked

Viewers also liked (6)

Google Android
Google AndroidGoogle Android
Google Android
 
Android ppt
Android pptAndroid ppt
Android ppt
 
Android Application Development
Android Application DevelopmentAndroid Application Development
Android Application Development
 
Android Development: The Basics
Android Development: The BasicsAndroid Development: The Basics
Android Development: The Basics
 
Android ppt
Android pptAndroid ppt
Android ppt
 
Android ppt
Android ppt Android ppt
Android ppt
 

Similar to Android App Development (Basics)

Industrial Training in Android Application
Industrial Training in Android ApplicationIndustrial Training in Android Application
Industrial Training in Android ApplicationArcadian Learning
 
Android Tutorial
Android TutorialAndroid Tutorial
Android TutorialFun2Do Labs
 
Intro To Android App Development
Intro To Android App DevelopmentIntro To Android App Development
Intro To Android App DevelopmentMike Kvintus
 
Android tutorial
Android tutorialAndroid tutorial
Android tutorialEd Zel
 
Android tutorial
Android tutorialAndroid tutorial
Android tutorialkatayoon_bz
 
Introduction to Android Development
Introduction to Android DevelopmentIntroduction to Android Development
Introduction to Android DevelopmentAly Abdelkareem
 
Android Tutorial For Beginners Part-1
Android Tutorial For Beginners Part-1Android Tutorial For Beginners Part-1
Android Tutorial For Beginners Part-1Amit Saxena
 
Android Development project
Android Development projectAndroid Development project
Android Development projectMinhaj Kazi
 
Android For Java Developers
Android For Java DevelopersAndroid For Java Developers
Android For Java DevelopersMike Wolfson
 
Nativa Android Applications development
Nativa Android Applications developmentNativa Android Applications development
Nativa Android Applications developmentAlfredo Morresi
 
Introduction to android
Introduction to androidIntroduction to android
Introduction to androidShrijan Tiwari
 
Android best training-in-mumbai
Android best training-in-mumbaiAndroid best training-in-mumbai
Android best training-in-mumbaivibrantuser
 
What is Android?
What is Android?What is Android?
What is Android?ndalban
 
architecture of android.pptx
architecture of android.pptxarchitecture of android.pptx
architecture of android.pptxallurestore
 

Similar to Android App Development (Basics) (20)

Industrial Training in Android Application
Industrial Training in Android ApplicationIndustrial Training in Android Application
Industrial Training in Android Application
 
Android Tutorial
Android TutorialAndroid Tutorial
Android Tutorial
 
Intro To Android App Development
Intro To Android App DevelopmentIntro To Android App Development
Intro To Android App Development
 
Android
AndroidAndroid
Android
 
Android tutorial
Android tutorialAndroid tutorial
Android tutorial
 
Android tutorial
Android tutorialAndroid tutorial
Android tutorial
 
Android tutorial
Android tutorialAndroid tutorial
Android tutorial
 
Android tutorial
Android tutorialAndroid tutorial
Android tutorial
 
Android tutorial
Android tutorialAndroid tutorial
Android tutorial
 
Android-Tutorial.ppt
Android-Tutorial.pptAndroid-Tutorial.ppt
Android-Tutorial.ppt
 
Introduction to Android Development
Introduction to Android DevelopmentIntroduction to Android Development
Introduction to Android Development
 
Android Tutorial For Beginners Part-1
Android Tutorial For Beginners Part-1Android Tutorial For Beginners Part-1
Android Tutorial For Beginners Part-1
 
Android Development project
Android Development projectAndroid Development project
Android Development project
 
Android For Java Developers
Android For Java DevelopersAndroid For Java Developers
Android For Java Developers
 
Nativa Android Applications development
Nativa Android Applications developmentNativa Android Applications development
Nativa Android Applications development
 
Introduction to android
Introduction to androidIntroduction to android
Introduction to android
 
Android best training-in-mumbai
Android best training-in-mumbaiAndroid best training-in-mumbai
Android best training-in-mumbai
 
What is Android?
What is Android?What is Android?
What is Android?
 
Android Development Basics
Android Development BasicsAndroid Development Basics
Android Development Basics
 
architecture of android.pptx
architecture of android.pptxarchitecture of android.pptx
architecture of android.pptx
 

Recently uploaded

Xen Safety Embedded OSS Summit April 2024 v4.pdf
Xen Safety Embedded OSS Summit April 2024 v4.pdfXen Safety Embedded OSS Summit April 2024 v4.pdf
Xen Safety Embedded OSS Summit April 2024 v4.pdfStefano Stabellini
 
Odoo 14 - eLearning Module In Odoo 14 Enterprise
Odoo 14 - eLearning Module In Odoo 14 EnterpriseOdoo 14 - eLearning Module In Odoo 14 Enterprise
Odoo 14 - eLearning Module In Odoo 14 Enterprisepreethippts
 
Intelligent Home Wi-Fi Solutions | ThinkPalm
Intelligent Home Wi-Fi Solutions | ThinkPalmIntelligent Home Wi-Fi Solutions | ThinkPalm
Intelligent Home Wi-Fi Solutions | ThinkPalmSujith Sukumaran
 
KnowAPIs-UnknownPerf-jaxMainz-2024 (1).pptx
KnowAPIs-UnknownPerf-jaxMainz-2024 (1).pptxKnowAPIs-UnknownPerf-jaxMainz-2024 (1).pptx
KnowAPIs-UnknownPerf-jaxMainz-2024 (1).pptxTier1 app
 
Software Project Health Check: Best Practices and Techniques for Your Product...
Software Project Health Check: Best Practices and Techniques for Your Product...Software Project Health Check: Best Practices and Techniques for Your Product...
Software Project Health Check: Best Practices and Techniques for Your Product...Velvetech LLC
 
React Server Component in Next.js by Hanief Utama
React Server Component in Next.js by Hanief UtamaReact Server Component in Next.js by Hanief Utama
React Server Component in Next.js by Hanief UtamaHanief Utama
 
PREDICTING RIVER WATER QUALITY ppt presentation
PREDICTING  RIVER  WATER QUALITY  ppt presentationPREDICTING  RIVER  WATER QUALITY  ppt presentation
PREDICTING RIVER WATER QUALITY ppt presentationvaddepallysandeep122
 
CRM Contender Series: HubSpot vs. Salesforce
CRM Contender Series: HubSpot vs. SalesforceCRM Contender Series: HubSpot vs. Salesforce
CRM Contender Series: HubSpot vs. SalesforceBrainSell Technologies
 
Recruitment Management Software Benefits (Infographic)
Recruitment Management Software Benefits (Infographic)Recruitment Management Software Benefits (Infographic)
Recruitment Management Software Benefits (Infographic)Hr365.us smith
 
SpotFlow: Tracking Method Calls and States at Runtime
SpotFlow: Tracking Method Calls and States at RuntimeSpotFlow: Tracking Method Calls and States at Runtime
SpotFlow: Tracking Method Calls and States at Runtimeandrehoraa
 
Global Identity Enrolment and Verification Pro Solution - Cizo Technology Ser...
Global Identity Enrolment and Verification Pro Solution - Cizo Technology Ser...Global Identity Enrolment and Verification Pro Solution - Cizo Technology Ser...
Global Identity Enrolment and Verification Pro Solution - Cizo Technology Ser...Cizo Technology Services
 
A healthy diet for your Java application Devoxx France.pdf
A healthy diet for your Java application Devoxx France.pdfA healthy diet for your Java application Devoxx France.pdf
A healthy diet for your Java application Devoxx France.pdfMarharyta Nedzelska
 
Alfresco TTL#157 - Troubleshooting Made Easy: Deciphering Alfresco mTLS Confi...
Alfresco TTL#157 - Troubleshooting Made Easy: Deciphering Alfresco mTLS Confi...Alfresco TTL#157 - Troubleshooting Made Easy: Deciphering Alfresco mTLS Confi...
Alfresco TTL#157 - Troubleshooting Made Easy: Deciphering Alfresco mTLS Confi...Angel Borroy López
 
Ahmed Motair CV April 2024 (Senior SW Developer)
Ahmed Motair CV April 2024 (Senior SW Developer)Ahmed Motair CV April 2024 (Senior SW Developer)
Ahmed Motair CV April 2024 (Senior SW Developer)Ahmed Mater
 
Call Us🔝>༒+91-9711147426⇛Call In girls karol bagh (Delhi)
Call Us🔝>༒+91-9711147426⇛Call In girls karol bagh (Delhi)Call Us🔝>༒+91-9711147426⇛Call In girls karol bagh (Delhi)
Call Us🔝>༒+91-9711147426⇛Call In girls karol bagh (Delhi)jennyeacort
 
What is Fashion PLM and Why Do You Need It
What is Fashion PLM and Why Do You Need ItWhat is Fashion PLM and Why Do You Need It
What is Fashion PLM and Why Do You Need ItWave PLM
 
Unveiling the Future: Sylius 2.0 New Features
Unveiling the Future: Sylius 2.0 New FeaturesUnveiling the Future: Sylius 2.0 New Features
Unveiling the Future: Sylius 2.0 New FeaturesŁukasz Chruściel
 
Building a General PDE Solving Framework with Symbolic-Numeric Scientific Mac...
Building a General PDE Solving Framework with Symbolic-Numeric Scientific Mac...Building a General PDE Solving Framework with Symbolic-Numeric Scientific Mac...
Building a General PDE Solving Framework with Symbolic-Numeric Scientific Mac...stazi3110
 
Taming Distributed Systems: Key Insights from Wix's Large-Scale Experience - ...
Taming Distributed Systems: Key Insights from Wix's Large-Scale Experience - ...Taming Distributed Systems: Key Insights from Wix's Large-Scale Experience - ...
Taming Distributed Systems: Key Insights from Wix's Large-Scale Experience - ...Natan Silnitsky
 

Recently uploaded (20)

Xen Safety Embedded OSS Summit April 2024 v4.pdf
Xen Safety Embedded OSS Summit April 2024 v4.pdfXen Safety Embedded OSS Summit April 2024 v4.pdf
Xen Safety Embedded OSS Summit April 2024 v4.pdf
 
Odoo 14 - eLearning Module In Odoo 14 Enterprise
Odoo 14 - eLearning Module In Odoo 14 EnterpriseOdoo 14 - eLearning Module In Odoo 14 Enterprise
Odoo 14 - eLearning Module In Odoo 14 Enterprise
 
Intelligent Home Wi-Fi Solutions | ThinkPalm
Intelligent Home Wi-Fi Solutions | ThinkPalmIntelligent Home Wi-Fi Solutions | ThinkPalm
Intelligent Home Wi-Fi Solutions | ThinkPalm
 
KnowAPIs-UnknownPerf-jaxMainz-2024 (1).pptx
KnowAPIs-UnknownPerf-jaxMainz-2024 (1).pptxKnowAPIs-UnknownPerf-jaxMainz-2024 (1).pptx
KnowAPIs-UnknownPerf-jaxMainz-2024 (1).pptx
 
Software Project Health Check: Best Practices and Techniques for Your Product...
Software Project Health Check: Best Practices and Techniques for Your Product...Software Project Health Check: Best Practices and Techniques for Your Product...
Software Project Health Check: Best Practices and Techniques for Your Product...
 
React Server Component in Next.js by Hanief Utama
React Server Component in Next.js by Hanief UtamaReact Server Component in Next.js by Hanief Utama
React Server Component in Next.js by Hanief Utama
 
PREDICTING RIVER WATER QUALITY ppt presentation
PREDICTING  RIVER  WATER QUALITY  ppt presentationPREDICTING  RIVER  WATER QUALITY  ppt presentation
PREDICTING RIVER WATER QUALITY ppt presentation
 
CRM Contender Series: HubSpot vs. Salesforce
CRM Contender Series: HubSpot vs. SalesforceCRM Contender Series: HubSpot vs. Salesforce
CRM Contender Series: HubSpot vs. Salesforce
 
Recruitment Management Software Benefits (Infographic)
Recruitment Management Software Benefits (Infographic)Recruitment Management Software Benefits (Infographic)
Recruitment Management Software Benefits (Infographic)
 
SpotFlow: Tracking Method Calls and States at Runtime
SpotFlow: Tracking Method Calls and States at RuntimeSpotFlow: Tracking Method Calls and States at Runtime
SpotFlow: Tracking Method Calls and States at Runtime
 
Global Identity Enrolment and Verification Pro Solution - Cizo Technology Ser...
Global Identity Enrolment and Verification Pro Solution - Cizo Technology Ser...Global Identity Enrolment and Verification Pro Solution - Cizo Technology Ser...
Global Identity Enrolment and Verification Pro Solution - Cizo Technology Ser...
 
A healthy diet for your Java application Devoxx France.pdf
A healthy diet for your Java application Devoxx France.pdfA healthy diet for your Java application Devoxx France.pdf
A healthy diet for your Java application Devoxx France.pdf
 
Alfresco TTL#157 - Troubleshooting Made Easy: Deciphering Alfresco mTLS Confi...
Alfresco TTL#157 - Troubleshooting Made Easy: Deciphering Alfresco mTLS Confi...Alfresco TTL#157 - Troubleshooting Made Easy: Deciphering Alfresco mTLS Confi...
Alfresco TTL#157 - Troubleshooting Made Easy: Deciphering Alfresco mTLS Confi...
 
Ahmed Motair CV April 2024 (Senior SW Developer)
Ahmed Motair CV April 2024 (Senior SW Developer)Ahmed Motair CV April 2024 (Senior SW Developer)
Ahmed Motair CV April 2024 (Senior SW Developer)
 
Advantages of Odoo ERP 17 for Your Business
Advantages of Odoo ERP 17 for Your BusinessAdvantages of Odoo ERP 17 for Your Business
Advantages of Odoo ERP 17 for Your Business
 
Call Us🔝>༒+91-9711147426⇛Call In girls karol bagh (Delhi)
Call Us🔝>༒+91-9711147426⇛Call In girls karol bagh (Delhi)Call Us🔝>༒+91-9711147426⇛Call In girls karol bagh (Delhi)
Call Us🔝>༒+91-9711147426⇛Call In girls karol bagh (Delhi)
 
What is Fashion PLM and Why Do You Need It
What is Fashion PLM and Why Do You Need ItWhat is Fashion PLM and Why Do You Need It
What is Fashion PLM and Why Do You Need It
 
Unveiling the Future: Sylius 2.0 New Features
Unveiling the Future: Sylius 2.0 New FeaturesUnveiling the Future: Sylius 2.0 New Features
Unveiling the Future: Sylius 2.0 New Features
 
Building a General PDE Solving Framework with Symbolic-Numeric Scientific Mac...
Building a General PDE Solving Framework with Symbolic-Numeric Scientific Mac...Building a General PDE Solving Framework with Symbolic-Numeric Scientific Mac...
Building a General PDE Solving Framework with Symbolic-Numeric Scientific Mac...
 
Taming Distributed Systems: Key Insights from Wix's Large-Scale Experience - ...
Taming Distributed Systems: Key Insights from Wix's Large-Scale Experience - ...Taming Distributed Systems: Key Insights from Wix's Large-Scale Experience - ...
Taming Distributed Systems: Key Insights from Wix's Large-Scale Experience - ...
 

Android App Development (Basics)