SlideShare una empresa de Scribd logo
1 de 27
V UgiALT.Net Conference Native Android applications development (Alfredo Morresi - rainbowbreeze.it)
Who am I 31 years old happy software developer Mobile addicted GNU/Linux fashinated Tiramisu' lover rainbowbreeze
Topics What is Android Setup the environment Android basics Hands on Goodies
What is Android Android  is a software stack for mobile devices that includes an operating system, middleware and key applications . Based on the Linux kernel, developed by the  Open Handset Alliance . The Open Handset Alliance is a group of 65 technology and mobile companies who have come together to accelerate innovation in mobile and offer consumers a richer, less expensive, and better mobile experience. We are committed to commercially deploy handsets and services using the Android Platform.
Android architecture
Android languages Java Java 1.5 specs, run on the Dalvik virtual machine. Every Android application runs in its own process, with its own instance of the Dalvik virtual machine. Dalvik has been written so that a device can run multiple VMs efficiently. The Dalvik VM executes files in the Dalvik Executable (.dex) format which is optimized for minimal memory footprint. C, C++ Android Native Development Kit (NDK) which will allow developers to build Android software components with C and C++.
Android libraries Android includes a set of C/C++ libraries used by various components of the Android system. These capabilities are exposed to developers through the Android application framework. System C library : BSD-derived impl. of the standard C system library libc Media Libraries : based on PacketVideo's OpenCORE (MPEG4, H.264, MP3) LibWebCore : web browser eng. (Android browser, embeddable webview) 3D libraries :  implementation based on OpenGL ES 1.0 FreeType : bitmap and vector font rendering SQLite : lightweight relational database engine
Setup the environment Download and install the SDK starter package (adb, android, emulator) Install the ADT Plugin for Eclipse or Install Android plugin for NetBeans  or Use the force, Luke! Add Android platforms and docs to your SDK (with Android SDK and AVD Manager) Summon your first activity!
Application components Activities An activity presents a visual user interface for one focused endeavor the user can undertake. For example, an activity might present a list of menu items users can choose from or it might display photographs along with their captions. A text messaging application might have one activity that shows a list of contacts to send messages to, a second activity to write the message to the chosen contact, and other activities to review old messages or change settings. Though they work together to form a cohesive user interface, each activity is independent of the others. Each one is implemented as a subclass of the  Activity base class .
Application components Typically, one of the activities is marked as the first one that should be presented to the user when the application is launched.  Moving  from one activity to another is accomplished by having  the current activity start the next one . The visual content of the window is provided by a  hierarchy of views  — objects derived from the base View class. Each view controls a particular rectangular space within the window. Parent views contain and organize the layout of their children. Leaf views draw in the rectangles they control and respond to user actions directed at that space. Thus, views are where the activity's interaction with the user takes place. Android has a number of  ready-made views  that you can use — including buttons, text fields, scroll bars, menu items, check boxes, and more.
Application components Services A service doesn't have a visual user interface, but rather  runs in the background  for an indefinite period of time. Each service extends the  Service base class . For example, a service might play background music as the user attends to other matters, or it might fetch data over the network or calculate something and provide the result to activities that need it. A player application would probably have one or more activities that allow the user to choose songs and start playing them. However, the music playback itself would not be handled by an activity because users will expect the music to keep playing even after they leave the player and begin something different. To keep the music going, the media player activity could start a service to run in the background.
Application components It's possible to connect to an ongoing service (and start the service if it's not already running). While connected, you can communicate with the service through an interface that the service exposes. For the music service, this interface might allow users to pause, rewind, stop, and restart the playback. Like activities and the other components, services run in the main thread of the application process. So that they won't block other components or the user interface, they often spawn another thread for time-consuming tasks (like music playback).
Application components Broadcast receivers A broadcast receiver is a component that does nothing but receive and react to broadcast announcements. Many broadcasts originate in system code — for example, announcements that the timezone has changed, that the battery is low, that a picture has been taken, or that the user changed a language preference. Applications can also initiate broadcasts — for example, to let other applications know that some data has been downloaded to the device and is available for them to use. An application can have any number of broadcast receivers to respond to any announcements it considers important. All receivers extend the  BroadcastReceiver base class .
Application components Broadcast receivers do not display a user interface. However, they may start an activity in response to the information they receive, or they may use the NotificationManager to alert the user. Notifications can get the user's attention in various ways — flashing the backlight, vibrating the device, playing a sound, and so on. They typically place a persistent icon in the status bar, which users can open to get the message.
Application components Content providers A content provider makes a specific set of the application's  data available  to other applications. The data can be stored in the file system, in an SQLite database, or in any other manner that makes sense. The content provider extends the  ContentProvider base class  to implement a standard set of methods that enable other applications to retrieve and store data of the type it controls. However, applications do not call these methods directly. Rather they use a ContentResolver object and call its methods instead. A ContentResolver can talk to any content provider; it cooperates with the provider to manage any interprocess communication that's involved.
Application fundamentals AndroidManifest.xml Before Android can start an application component, it must learn that the component exists. Therefore, applications declare their components in a manifest file that's bundled into the Android package, the  .apk file  that also holds the application's code, files, and resources. The manifest is a structured XML file and is always named AndroidManifest.xml for all applications. It does a number of things in addition to declaring the application's components, such as naming any libraries the application needs to be linked against (besides the default Android library) and identifying any permissions the application expects to be granted.
Application fundamentals Intents Content providers are activated when they're targeted by a request from a ContentResolver. The other three components - activities, services, and broadcast receivers - are activated by asynchronous messages called intents. An intent is an Intent object that holds the content of the message.  For activities and services, it names the action being requested and specifies the URI of the data to act on, among other things. For example, it might convey a request for an activity to present an image to the user or let the user edit some text. Activity-related intents vs System-wide intents.
Application fundamentals Intent filters An Intent object can explicitly name a target component. If it does, Android finds that component (based on the declarations in the manifest file) and activates it. But if a target is not explicitly named, Android must locate the best component to respond to the intent. It does so by comparing the Intent object to the intent filters of potential targets. A component's intent filters inform Android of the kinds of intents the component is able to handle. Like other essential information about the component, they're declared in the manifest file.
Activity lifecycle
Mobile goodies Localization Combine country code, language, screen orientation, screen density, platform API level, screen size... Available for layouts, values, menu, animations... all kind of xml. http://developer.android.com/resources/tutorials/localization/index.html
Mobile goodies Layout helpers: hierarchyviewer
Mobile goodies Draw 9-patch
Mobile goodies Advanced Views
Mobile goodies Testing Mocking, Junit, AndroidTestCase, Interface test, Stress test ( http://dtmilano.blogspot.com/search/label/test%20driven%20development ) Continuous Integration Maven
Android – personal conclusion Pros Development is truly multiplatform  (Win, Mac, Lin) Free Software  (Apache 2.0 + GPLv2 license) Portability across current and future hardware Component based architecture that can be extended It's Java 1.5 Lot of mobile goodies 25 $/year market subscription, 70-30 revenue
Android – personal conclusion Cons APIs not so stable Some iPhone APIs are too cool! (double screen)
Happy developing ;) Thank you!

Más contenido relacionado

La actualidad más candente

Os eclipse-androidwidget-pdf
Os eclipse-androidwidget-pdfOs eclipse-androidwidget-pdf
Os eclipse-androidwidget-pdf
weerabahu
 
Basic android development
Basic android developmentBasic android development
Basic android development
Upanya Singh
 
Android Development in a Nutshell
Android Development in a NutshellAndroid Development in a Nutshell
Android Development in a Nutshell
Aleix Solé
 
Android before getting started
Android before getting startedAndroid before getting started
Android before getting started
Ahsanul Karim
 
Android basic principles
Android basic principlesAndroid basic principles
Android basic principles
Henk Laracker
 
android-tutorial-for-beginner
android-tutorial-for-beginnerandroid-tutorial-for-beginner
android-tutorial-for-beginner
Ajailal Parackal
 

La actualidad más candente (20)

Introduction to Android for Quality Engineers
Introduction to Android for Quality EngineersIntroduction to Android for Quality Engineers
Introduction to Android for Quality Engineers
 
Android basics
Android basicsAndroid basics
Android basics
 
Basic of Android App Development
Basic of Android App DevelopmentBasic of Android App Development
Basic of Android App Development
 
Android basics
Android basicsAndroid basics
Android basics
 
Os eclipse-androidwidget-pdf
Os eclipse-androidwidget-pdfOs eclipse-androidwidget-pdf
Os eclipse-androidwidget-pdf
 
Android App Development (Basics)
Android App Development (Basics)Android App Development (Basics)
Android App Development (Basics)
 
Intro To Android App Development
Intro To Android App DevelopmentIntro To Android App Development
Intro To Android App Development
 
Basic android development
Basic android developmentBasic android development
Basic android development
 
Android Basic- CMC
Android Basic- CMCAndroid Basic- CMC
Android Basic- CMC
 
Android Study Jam 2
Android Study Jam 2Android Study Jam 2
Android Study Jam 2
 
Synopsis on android application
Synopsis on android applicationSynopsis on android application
Synopsis on android application
 
Android Development in a Nutshell
Android Development in a NutshellAndroid Development in a Nutshell
Android Development in a Nutshell
 
Android before getting started
Android before getting startedAndroid before getting started
Android before getting started
 
Android programming basics
Android programming basicsAndroid programming basics
Android programming basics
 
AndroidManifest
AndroidManifestAndroidManifest
AndroidManifest
 
Mobile Application Guideline | Mobile App Development Company
Mobile Application Guideline | Mobile App Development Company Mobile Application Guideline | Mobile App Development Company
Mobile Application Guideline | Mobile App Development Company
 
B041130610
B041130610B041130610
B041130610
 
Android basic principles
Android basic principlesAndroid basic principles
Android basic principles
 
android-tutorial-for-beginner
android-tutorial-for-beginnerandroid-tutorial-for-beginner
android-tutorial-for-beginner
 
Android Development: Build Android App from Scratch
Android Development: Build Android App from ScratchAndroid Development: Build Android App from Scratch
Android Development: Build Android App from Scratch
 

Destacado

Testing in Android: automatici, di integrazione, TDD e scenari avanzati
Testing in Android: automatici, di integrazione, TDD e scenari avanzatiTesting in Android: automatici, di integrazione, TDD e scenari avanzati
Testing in Android: automatici, di integrazione, TDD e scenari avanzati
Alfredo Morresi
 

Destacado (9)

(in)Sicurezze delle reti wireless 802.11b
(in)Sicurezze delle reti wireless 802.11b(in)Sicurezze delle reti wireless 802.11b
(in)Sicurezze delle reti wireless 802.11b
 
2(.0) passi nel mondo mobile - Alfredo Morresi
2(.0) passi nel mondo mobile - Alfredo Morresi2(.0) passi nel mondo mobile - Alfredo Morresi
2(.0) passi nel mondo mobile - Alfredo Morresi
 
BlueSecurity: quando il dente fa male!
BlueSecurity: quando il dente fa male!BlueSecurity: quando il dente fa male!
BlueSecurity: quando il dente fa male!
 
Testing in Android: automatici, di integrazione, TDD e scenari avanzati
Testing in Android: automatici, di integrazione, TDD e scenari avanzatiTesting in Android: automatici, di integrazione, TDD e scenari avanzati
Testing in Android: automatici, di integrazione, TDD e scenari avanzati
 
Mobile platforms development overview
Mobile platforms development overviewMobile platforms development overview
Mobile platforms development overview
 
Jugendliche Im Web 20
Jugendliche Im Web 20Jugendliche Im Web 20
Jugendliche Im Web 20
 
Android Survival Guide - Two years of software development
Android Survival Guide - Two years of software developmentAndroid Survival Guide - Two years of software development
Android Survival Guide - Two years of software development
 
Advanced Android Development
Advanced Android DevelopmentAdvanced Android Development
Advanced Android Development
 
Slightly Advanced Android Wear ;)
Slightly Advanced Android Wear ;)Slightly Advanced Android Wear ;)
Slightly Advanced Android Wear ;)
 

Similar a Nativa Android Applications development

Mobile Application Development Lecture 05 & 06.pdf
Mobile Application Development Lecture 05 & 06.pdfMobile Application Development Lecture 05 & 06.pdf
Mobile Application Development Lecture 05 & 06.pdf
AbdullahMunir32
 

Similar a Nativa Android Applications development (20)

Mobile Application Development Lecture 05 & 06.pdf
Mobile Application Development Lecture 05 & 06.pdfMobile Application Development Lecture 05 & 06.pdf
Mobile Application Development Lecture 05 & 06.pdf
 
Android beginners David
Android beginners DavidAndroid beginners David
Android beginners David
 
Android Introduction by Kajal
Android Introduction by KajalAndroid Introduction by Kajal
Android Introduction by Kajal
 
Android Development Basics
Android Development BasicsAndroid Development Basics
Android Development Basics
 
Android In A Nutshell
Android In A NutshellAndroid In A Nutshell
Android In A Nutshell
 
5 beginner android application development foundation
5 beginner android application development foundation5 beginner android application development foundation
5 beginner android application development foundation
 
Android 1-intro n architecture
Android 1-intro n architectureAndroid 1-intro n architecture
Android 1-intro n architecture
 
Android terminologies
Android terminologiesAndroid terminologies
Android terminologies
 
architecture of android.pptx
architecture of android.pptxarchitecture of android.pptx
architecture of android.pptx
 
Android app fundamentals
Android app fundamentalsAndroid app fundamentals
Android app fundamentals
 
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 101 Session @thejunction32
Android 101 Session @thejunction32Android 101 Session @thejunction32
Android 101 Session @thejunction32
 
PPT Companion to Android
PPT Companion to AndroidPPT Companion to Android
PPT Companion to Android
 
"Android" mobilių programėlių kūrimo įvadas #2
"Android" mobilių programėlių kūrimo įvadas #2"Android" mobilių programėlių kūrimo įvadas #2
"Android" mobilių programėlių kūrimo įvadas #2
 
Android overview
Android overviewAndroid overview
Android overview
 
Introduction to android
Introduction to androidIntroduction to android
Introduction to android
 
Android Application Components with Implementation & Examples
Android Application Components with Implementation & ExamplesAndroid Application Components with Implementation & Examples
Android Application Components with Implementation & Examples
 
Mobile Application Development With Android
Mobile Application Development With AndroidMobile Application Development With Android
Mobile Application Development With Android
 
Aptech Apps
Aptech Apps Aptech Apps
Aptech Apps
 

Último

Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Safe Software
 
Architecting Cloud Native Applications
Architecting Cloud Native ApplicationsArchitecting Cloud Native Applications
Architecting Cloud Native Applications
WSO2
 

Último (20)

Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...
Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...
Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...
 
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost SavingRepurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
 
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
 
Introduction to use of FHIR Documents in ABDM
Introduction to use of FHIR Documents in ABDMIntroduction to use of FHIR Documents in ABDM
Introduction to use of FHIR Documents in ABDM
 
"I see eyes in my soup": How Delivery Hero implemented the safety system for ...
"I see eyes in my soup": How Delivery Hero implemented the safety system for ..."I see eyes in my soup": How Delivery Hero implemented the safety system for ...
"I see eyes in my soup": How Delivery Hero implemented the safety system for ...
 
JohnPollard-hybrid-app-RailsConf2024.pptx
JohnPollard-hybrid-app-RailsConf2024.pptxJohnPollard-hybrid-app-RailsConf2024.pptx
JohnPollard-hybrid-app-RailsConf2024.pptx
 
AWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of TerraformAWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of Terraform
 
AI+A11Y 11MAY2024 HYDERBAD GAAD 2024 - HelloA11Y (11 May 2024)
AI+A11Y 11MAY2024 HYDERBAD GAAD 2024 - HelloA11Y (11 May 2024)AI+A11Y 11MAY2024 HYDERBAD GAAD 2024 - HelloA11Y (11 May 2024)
AI+A11Y 11MAY2024 HYDERBAD GAAD 2024 - HelloA11Y (11 May 2024)
 
CNIC Information System with Pakdata Cf In Pakistan
CNIC Information System with Pakdata Cf In PakistanCNIC Information System with Pakdata Cf In Pakistan
CNIC Information System with Pakdata Cf In Pakistan
 
Architecting Cloud Native Applications
Architecting Cloud Native ApplicationsArchitecting Cloud Native Applications
Architecting Cloud Native Applications
 
FWD Group - Insurer Innovation Award 2024
FWD Group - Insurer Innovation Award 2024FWD Group - Insurer Innovation Award 2024
FWD Group - Insurer Innovation Award 2024
 
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot TakeoffStrategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
 
TrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data DiscoveryTrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
 
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, AdobeApidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
 
ICT role in 21st century education and its challenges
ICT role in 21st century education and its challengesICT role in 21st century education and its challenges
ICT role in 21st century education and its challenges
 
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
 
DEV meet-up UiPath Document Understanding May 7 2024 Amsterdam
DEV meet-up UiPath Document Understanding May 7 2024 AmsterdamDEV meet-up UiPath Document Understanding May 7 2024 Amsterdam
DEV meet-up UiPath Document Understanding May 7 2024 Amsterdam
 
AI in Action: Real World Use Cases by Anitaraj
AI in Action: Real World Use Cases by AnitarajAI in Action: Real World Use Cases by Anitaraj
AI in Action: Real World Use Cases by Anitaraj
 
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
 
Mcleodganj Call Girls 🥰 8617370543 Service Offer VIP Hot Model
Mcleodganj Call Girls 🥰 8617370543 Service Offer VIP Hot ModelMcleodganj Call Girls 🥰 8617370543 Service Offer VIP Hot Model
Mcleodganj Call Girls 🥰 8617370543 Service Offer VIP Hot Model
 

Nativa Android Applications development

  • 1. V UgiALT.Net Conference Native Android applications development (Alfredo Morresi - rainbowbreeze.it)
  • 2. Who am I 31 years old happy software developer Mobile addicted GNU/Linux fashinated Tiramisu' lover rainbowbreeze
  • 3. Topics What is Android Setup the environment Android basics Hands on Goodies
  • 4. What is Android Android is a software stack for mobile devices that includes an operating system, middleware and key applications . Based on the Linux kernel, developed by the Open Handset Alliance . The Open Handset Alliance is a group of 65 technology and mobile companies who have come together to accelerate innovation in mobile and offer consumers a richer, less expensive, and better mobile experience. We are committed to commercially deploy handsets and services using the Android Platform.
  • 6. Android languages Java Java 1.5 specs, run on the Dalvik virtual machine. Every Android application runs in its own process, with its own instance of the Dalvik virtual machine. Dalvik has been written so that a device can run multiple VMs efficiently. The Dalvik VM executes files in the Dalvik Executable (.dex) format which is optimized for minimal memory footprint. C, C++ Android Native Development Kit (NDK) which will allow developers to build Android software components with C and C++.
  • 7. Android libraries Android includes a set of C/C++ libraries used by various components of the Android system. These capabilities are exposed to developers through the Android application framework. System C library : BSD-derived impl. of the standard C system library libc Media Libraries : based on PacketVideo's OpenCORE (MPEG4, H.264, MP3) LibWebCore : web browser eng. (Android browser, embeddable webview) 3D libraries : implementation based on OpenGL ES 1.0 FreeType : bitmap and vector font rendering SQLite : lightweight relational database engine
  • 8. Setup the environment Download and install the SDK starter package (adb, android, emulator) Install the ADT Plugin for Eclipse or Install Android plugin for NetBeans or Use the force, Luke! Add Android platforms and docs to your SDK (with Android SDK and AVD Manager) Summon your first activity!
  • 9. Application components Activities An activity presents a visual user interface for one focused endeavor the user can undertake. For example, an activity might present a list of menu items users can choose from or it might display photographs along with their captions. A text messaging application might have one activity that shows a list of contacts to send messages to, a second activity to write the message to the chosen contact, and other activities to review old messages or change settings. Though they work together to form a cohesive user interface, each activity is independent of the others. Each one is implemented as a subclass of the Activity base class .
  • 10. Application components Typically, one of the activities is marked as the first one that should be presented to the user when the application is launched. Moving from one activity to another is accomplished by having the current activity start the next one . The visual content of the window is provided by a hierarchy of views — objects derived from the base View class. Each view controls a particular rectangular space within the window. Parent views contain and organize the layout of their children. Leaf views draw in the rectangles they control and respond to user actions directed at that space. Thus, views are where the activity's interaction with the user takes place. Android has a number of ready-made views that you can use — including buttons, text fields, scroll bars, menu items, check boxes, and more.
  • 11. Application components Services A service doesn't have a visual user interface, but rather runs in the background for an indefinite period of time. Each service extends the Service base class . For example, a service might play background music as the user attends to other matters, or it might fetch data over the network or calculate something and provide the result to activities that need it. A player application would probably have one or more activities that allow the user to choose songs and start playing them. However, the music playback itself would not be handled by an activity because users will expect the music to keep playing even after they leave the player and begin something different. To keep the music going, the media player activity could start a service to run in the background.
  • 12. Application components It's possible to connect to an ongoing service (and start the service if it's not already running). While connected, you can communicate with the service through an interface that the service exposes. For the music service, this interface might allow users to pause, rewind, stop, and restart the playback. Like activities and the other components, services run in the main thread of the application process. So that they won't block other components or the user interface, they often spawn another thread for time-consuming tasks (like music playback).
  • 13. Application components Broadcast receivers A broadcast receiver is a component that does nothing but receive and react to broadcast announcements. Many broadcasts originate in system code — for example, announcements that the timezone has changed, that the battery is low, that a picture has been taken, or that the user changed a language preference. Applications can also initiate broadcasts — for example, to let other applications know that some data has been downloaded to the device and is available for them to use. An application can have any number of broadcast receivers to respond to any announcements it considers important. All receivers extend the BroadcastReceiver base class .
  • 14. Application components Broadcast receivers do not display a user interface. However, they may start an activity in response to the information they receive, or they may use the NotificationManager to alert the user. Notifications can get the user's attention in various ways — flashing the backlight, vibrating the device, playing a sound, and so on. They typically place a persistent icon in the status bar, which users can open to get the message.
  • 15. Application components Content providers A content provider makes a specific set of the application's data available to other applications. The data can be stored in the file system, in an SQLite database, or in any other manner that makes sense. The content provider extends the ContentProvider base class to implement a standard set of methods that enable other applications to retrieve and store data of the type it controls. However, applications do not call these methods directly. Rather they use a ContentResolver object and call its methods instead. A ContentResolver can talk to any content provider; it cooperates with the provider to manage any interprocess communication that's involved.
  • 16. Application fundamentals AndroidManifest.xml Before Android can start an application component, it must learn that the component exists. Therefore, applications declare their components in a manifest file that's bundled into the Android package, the .apk file that also holds the application's code, files, and resources. The manifest is a structured XML file and is always named AndroidManifest.xml for all applications. It does a number of things in addition to declaring the application's components, such as naming any libraries the application needs to be linked against (besides the default Android library) and identifying any permissions the application expects to be granted.
  • 17. Application fundamentals Intents Content providers are activated when they're targeted by a request from a ContentResolver. The other three components - activities, services, and broadcast receivers - are activated by asynchronous messages called intents. An intent is an Intent object that holds the content of the message. For activities and services, it names the action being requested and specifies the URI of the data to act on, among other things. For example, it might convey a request for an activity to present an image to the user or let the user edit some text. Activity-related intents vs System-wide intents.
  • 18. Application fundamentals Intent filters An Intent object can explicitly name a target component. If it does, Android finds that component (based on the declarations in the manifest file) and activates it. But if a target is not explicitly named, Android must locate the best component to respond to the intent. It does so by comparing the Intent object to the intent filters of potential targets. A component's intent filters inform Android of the kinds of intents the component is able to handle. Like other essential information about the component, they're declared in the manifest file.
  • 20. Mobile goodies Localization Combine country code, language, screen orientation, screen density, platform API level, screen size... Available for layouts, values, menu, animations... all kind of xml. http://developer.android.com/resources/tutorials/localization/index.html
  • 21. Mobile goodies Layout helpers: hierarchyviewer
  • 24. Mobile goodies Testing Mocking, Junit, AndroidTestCase, Interface test, Stress test ( http://dtmilano.blogspot.com/search/label/test%20driven%20development ) Continuous Integration Maven
  • 25. Android – personal conclusion Pros Development is truly multiplatform (Win, Mac, Lin) Free Software (Apache 2.0 + GPLv2 license) Portability across current and future hardware Component based architecture that can be extended It's Java 1.5 Lot of mobile goodies 25 $/year market subscription, 70-30 revenue
  • 26. Android – personal conclusion Cons APIs not so stable Some iPhone APIs are too cool! (double screen)
  • 27. Happy developing ;) Thank you!