Android Introduction
Before we begin
In order to learn Android you must have some Basic knowledge Java.
Java: prerequisites for android development
 OOPS – Abstraction, Encapsulation, Polymorphism and Inheritance
 Tokens – Primitive data types, variables, constants, keywords such as
static, final, try, catch, etc.
 Type Casting and Visibility
 Arrays and Operators
 Control Statements
Before we begin
 Class Fundamentals – Inner and Anonymous Classes
 Inheritance, Interface, Package
 Multithreading and Exception Handling
 Java Annotations and IO
 Generics and Collections
Before we begin
Tools to use :
Android Studio
Android phone
Quiz Time  1/7
Sharing of common information is achieved by the concept of ?
a. polymorphism
b. encapsulation
c. inheritance
d. none of above
Quiz Time  2/7
Which constructs an anonymous inner class instance?
a. Runnable r = new Runnable() { };
b. Runnable r = new Runnable(public void run() { });
c. Runnable r = new Runnable { public void run(){}};
d. System.out.println(new Runnable() {public void run() { }});
Quiz Time  3/7
You want subclasses in any package to have access to members of a
superclass. Which is the most restrictive access that accomplishes this
objective?
a. public
b. private
c. protected
d. transient
Quiz Time  4/7
Which class can not be subclass in java ?
a. parent class
b. final class
c. abstract class
Quiz Time  5/7
Why are generics used?
a. Generics make code more fast.
b. Generics make code more optimised and readable.
c. Generics add stability to your code by making more of your bugs
detectable at compile time.
d. Generics add stability to your code by making more of your bugs
detectable at run time.
Quiz Time  6/7
Which of the following reference types cannot be generic?
a. Anonymous inner class
b. Interface
c. Inner class
d. All of the above
Quiz Time  7/7
public class Foo {
public static void main(String[] args) {
try { return; }
finally {
System.out.println( "Finally" );
}
}
}
What will be the output of the program?
a. An exception is thrown at runtime.
b. Compilation fails.
c. The code runs with no output.
d. Finally
History of Android
 Creation:
 Android, Inc. was founded in Palo Alto, California, United States in October 2003 by
Andy Rubin, Rich Miner, Nick Sears and Chris White
 Acquisition by Google:
 Google acquired Android Inc. in August 2005
 Open Handset Alliance (OHA)
 Android is then wholly developed by OHA with key employees Rubin, Rich and
Chris.
 In November 5, 2007, the OHA, a consortium of 84 firms has develop an open
standards for mobile devices.
 On the same day OHA also unveiled their first product, Android , a mobile device
platform built on the Linux Kernel version 2.6
Open Handset Alliance
History of Android Versions
 Android 1.0 – The Android Era officially began on October 22nd, 2008, when the T-
Mobile G1 launched in the United States
 Pull-down notification window
 Home screen widgets
 Deep, rich Gmail integration
 The Android Market
 Android 1.1 – It’s no coincidence that Danger’s Hiptop platform, which gave birth to the
sidekick, had been offering painless, phased over-the-air OS updates for years –
February 2009
 Dessert is Served – Android 1.5 “Cupcake” – In retrospect, it’s amazing to think that
Google could’ve shipped Android w/o any sort of soft keyboard. – July 2009
 On screen keyboard
 Clipboard improvements
 Video Capture and playbacks
History of Android Versions
 Android 1.6 Donut – Android 1.6 Donut was a far bigger deal than it’s “0.1”
increment would let on, perhaps none of the “Under The Hood” changes had a
more profound effect on the platform than resolution independence –
September 15, 2009
 Multiple screen resolution support
 Quick search box
 Android 2.0 / 2.1 Eclair – “BIG” would be an accurate description all around –
November 2009
 Multiple accounts support
 Google Maps Navigation
 Live Wallpapers
 Speech-to-text
 A new Lock Screen
History of Android Versions
 Android 2.2 Froyo – What did Google have to showcase in Froyo? Plenty – Mid
2010
 Redesigned home screen
 Android 2.3 Gingerbread – Google used the launch of Gingerbread as an
opportunity to gain some footing in the Mobile Gaming Market - December 2010
 More granular control over copy and paste
 Better battery and app management tools
 Support for front facing cameras
 Android 3.X Honeycomb – Honeycomb was, to say the least, and oddity –
divergence in Google’s Hard-Charging path towards smartphone dominance. –
February 2011
 The death of physical buttons
 Concept of action bar
History of Android Versions
 Android 4.0 Ice Cream Sandwich – ICS is, w/o question, the BIGGEST change for
Android in phones yet – October 2011
 Home screen improvements
 Android Beam (NFC Support)
 Face Unlock
 Data usage analysis
 New Calendar and Mail maps
 Android 4.1 Jelly Bean – After Honeycomb’s failure, a revamped tablet strategy –
July 2012
 Roboto refresh – Android’s signature font has been reworked
 Expandable, actionable notifications
 Widget flexibility
 Predictive text
History of Android Versions
 Android 4.2 Jelly Bean – Here comes the point updates – November 2012
 Redesigned clock app and clock widgets
 Multiple user profiles
 Photospheres – panoramic images
 Daydream screensavers
 Android 4.3 Jelly Bean – Designed with gaming and Nexus 7 in mind – July
2013
 Android 4.4 Kitkat – Refining android for Everyone – October 2013
 Kitkat is faster, more efficient and less resource intensive
History of Android Versions
 Android 5.0 Lollypop – Putting Android on every screen – November 12,
2014
 Material Design
 Improved Notifications – notification on lock screen
 Project Volta – Improved battery life
 Android everywhere – Android Wear, Android TV, Android Auto
Android Architecture
Linux Kernel
 Works as Hardware Access Layer (HAL)
 Device Drivers
 Memory Management
 Process Management
 Networking
 Security Settings
Libraries
 C/C++ libraries (Native libraries)
 Surface Manager
 Media Framework
 SQLite
 WebKit
 OpenGL
Android Runtime
 Dalvik Virtual Machine
 Developed by Dan Bornstein of Google
 .dex files
 Higher efficiency in low resource environments
 Multiple instances of VM
 Limited Memory and battery power
 Core Java Libraries
 java.*, javax.* - Basic java classes
 org.* - Internet/Web services
 android.* - App life cycle
 junit.* - Unit Testing
Application Framework
 Package Manager
 Window Manager
 Activity Manager
 Content Providers
 Telephony Manager
 Location Manager
 Resource Manager
 Notification Manager
Applications
 Built in user apps
 Apps from Android play store
Application Components
 Activity:
 Single screen with user interface
 IntentReceivers:
 Components that correspond to broadcast “Intents”
 Way to respond to external notification or alarms
 Intents:
 Think of Intents as a verb or object; a description of what you want done
e.g. VIEW, CALL, PLAY, etc.
 Activities and IntentReceivers describe what intents they can service
 Services:
 Faceless components that can run in background
e.g. music player, network download, live wallpaper, sync, etc.
Application Components
 ContentProviders:
 Enable sharing of data across applications:
e.g. address book, photo gallery
 Provides uniform APIs for querying, delete, update, insert
 Content is represented by URI and MIME type
Hello World Program
 Create Project with Android Studio
Hello World Program
 Select the minimum API level which your app supports.
Hello World Program
 Add an Activity
Hello World Program
 Configure your Activity
 Click Finish.
 Your project is created. Now run your project on real device or AVD.
Running our First Program on Real Device
 Plugin your device to machine using USB cable.
 Enable USB debugging on your device.
 Open one of your project files from Android Studio and click Run from
toolbar or press Shift+F10
 In the Run as Window that appears, select Android Application and click
OK.
 Android Studio installs the app on your device and starts it.
Running our First Program on the Emulator
 In Android Studio, click Android Virtual Device Manager from the
toolbar.
 In the AVD panel click Create Virtual Device.
 Select the Category and the phone model and click Next.
 In Select Image window, select system image and click Next.
 In Configure AVD window fill in the details for the AVD. Give it a name,
orientation, etc. then click Finish.
 Open one of your project files from Android Studio and click Run from
toolbar or press Shift+F10
 In the Run as Window that appears, select Android Application and click
OK.
Activity Life Cycle
Directory Structure of Android Studio Project
End of Lecture
Thank You!
Questions?

Introduction to Android (in-short) - Itvedant, Thane | Mumbai | Navi Mumbai

  • 2.
  • 3.
    Before we begin Inorder to learn Android you must have some Basic knowledge Java. Java: prerequisites for android development  OOPS – Abstraction, Encapsulation, Polymorphism and Inheritance  Tokens – Primitive data types, variables, constants, keywords such as static, final, try, catch, etc.  Type Casting and Visibility  Arrays and Operators  Control Statements
  • 4.
    Before we begin Class Fundamentals – Inner and Anonymous Classes  Inheritance, Interface, Package  Multithreading and Exception Handling  Java Annotations and IO  Generics and Collections
  • 5.
    Before we begin Toolsto use : Android Studio Android phone
  • 6.
    Quiz Time 1/7 Sharing of common information is achieved by the concept of ? a. polymorphism b. encapsulation c. inheritance d. none of above
  • 7.
    Quiz Time 2/7 Which constructs an anonymous inner class instance? a. Runnable r = new Runnable() { }; b. Runnable r = new Runnable(public void run() { }); c. Runnable r = new Runnable { public void run(){}}; d. System.out.println(new Runnable() {public void run() { }});
  • 8.
    Quiz Time 3/7 You want subclasses in any package to have access to members of a superclass. Which is the most restrictive access that accomplishes this objective? a. public b. private c. protected d. transient
  • 9.
    Quiz Time 4/7 Which class can not be subclass in java ? a. parent class b. final class c. abstract class
  • 10.
    Quiz Time 5/7 Why are generics used? a. Generics make code more fast. b. Generics make code more optimised and readable. c. Generics add stability to your code by making more of your bugs detectable at compile time. d. Generics add stability to your code by making more of your bugs detectable at run time.
  • 11.
    Quiz Time 6/7 Which of the following reference types cannot be generic? a. Anonymous inner class b. Interface c. Inner class d. All of the above
  • 12.
    Quiz Time 7/7 public class Foo { public static void main(String[] args) { try { return; } finally { System.out.println( "Finally" ); } } } What will be the output of the program? a. An exception is thrown at runtime. b. Compilation fails. c. The code runs with no output. d. Finally
  • 13.
    History of Android Creation:  Android, Inc. was founded in Palo Alto, California, United States in October 2003 by Andy Rubin, Rich Miner, Nick Sears and Chris White  Acquisition by Google:  Google acquired Android Inc. in August 2005  Open Handset Alliance (OHA)  Android is then wholly developed by OHA with key employees Rubin, Rich and Chris.  In November 5, 2007, the OHA, a consortium of 84 firms has develop an open standards for mobile devices.  On the same day OHA also unveiled their first product, Android , a mobile device platform built on the Linux Kernel version 2.6
  • 14.
  • 15.
    History of AndroidVersions  Android 1.0 – The Android Era officially began on October 22nd, 2008, when the T- Mobile G1 launched in the United States  Pull-down notification window  Home screen widgets  Deep, rich Gmail integration  The Android Market  Android 1.1 – It’s no coincidence that Danger’s Hiptop platform, which gave birth to the sidekick, had been offering painless, phased over-the-air OS updates for years – February 2009  Dessert is Served – Android 1.5 “Cupcake” – In retrospect, it’s amazing to think that Google could’ve shipped Android w/o any sort of soft keyboard. – July 2009  On screen keyboard  Clipboard improvements  Video Capture and playbacks
  • 16.
    History of AndroidVersions  Android 1.6 Donut – Android 1.6 Donut was a far bigger deal than it’s “0.1” increment would let on, perhaps none of the “Under The Hood” changes had a more profound effect on the platform than resolution independence – September 15, 2009  Multiple screen resolution support  Quick search box  Android 2.0 / 2.1 Eclair – “BIG” would be an accurate description all around – November 2009  Multiple accounts support  Google Maps Navigation  Live Wallpapers  Speech-to-text  A new Lock Screen
  • 17.
    History of AndroidVersions  Android 2.2 Froyo – What did Google have to showcase in Froyo? Plenty – Mid 2010  Redesigned home screen  Android 2.3 Gingerbread – Google used the launch of Gingerbread as an opportunity to gain some footing in the Mobile Gaming Market - December 2010  More granular control over copy and paste  Better battery and app management tools  Support for front facing cameras  Android 3.X Honeycomb – Honeycomb was, to say the least, and oddity – divergence in Google’s Hard-Charging path towards smartphone dominance. – February 2011  The death of physical buttons  Concept of action bar
  • 18.
    History of AndroidVersions  Android 4.0 Ice Cream Sandwich – ICS is, w/o question, the BIGGEST change for Android in phones yet – October 2011  Home screen improvements  Android Beam (NFC Support)  Face Unlock  Data usage analysis  New Calendar and Mail maps  Android 4.1 Jelly Bean – After Honeycomb’s failure, a revamped tablet strategy – July 2012  Roboto refresh – Android’s signature font has been reworked  Expandable, actionable notifications  Widget flexibility  Predictive text
  • 19.
    History of AndroidVersions  Android 4.2 Jelly Bean – Here comes the point updates – November 2012  Redesigned clock app and clock widgets  Multiple user profiles  Photospheres – panoramic images  Daydream screensavers  Android 4.3 Jelly Bean – Designed with gaming and Nexus 7 in mind – July 2013  Android 4.4 Kitkat – Refining android for Everyone – October 2013  Kitkat is faster, more efficient and less resource intensive
  • 20.
    History of AndroidVersions  Android 5.0 Lollypop – Putting Android on every screen – November 12, 2014  Material Design  Improved Notifications – notification on lock screen  Project Volta – Improved battery life  Android everywhere – Android Wear, Android TV, Android Auto
  • 21.
  • 22.
    Linux Kernel  Worksas Hardware Access Layer (HAL)  Device Drivers  Memory Management  Process Management  Networking  Security Settings
  • 23.
    Libraries  C/C++ libraries(Native libraries)  Surface Manager  Media Framework  SQLite  WebKit  OpenGL
  • 24.
    Android Runtime  DalvikVirtual Machine  Developed by Dan Bornstein of Google  .dex files  Higher efficiency in low resource environments  Multiple instances of VM  Limited Memory and battery power  Core Java Libraries  java.*, javax.* - Basic java classes  org.* - Internet/Web services  android.* - App life cycle  junit.* - Unit Testing
  • 25.
    Application Framework  PackageManager  Window Manager  Activity Manager  Content Providers  Telephony Manager  Location Manager  Resource Manager  Notification Manager
  • 26.
    Applications  Built inuser apps  Apps from Android play store
  • 27.
    Application Components  Activity: Single screen with user interface  IntentReceivers:  Components that correspond to broadcast “Intents”  Way to respond to external notification or alarms  Intents:  Think of Intents as a verb or object; a description of what you want done e.g. VIEW, CALL, PLAY, etc.  Activities and IntentReceivers describe what intents they can service  Services:  Faceless components that can run in background e.g. music player, network download, live wallpaper, sync, etc.
  • 28.
    Application Components  ContentProviders: Enable sharing of data across applications: e.g. address book, photo gallery  Provides uniform APIs for querying, delete, update, insert  Content is represented by URI and MIME type
  • 29.
    Hello World Program Create Project with Android Studio
  • 30.
    Hello World Program Select the minimum API level which your app supports.
  • 31.
    Hello World Program Add an Activity
  • 32.
    Hello World Program Configure your Activity  Click Finish.  Your project is created. Now run your project on real device or AVD.
  • 33.
    Running our FirstProgram on Real Device  Plugin your device to machine using USB cable.  Enable USB debugging on your device.  Open one of your project files from Android Studio and click Run from toolbar or press Shift+F10  In the Run as Window that appears, select Android Application and click OK.  Android Studio installs the app on your device and starts it.
  • 34.
    Running our FirstProgram on the Emulator  In Android Studio, click Android Virtual Device Manager from the toolbar.  In the AVD panel click Create Virtual Device.  Select the Category and the phone model and click Next.  In Select Image window, select system image and click Next.  In Configure AVD window fill in the details for the AVD. Give it a name, orientation, etc. then click Finish.  Open one of your project files from Android Studio and click Run from toolbar or press Shift+F10  In the Run as Window that appears, select Android Application and click OK.
  • 35.
  • 36.
    Directory Structure ofAndroid Studio Project
  • 37.
    End of Lecture ThankYou! Questions?