SlideShare a Scribd company logo
May 2014 
Android Development
Agenda 
• Why mobile development? 
• The good and bad of android 
• How to start with Android Development 
• App Components 
• Types of layouts 
• Input controls 
• UI Thread 
• Notifications
Why mobile development?
Why mobile development?
Why mobile development?
The good and bad of Android 
• Java 
• Open source 
• Google Play Store 
• Various Manufacturers
How to start with Android Development
How to start with Android Development 
• Android apps are written in the Java programming language. 
• The Android SDK tools compile your code into an APK. 
• The Android operating system is a multi-user Linux system in which each app is a different 
user. 
• However, there are ways for an app to share data with other apps and for an app to access 
system services: 
• It's possible to arrange for two apps to share the same Linux user ID. 
• An app can request permission to access device data such as the user's contacts, SMS 
messages, the mountable storage (SD card), camera, Bluetooth, and more. All app 
permissions must be granted by the user at install time.
Android Manifest 
• Describes the components of the application. It names the classes that implement each of 
the components and publishes their capabilities (for example, which Intent messages they 
can handle). These declarations let the Android system know what the components are 
and under what conditions they can be launched. 
• It declares which permissions the application must have in order to access protected parts 
of the API and interact with other applications. 
• It also declares the permissions that others are required to have in order to interact with 
the application's components.
Android development environment
Android Studio 
• Android focused IDE. 
• Powerful code editing (smart editing, code refactoring). 
• Rich layout Editor 
• Lint tool analysis. 
• Color and text preview. 
• Template based wizards.
Native emulator
Genymotion 
• Fast! 
• Easy to install and configure. 
• Control powerful sensors to test 
specialized features on your app.
Demo: Android Studio
App Components 
Activities 
Services 
Content providers 
Broadcast receiver 
Intents 
Views
App Components 
Activities 
Services 
Content providers 
Broadcast receiver 
Intents 
Views
Activities 
• An Activity is an Application component that provides a screen with which users can 
interact. 
• Each activity is given a window in which to draw its user interface. 
• An application usually consists of multiple activities. 
• Typically, one activity in an application is specified as the "main" activity, which is 
presented to the user when launching the application for the first time. 
• Each activity can then start another activity in order to perform different actions. 
• Each time a new activity starts, the previous activity is stopped, but the system preserves 
the activity in a stack (the "back stack").
App Components 
Activities 
Services 
Content providers 
Broadcast receiver 
Intents 
Views
Services 
• A Service is an application component that can perform long-running operations in the 
background and does not provide a user interface. 
• Another application component can start a service and it will continue to run in the 
background even if the user switches to another application. 
• Additionally, a component can bind to a service to interact with it and even perform 
interprocess communication (IPC). For example, a service might handle network 
transactions, play music, perform file I/O, or interact with a content provider, all from the 
background.
App Components 
Activities 
Services 
Content providers 
Broadcast receiver 
Intents 
Views
Content providers 
• A content provider manages a shared set of app data. You can store the data in the file 
system, an SQLite database, on the web, or any other persistent storage location your app 
can access. 
• Through the content provider, other apps can query or even modify the data (if the 
content provider allows it). 
• For example, the Android system provides a content provider that manages the user's 
contact information. As such, any app with the proper permissions can query part of the 
content provider to read and write information about a particular person. 
• Content providers are also useful for reading and writing data that is private to your app 
and not shared.
App Components 
Activities 
Services 
Content providers 
Broadcast receiver 
Intents 
Views
Broadcast receiver 
• 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. 
• Apps can also initiate broadcasts—for example, to let other apps know that some data has 
been downloaded to the device and is available for them to use. 
• Although broadcast receivers don't display a user interface, they may create a status bar 
notification to alert the user when a broadcast event occurs.
App Components 
Activities 
Services 
Content providers 
Broadcast receiver 
Intents 
Views
Intents 
• Intents bind individual components to each other at runtime, whether the component 
belongs to your app or another. 
• For activities and services, an intent defines the action to perform (for example, to "view" 
or "send" something) and may specify the URI of the data to act on (among other things 
that the component being started might need to know). 
• In some cases, you can start an activity to receive a result, in which case, the activity also 
returns the result in an Intent. 
• For broadcast receivers, the intent simply defines the announcement being broadcast.
App Components 
Activities 
Services 
Content providers 
Broadcast receiver 
Intents 
Views
Views 
• 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. 
• Android provides a collection of both View and ViewGroup subclasses that offer you 
common input controls (such as buttons and text fields) and various layout models (such as 
a linear or relative layout).
Input controls 
• Buttons 
• Text Fields 
• Checkboxes 
• Radio Buttons 
• Toggle Buttons 
• Spinners 
• Pickers
Buttons
Text Fields
Checkboxes, Radio buttons, Toggle buttons
Spinners
Demo: Intents
Types of layouts: Common Layouts
Types of layouts: Layouts with an adapter
UI Thread 
● It is in charge of dispatching events to the appropriate user interface widgets, including 
drawing events. 
● Interacts with components from the Android UI toolkit 
● There are simply two rules to Android's single thread model: 
● Do not block the UI thread 
● Do not access the Android UI toolkit from outside the UI thread
AsyncTask 
• onPreExecute: Invoked before the task is executed ideally before doInBackground 
method is called on the UI thread. This method is normally used to setup the task like 
showing progress bar in the UI. 
• doInBackground: Code running for long lasting time should be put in doInBackground 
method. When execute method is called in UI main thread, this method is called with the 
parameters passed. 
• onProgressUpdate: Invoked by calling publishProgress at anytime from doInBackground. 
This method can be used to display any form of progress in the user interface. 
• onPostExecute: Invoked after background computation in doInBackground method 
completes processing. Result of the doInBackground is passed to this method.
UI Thread
Demo: MercadoLibre Search App
Notifications
Notifications
Demo: Notifications
Demo: Play Store
What's next?
What’s next?
Q&A
Ad

More Related Content

What's hot (13)

Android fundamentals and tutorial for beginners
Android fundamentals and tutorial for beginnersAndroid fundamentals and tutorial for beginners
Android fundamentals and tutorial for beginners
Boom Shukla
 
Get an Android tutorial for beginners
Get an Android tutorial for beginnersGet an Android tutorial for beginners
Get an Android tutorial for beginners
JavaTpoint.Com
 
Introduction to Android for Quality Engineers
Introduction to Android for Quality EngineersIntroduction to Android for Quality Engineers
Introduction to Android for Quality Engineers
Ahmed Faidy
 
Android Basics
Android BasicsAndroid Basics
Android Basics
Arvind Sahu
 
Android application-component
Android application-componentAndroid application-component
Android application-component
Ly Haza
 
Android app fundamentals
Android app fundamentalsAndroid app fundamentals
Android app fundamentals
Amr Salman
 
Introduction to android sessions new
Introduction to android   sessions newIntroduction to android   sessions new
Introduction to android sessions new
Joe Jacob
 
Android basics
Android basicsAndroid basics
Android basics
Akhil Kumar
 
Android Development with Eclipse and Xamarin
Android Development with Eclipse and XamarinAndroid Development with Eclipse and Xamarin
Android Development with Eclipse and Xamarin
Sasha Goldshtein
 
Google android os
Google android osGoogle android os
Google android os
Kirti Choudhary
 
Android basics
Android basicsAndroid basics
Android basics
Syed Luqman Quadri
 
First Steps in Android Development with Eclipse and Xamarin
First Steps in Android Development with Eclipse and XamarinFirst Steps in Android Development with Eclipse and Xamarin
First Steps in Android Development with Eclipse and Xamarin
Sasha Goldshtein
 
Android programming basics
Android programming basicsAndroid programming basics
Android programming basics
Egerton University
 
Android fundamentals and tutorial for beginners
Android fundamentals and tutorial for beginnersAndroid fundamentals and tutorial for beginners
Android fundamentals and tutorial for beginners
Boom Shukla
 
Get an Android tutorial for beginners
Get an Android tutorial for beginnersGet an Android tutorial for beginners
Get an Android tutorial for beginners
JavaTpoint.Com
 
Introduction to Android for Quality Engineers
Introduction to Android for Quality EngineersIntroduction to Android for Quality Engineers
Introduction to Android for Quality Engineers
Ahmed Faidy
 
Android application-component
Android application-componentAndroid application-component
Android application-component
Ly Haza
 
Android app fundamentals
Android app fundamentalsAndroid app fundamentals
Android app fundamentals
Amr Salman
 
Introduction to android sessions new
Introduction to android   sessions newIntroduction to android   sessions new
Introduction to android sessions new
Joe Jacob
 
Android Development with Eclipse and Xamarin
Android Development with Eclipse and XamarinAndroid Development with Eclipse and Xamarin
Android Development with Eclipse and Xamarin
Sasha Goldshtein
 
First Steps in Android Development with Eclipse and Xamarin
First Steps in Android Development with Eclipse and XamarinFirst Steps in Android Development with Eclipse and Xamarin
First Steps in Android Development with Eclipse and Xamarin
Sasha Goldshtein
 

Similar to Android Development Tutorial (20)

Basics 4
Basics   4Basics   4
Basics 4
Michael Shrove
 
01. Introduction to Android_lecture1.pptx
01. Introduction to Android_lecture1.pptx01. Introduction to Android_lecture1.pptx
01. Introduction to Android_lecture1.pptx
anychowdhury2
 
Android architecture
Android architectureAndroid architecture
Android architecture
Deepa Rahul
 
Mobile application development
Mobile application developmentMobile application development
Mobile application development
umesh patil
 
Android Mobile App Development basics PPT
Android Mobile App Development basics PPTAndroid Mobile App Development basics PPT
Android Mobile App Development basics PPT
nithya697634
 
Module - Programming with android course.ppt
Module - Programming with android course.pptModule - Programming with android course.ppt
Module - Programming with android course.ppt
demowork2
 
android development training in mumbai
android development training in mumbaiandroid development training in mumbai
android development training in mumbai
faizrashid1995
 
Lecture 1 Android Application Development.ppt
Lecture 1 Android Application Development.pptLecture 1 Android Application Development.ppt
Lecture 1 Android Application Development.ppt
hillarykiprono4
 
Mobile testing android
Mobile testing   androidMobile testing   android
Mobile testing android
Basant Dewangan
 
App Fundamentals and Activity life cycle.pptx
App Fundamentals and Activity life cycle.pptxApp Fundamentals and Activity life cycle.pptx
App Fundamentals and Activity life cycle.pptx
ridzah12
 
Synapseindia android apps overview
Synapseindia android apps overviewSynapseindia android apps overview
Synapseindia android apps overview
Synapseindiappsdevelopment
 
Android Workshop Part 1
Android Workshop Part 1Android Workshop Part 1
Android Workshop Part 1
NAILBITER
 
Android Penetration Testing - Day 1
Android Penetration Testing - Day 1Android Penetration Testing - Day 1
Android Penetration Testing - Day 1
Mohammed Adam
 
Android development first steps
Android development   first stepsAndroid development   first steps
Android development first steps
christoforosnalmpantis
 
Embedded Systems.pdf
Embedded Systems.pdfEmbedded Systems.pdf
Embedded Systems.pdf
ruvabebe
 
Intro to android (gdays)
Intro to android (gdays)Intro to android (gdays)
Intro to android (gdays)
Omolara Adejuwon
 
Data Transfer between Activities & Databases
Data Transfer between Activities & DatabasesData Transfer between Activities & Databases
Data Transfer between Activities & Databases
Muhammad Sajid
 
Android OS and its Features
Android OS and its FeaturesAndroid OS and its Features
Android OS and its Features
Harshad Lokhande
 
Android development orientation for starters v2
Android development orientation for starters v2Android development orientation for starters v2
Android development orientation for starters v2
Joemarie Amparo
 
Session 3 beccse
Session 3 beccseSession 3 beccse
Session 3 beccse
vin123456gangal
 
01. Introduction to Android_lecture1.pptx
01. Introduction to Android_lecture1.pptx01. Introduction to Android_lecture1.pptx
01. Introduction to Android_lecture1.pptx
anychowdhury2
 
Android architecture
Android architectureAndroid architecture
Android architecture
Deepa Rahul
 
Mobile application development
Mobile application developmentMobile application development
Mobile application development
umesh patil
 
Android Mobile App Development basics PPT
Android Mobile App Development basics PPTAndroid Mobile App Development basics PPT
Android Mobile App Development basics PPT
nithya697634
 
Module - Programming with android course.ppt
Module - Programming with android course.pptModule - Programming with android course.ppt
Module - Programming with android course.ppt
demowork2
 
android development training in mumbai
android development training in mumbaiandroid development training in mumbai
android development training in mumbai
faizrashid1995
 
Lecture 1 Android Application Development.ppt
Lecture 1 Android Application Development.pptLecture 1 Android Application Development.ppt
Lecture 1 Android Application Development.ppt
hillarykiprono4
 
App Fundamentals and Activity life cycle.pptx
App Fundamentals and Activity life cycle.pptxApp Fundamentals and Activity life cycle.pptx
App Fundamentals and Activity life cycle.pptx
ridzah12
 
Android Workshop Part 1
Android Workshop Part 1Android Workshop Part 1
Android Workshop Part 1
NAILBITER
 
Android Penetration Testing - Day 1
Android Penetration Testing - Day 1Android Penetration Testing - Day 1
Android Penetration Testing - Day 1
Mohammed Adam
 
Embedded Systems.pdf
Embedded Systems.pdfEmbedded Systems.pdf
Embedded Systems.pdf
ruvabebe
 
Data Transfer between Activities & Databases
Data Transfer between Activities & DatabasesData Transfer between Activities & Databases
Data Transfer between Activities & Databases
Muhammad Sajid
 
Android OS and its Features
Android OS and its FeaturesAndroid OS and its Features
Android OS and its Features
Harshad Lokhande
 
Android development orientation for starters v2
Android development orientation for starters v2Android development orientation for starters v2
Android development orientation for starters v2
Joemarie Amparo
 
Ad

Android Development Tutorial

  • 1. May 2014 Android Development
  • 2. Agenda • Why mobile development? • The good and bad of android • How to start with Android Development • App Components • Types of layouts • Input controls • UI Thread • Notifications
  • 6. The good and bad of Android • Java • Open source • Google Play Store • Various Manufacturers
  • 7. How to start with Android Development
  • 8. How to start with Android Development • Android apps are written in the Java programming language. • The Android SDK tools compile your code into an APK. • The Android operating system is a multi-user Linux system in which each app is a different user. • However, there are ways for an app to share data with other apps and for an app to access system services: • It's possible to arrange for two apps to share the same Linux user ID. • An app can request permission to access device data such as the user's contacts, SMS messages, the mountable storage (SD card), camera, Bluetooth, and more. All app permissions must be granted by the user at install time.
  • 9. Android Manifest • Describes the components of the application. It names the classes that implement each of the components and publishes their capabilities (for example, which Intent messages they can handle). These declarations let the Android system know what the components are and under what conditions they can be launched. • It declares which permissions the application must have in order to access protected parts of the API and interact with other applications. • It also declares the permissions that others are required to have in order to interact with the application's components.
  • 11. Android Studio • Android focused IDE. • Powerful code editing (smart editing, code refactoring). • Rich layout Editor • Lint tool analysis. • Color and text preview. • Template based wizards.
  • 13. Genymotion • Fast! • Easy to install and configure. • Control powerful sensors to test specialized features on your app.
  • 15. App Components Activities Services Content providers Broadcast receiver Intents Views
  • 16. App Components Activities Services Content providers Broadcast receiver Intents Views
  • 17. Activities • An Activity is an Application component that provides a screen with which users can interact. • Each activity is given a window in which to draw its user interface. • An application usually consists of multiple activities. • Typically, one activity in an application is specified as the "main" activity, which is presented to the user when launching the application for the first time. • Each activity can then start another activity in order to perform different actions. • Each time a new activity starts, the previous activity is stopped, but the system preserves the activity in a stack (the "back stack").
  • 18. App Components Activities Services Content providers Broadcast receiver Intents Views
  • 19. Services • A Service is an application component that can perform long-running operations in the background and does not provide a user interface. • Another application component can start a service and it will continue to run in the background even if the user switches to another application. • Additionally, a component can bind to a service to interact with it and even perform interprocess communication (IPC). For example, a service might handle network transactions, play music, perform file I/O, or interact with a content provider, all from the background.
  • 20. App Components Activities Services Content providers Broadcast receiver Intents Views
  • 21. Content providers • A content provider manages a shared set of app data. You can store the data in the file system, an SQLite database, on the web, or any other persistent storage location your app can access. • Through the content provider, other apps can query or even modify the data (if the content provider allows it). • For example, the Android system provides a content provider that manages the user's contact information. As such, any app with the proper permissions can query part of the content provider to read and write information about a particular person. • Content providers are also useful for reading and writing data that is private to your app and not shared.
  • 22. App Components Activities Services Content providers Broadcast receiver Intents Views
  • 23. Broadcast receiver • 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. • Apps can also initiate broadcasts—for example, to let other apps know that some data has been downloaded to the device and is available for them to use. • Although broadcast receivers don't display a user interface, they may create a status bar notification to alert the user when a broadcast event occurs.
  • 24. App Components Activities Services Content providers Broadcast receiver Intents Views
  • 25. Intents • Intents bind individual components to each other at runtime, whether the component belongs to your app or another. • For activities and services, an intent defines the action to perform (for example, to "view" or "send" something) and may specify the URI of the data to act on (among other things that the component being started might need to know). • In some cases, you can start an activity to receive a result, in which case, the activity also returns the result in an Intent. • For broadcast receivers, the intent simply defines the announcement being broadcast.
  • 26. App Components Activities Services Content providers Broadcast receiver Intents Views
  • 27. Views • 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. • Android provides a collection of both View and ViewGroup subclasses that offer you common input controls (such as buttons and text fields) and various layout models (such as a linear or relative layout).
  • 28. Input controls • Buttons • Text Fields • Checkboxes • Radio Buttons • Toggle Buttons • Spinners • Pickers
  • 31. Checkboxes, Radio buttons, Toggle buttons
  • 34. Types of layouts: Common Layouts
  • 35. Types of layouts: Layouts with an adapter
  • 36. UI Thread ● It is in charge of dispatching events to the appropriate user interface widgets, including drawing events. ● Interacts with components from the Android UI toolkit ● There are simply two rules to Android's single thread model: ● Do not block the UI thread ● Do not access the Android UI toolkit from outside the UI thread
  • 37. AsyncTask • onPreExecute: Invoked before the task is executed ideally before doInBackground method is called on the UI thread. This method is normally used to setup the task like showing progress bar in the UI. • doInBackground: Code running for long lasting time should be put in doInBackground method. When execute method is called in UI main thread, this method is called with the parameters passed. • onProgressUpdate: Invoked by calling publishProgress at anytime from doInBackground. This method can be used to display any form of progress in the user interface. • onPostExecute: Invoked after background computation in doInBackground method completes processing. Result of the doInBackground is passed to this method.
  • 46. Q&A