SlideShare une entreprise Scribd logo
1  sur  50
A Developer’s Introduction to
Mobile computing &Google Android

           Dr. Frank McCown
           Harding University
                Fall 2011
        Edited by Ahmed Daoud


         This work is licensed under Creative
         Commons Attribution-NonCommercial 3.0
Why Mobile Computing?
    • Mobile platform is the platform of the future
       – Double-digit growth in world-wide smartphone
         ownership3
    • Job market is hot
       – Market for mobile software surges from $4.1 billion in
         2009 to $17.5 billion by 20121
       – 2010 Dice.com survey: 72% of recruiters looking for
         iPhone app developers, 60% for Android1
       – Dice.com: mobile app developers made $85,000 in
         2010 and salaries expected to rise2
    • It’s a lot of fun!
1http://www.businessweek.com/technology/content/oct2010/tc20101020_639668.htm
2http://it-jobs.fins.com/Articles/SB129606993144879991/Mobile-App-Developers-Wanted-at-Ad-Agencies   2
3http://www.gartner.com/it/page.jsp?id=1466313
Smartphones




                                        BlackBerry
iPhone 4   LG Revolution   HTC Trophy
                                          Curve

                                                     3
http://www.csectioncomics.com/2010/11/iphone-vs-android-vs-blackberry.html   4
Tablets




Galaxy Tab 10.1                 Acer Iconia Tab W500




             iPad 2


                                                       5
Device Usage




                                                                                                        6
http://www.androidauthority.com/nielsen-report-americans-use-tablets-smartphones-as-tv-buddies-14564/
Smartphone vs. PC Sales




http://www.businessinsider.com/chart-of-the-day-smartphone-sales-to-beat-pc-sales-by-2011-2009-8

                                                                                                   7
Smartphone Market Share




http://www.infogenra.com/global-smartphone-sales-for-2011-pegged-at-420-million-units-infographic.html

                                                                                                         8
Top US Smartphone OS Platforms




     http://gigaom.com/apple/iphone-flat-in-u-s-as-android-takes-market-share-lead/

                                                                                      9
Mobile Devices: Advantages
•   Always with the user
•   Typically have Internet access
•   Typically GPS enabled
•   Typically have accelerometer & compass
•   Typically have cameras & microphones
•   Apps are free or low-cost



                                             10
Mobile Devices: Disadvantages
• Limited screen size
• Limited battery life
• Limited processor speed
• Limited and sometimes slow network access
• Limited or awkward input: soft keyboard, phone
  keypad, touch screen, or stylus
• Limited web browser functionality
• Range of platforms & configurations across
  devices

                                                   11
Mobile Applications
• What are they?
  – Any application that runs on a mobile device
• Types
  – Web apps: run in a web browser
     • HTML, JavaScript, Flash, server-side components, etc.
  – Native: compiled binaries for the device
• Economics
  – Free (often ad-supported) vs. paid

                                                               12
Free vs. Paid
                                                                         Apps




                                                                                                    13
http://backtogeek.com/2011/04/27/there-are-now-more-free-apps-for-android-than-for-the-iphone-distimo/
Popular Development Environments
• Java ME
• .NET Compact Framework (C++, C#, VB.NET) for
  Windows Mobile
• Windows Phone 7 (Silverlight and XNA)
• Qualcomm’s BREW (C or C++)
• Symbian (C++)
• BlackBerry (Java)
• Android (Java)
• iPhone (Objective-C)
• Is having so many choices a good thing?
                                                 14
xCode IDE & iPhone Emulator




                                                                                                      15
http://developer.apple.com/iphone/library/referencelibrary/GettingStarted/Creating_an_iPhone_App/index.html
Eclipse and Android Emulator




                               16
Brief History
• 2005
  – Google acquires startup Android Inc. to start Android platform
  – Work on Dalvik VM begins
• 2007
  – Open Handset Alliance announced
  – Early look at SDK
• 2008
  –   Google sponsors 1st Android Developer Challenge
  –   T-Mobile G1 announced
  –   SDK 1.0 released
  –   Android released open source (Apache License)
  –   Android Dev Phone 1 released


               Pro Android by Hashimi & Komatineni (2009)            17
Brief History cont.
• 2009
  – SDK 1.5 (Cupcake)
      • New soft keyboard with “autocomplete” feature
  – SDK 1.6 (Donut)
      • Support Wide VGA
  – SDK 2.0/2.0.1/2.1 (Eclair)
      • Revamped UI, browser
• 2010
  – Nexus One released to the public
  – SDK 2.2 (Froyo)
      • Flash support, tethering
  – SDK 2.3 (Gingerbread)
      • UI update, system-wide copy-paste


                                                        18
Brief History cont.
• 2011
  – SDK 3.0 (Honeycomb) for tablets only
     • New UI for tablets, support multi-core processors
  – SDK 3.1 and 3.2
     • Hardware support and UI improvements
  – SDK 4.0 (Ice Cream Sandwich)
     • For Q4, combination of Gingerbread and Honeycomb




                                                           19
http://www.robotbriefs.com/news/2010/9/7/catch-up-on-android-history-with-an-infographic.html
What is Google Android?
• A software stack for mobile devices that includes
  – An operating system
  – Middleware
  – Key Applications
• Uses Linux to provide core system services
  –   Security
  –   Memory management
  –   Process management
  –   Power management
  –   Hardware drivers
http://developer.android.com/guide/basics/what-is-android.html
Setup Development Environment
• Install JDK 5, 6, or 7
• Install Eclipse IDE for Java EE Developers (version
  3.7 - Indigo)
• Download and unpack the Android SDK
• Install Android Development Tools (ADT) plugin
  for Eclipse
• Detailed install instructions available on Android
  site
  http://developer.android.com/sdk/installing.html
24
Android Emulator or AVD
• Emulator is essential to testing app but is not
  a substitute for a real device
• Emulators are called Android Virtual Devices
  (AVDs)
• Android SDK and AVD Manager allows you to
  create AVDs that target any Android API level
• AVD have configurable resolutions, RAM, SD
  cards, skins, and other hardware

                                                    25
Android Emulator: 1.6 Device




                               26
Android Emulator: 2.2 Device




                               27
Android Emulator: 3.0 Device




                               28
Emulator Basics
• Host computer’s keyboard works
• Host’s mouse works like finger
• Uses host’s Internet connection
• Side buttons work: Home, Menu, Back,
  Search, volume up and down, etc.
• Ctrl-F11 toggle landscape  portrait
• Alt-Enter toggle full-screen mode
• More info at
    http://developer.android.com/guide/developing/devices/emulator.html

                                                                          29
Emulator Limitations
• No support for placing or receiving actual phone calls
    – Simulate phone calls (placed and received) through the emulator
      console
• No support for USB connections
• No support for camera/video capture (input)
• No support for device-attached headphones
• No support for determining connected state
• No support for determining battery charge level and AC charging
  state
• No support for determining SD card insert/eject
• No support for Bluetooth
• No support for simulating the accelerometer
    – Use OpenIntents’s Sensor Simulator

                                                                        30
In other words,
test your app on
an actual device!

                    31
Create an AVD using
Android SDK and AVD Manager




                              32
Or From the Command Line

C:android-sdk-windowstools>android create avd -n MyDevice -t android-8
Android 2.2 is a basic Android platform.
Do you wish to create a custom hardware profile [no]
Created AVD 'MyDevice2' based on Android 2.2,        Device name
with the following hardware config:
                                                             Target platform
hw.lcd.density=240
vm.heapSize=24

C:android-sdk-windowstools>emulator -avd MyDevice

                                                                   Launch device

                                       More info:
     http://developer.android.com/guide/developing/devices/managing-avds-cmdline.html

                                                                                        33
Android Runtime: Dalvik VM
• Subset of Java developed by Google
• Optimized for mobile devices (better memory
  management, battery utilization, etc.)
• Dalvik runs .dex files that are compiled from
  .class files
• Introduces some new libraries
• Does not support some Java libraries like AWT
Applications Are Boxed
• By default, each app is run in its own Linux
  process
   – Process started when app’s code needs to be executed
   – Threads can be started to handle time-consuming
     operations
• Each process has its own Dalvik VM
• By default, each app is assigned unique Linux ID
   – Permissions are set so app’s files are only visible to
     that app
Producing an Android App
            javac
Java code             Byte code

                                         dx
  .java                  .class               Dalvik exe

                                              classes.dex       aapt


                         Byte code              <xml>

                    Other .class files    AndroidManifest.xml          .apk

                                                    <str>



                                              Resources
Hello Android Tutorial




       http://developer.android.com/resources/tutorials/hello-world.html
Important Files
• src/HelloAndroid.java
   – Activity which is started when app executes
• res/layout/main.xml
   – Defines & lays out widgets for the activity
• res/values/strings.xml
   – String constants used by app
• gen/R.java (Don’t touch!)
   – Auto-generated file with identifiers from main.xml, strings.xml, and
      elsewhere
• AndroidManifest.xml
   – Declares all the app’s components
   – Names libraries app needs to be linked against
   – Identifies permissions the app expects to be granted
                                                                            38
src/HelloAndroid.java
• Activity which is started when app executes




                                                39
res/layout/main.xml
• Declares layouts & widgets for the activity




         Tree from: http://developer.android.com/guide/topics/ui/index.html   40
Various Layouts




http://developer.android.com/resources/tutorials/views/index.html   41
Various Widgets




                                                                    42
http://developer.android.com/resources/tutorials/views/index.html
res/values/strings.xml
• String constants used by app




• Used for supporting Localization
   – res/values-es/values/strings.xml to support Spanish
   – res/values-fr/values/strings.xml to support French
   – Etc.


                                                           43
gen/R.java
• Auto-generated file with identifiers from main.xml,
  strings.xml, and elsewhere



                                                        Do not
                                                        modify!




                                                                  44
AndroidManifest.xml
• Declares all the app’s components
• Names libraries app needs to be linked against
• Identifies permissions the app expects to be granted




                                                         45
Four Application Components
1. Activities
   – Presents a visual UI for a single endeavor
   – Single app may be composed of several activities
   – Examples: list of photos, buttons to start/stop a song
2. Services
   – Performs background work (no UI)
   – Examples: play background music, retrieve data over a network
3. Broadcast Receivers
  – Receives and reacts to broadcast announcements (no UI)
  – Broadcast examples: battery is low, pic is taken, lang pref changed
4. Content Providers
  – Provides app data to other applications (no UI)
  – Examples: share contact info from SQLite, image from the file system 46
SDK Samples
Activity
                                 Lifecycle




http://developer.android.com/reference/android/app/Activity.html
Thank you
Any Question?
References
• Android Introduction by Marko Gargenta,
  http://www.lecturemaker.com/2009/10/andr
  oid-software-platform/
• Android Dev Guide
  http://developer.android.com/guide/topics/fu
  ndamentals.html
• Pro Android by Hashimi & Komatineni (2009)

Contenu connexe

Tendances

Ramon Pastor of Rogomi inc on Trends in iOS Development at DevCon Summit 2013...
Ramon Pastor of Rogomi inc on Trends in iOS Development at DevCon Summit 2013...Ramon Pastor of Rogomi inc on Trends in iOS Development at DevCon Summit 2013...
Ramon Pastor of Rogomi inc on Trends in iOS Development at DevCon Summit 2013...
DEVCON
 
Embedded Android Workshop at ABS 2014
Embedded Android Workshop at ABS 2014Embedded Android Workshop at ABS 2014
Embedded Android Workshop at ABS 2014
Opersys inc.
 
Android : a linux-based mobile operating system
Android : a linux-based mobile operating systemAndroid : a linux-based mobile operating system
Android : a linux-based mobile operating system
Clément Escoffier
 
Embedded Android Workshop at AnDevCon VI
Embedded Android Workshop at AnDevCon VIEmbedded Android Workshop at AnDevCon VI
Embedded Android Workshop at AnDevCon VI
Opersys inc.
 

Tendances (20)

Ramon Pastor of Rogomi inc on Trends in iOS Development at DevCon Summit 2013...
Ramon Pastor of Rogomi inc on Trends in iOS Development at DevCon Summit 2013...Ramon Pastor of Rogomi inc on Trends in iOS Development at DevCon Summit 2013...
Ramon Pastor of Rogomi inc on Trends in iOS Development at DevCon Summit 2013...
 
Embedded Android Workshop at Embedded World Conference 2013
Embedded Android Workshop at Embedded World Conference 2013Embedded Android Workshop at Embedded World Conference 2013
Embedded Android Workshop at Embedded World Conference 2013
 
Basics of Android
Basics of Android Basics of Android
Basics of Android
 
Android basic
Android basicAndroid basic
Android basic
 
Android Overview
Android OverviewAndroid Overview
Android Overview
 
Embedded Android Workshop / ELC 2013
Embedded Android Workshop / ELC 2013Embedded Android Workshop / ELC 2013
Embedded Android Workshop / ELC 2013
 
Mobile Operating Systems
Mobile Operating SystemsMobile Operating Systems
Mobile Operating Systems
 
The Challenge of Touchscreen Clutter - v2 - 9.26.2012
The Challenge of Touchscreen Clutter - v2 - 9.26.2012The Challenge of Touchscreen Clutter - v2 - 9.26.2012
The Challenge of Touchscreen Clutter - v2 - 9.26.2012
 
Mobile Operating Systems
Mobile Operating SystemsMobile Operating Systems
Mobile Operating Systems
 
Mobile Operating System
Mobile Operating SystemMobile Operating System
Mobile Operating System
 
Seminar on mobile os
Seminar on mobile osSeminar on mobile os
Seminar on mobile os
 
Embedded Android Workshop
Embedded Android WorkshopEmbedded Android Workshop
Embedded Android Workshop
 
Android OS version history
Android OS version historyAndroid OS version history
Android OS version history
 
Andriod vs iphone
Andriod vs iphoneAndriod vs iphone
Andriod vs iphone
 
Embedded Android Workshop at ABS 2014
Embedded Android Workshop at ABS 2014Embedded Android Workshop at ABS 2014
Embedded Android Workshop at ABS 2014
 
Android os(comparison all other mobile os)
Android os(comparison all other mobile os)Android os(comparison all other mobile os)
Android os(comparison all other mobile os)
 
Android : a linux-based mobile operating system
Android : a linux-based mobile operating systemAndroid : a linux-based mobile operating system
Android : a linux-based mobile operating system
 
Operating Systems in Mobile Phones
Operating Systems in Mobile PhonesOperating Systems in Mobile Phones
Operating Systems in Mobile Phones
 
Embedded Android Workshop at AnDevCon VI
Embedded Android Workshop at AnDevCon VIEmbedded Android Workshop at AnDevCon VI
Embedded Android Workshop at AnDevCon VI
 
IOS vs Android presentation by Saikrishna
IOS vs Android presentation by SaikrishnaIOS vs Android presentation by Saikrishna
IOS vs Android presentation by Saikrishna
 

En vedette

جلاد دنشواي وجلادي الثورة
جلاد دنشواي وجلادي الثورةجلاد دنشواي وجلادي الثورة
جلاد دنشواي وجلادي الثورة
Maged Ramadan
 
وأنا وصورتي
وأنا وصورتيوأنا وصورتي
وأنا وصورتي
Maged Ramadan
 
وقفة للتأمل والمراجعة مع منهج أردوغان
وقفة للتأمل والمراجعة مع منهج أردوغان وقفة للتأمل والمراجعة مع منهج أردوغان
وقفة للتأمل والمراجعة مع منهج أردوغان
Maged Ramadan
 
كيف نفجر الإبداع في أبنائنا
كيف نفجر الإبداع في أبنائناكيف نفجر الإبداع في أبنائنا
كيف نفجر الإبداع في أبنائنا
Maged Ramadan
 
قرأة في كتاب الردة عن الحرية
قرأة في كتاب الردة عن الحريةقرأة في كتاب الردة عن الحرية
قرأة في كتاب الردة عن الحرية
Maged Ramadan
 
حدد بوصلة حياتك
حدد بوصلة حياتكحدد بوصلة حياتك
حدد بوصلة حياتك
Maged Ramadan
 
How to Plan for Yourself
How to Plan for YourselfHow to Plan for Yourself
How to Plan for Yourself
MUFIX Community
 
مفهوم التفكير وانواعهه
مفهوم التفكير وانواعههمفهوم التفكير وانواعهه
مفهوم التفكير وانواعهه
Mohammad Alkafoury
 

En vedette (20)

Top rated business suites
Top rated business suitesTop rated business suites
Top rated business suites
 
جلاد دنشواي وجلادي الثورة
جلاد دنشواي وجلادي الثورةجلاد دنشواي وجلادي الثورة
جلاد دنشواي وجلادي الثورة
 
وأنا وصورتي
وأنا وصورتيوأنا وصورتي
وأنا وصورتي
 
ThinkQuest International Competition
ThinkQuest International CompetitionThinkQuest International Competition
ThinkQuest International Competition
 
اروع الأسرار
اروع الأسراراروع الأسرار
اروع الأسرار
 
وقفة للتأمل والمراجعة مع منهج أردوغان
وقفة للتأمل والمراجعة مع منهج أردوغان وقفة للتأمل والمراجعة مع منهج أردوغان
وقفة للتأمل والمراجعة مع منهج أردوغان
 
Gwt training presentation
Gwt training presentationGwt training presentation
Gwt training presentation
 
مقومات الطبيب المسلم
مقومات الطبيب المسلممقومات الطبيب المسلم
مقومات الطبيب المسلم
 
Oracle academy
Oracle academyOracle academy
Oracle academy
 
10 principes de vie
10 principes de vie10 principes de vie
10 principes de vie
 
Richard
RichardRichard
Richard
 
كيف نفجر الإبداع في أبنائنا
كيف نفجر الإبداع في أبنائناكيف نفجر الإبداع في أبنائنا
كيف نفجر الإبداع في أبنائنا
 
eXtensible Markup Language (By Dr.Hatem Mohamed)
eXtensible Markup Language (By Dr.Hatem Mohamed)eXtensible Markup Language (By Dr.Hatem Mohamed)
eXtensible Markup Language (By Dr.Hatem Mohamed)
 
قرأة في كتاب الردة عن الحرية
قرأة في كتاب الردة عن الحريةقرأة في كتاب الردة عن الحرية
قرأة في كتاب الردة عن الحرية
 
حدد بوصلة حياتك
حدد بوصلة حياتكحدد بوصلة حياتك
حدد بوصلة حياتك
 
E learning
E learningE learning
E learning
 
How to Plan for Yourself
How to Plan for YourselfHow to Plan for Yourself
How to Plan for Yourself
 
تحليل الاستبيان
تحليل الاستبيانتحليل الاستبيان
تحليل الاستبيان
 
Self-marketing Arts
Self-marketing ArtsSelf-marketing Arts
Self-marketing Arts
 
مفهوم التفكير وانواعهه
مفهوم التفكير وانواعههمفهوم التفكير وانواعهه
مفهوم التفكير وانواعهه
 

Similaire à Introduction to Android

18ITT61 - Introduction.pptx
18ITT61 - Introduction.pptx18ITT61 - Introduction.pptx
18ITT61 - Introduction.pptx
MugiiiReee
 
1319571 634635606205391250
1319571 6346356062053912501319571 634635606205391250
1319571 634635606205391250
MadNor Exe
 

Similaire à Introduction to Android (20)

Android presantation
Android presantationAndroid presantation
Android presantation
 
Android Fundamentals, Architecture and Versions
Android Fundamentals, Architecture and VersionsAndroid Fundamentals, Architecture and Versions
Android Fundamentals, Architecture and Versions
 
Gl android platform
Gl android platformGl android platform
Gl android platform
 
18ITT61 - Introduction.pptx
18ITT61 - Introduction.pptx18ITT61 - Introduction.pptx
18ITT61 - Introduction.pptx
 
AndroidOverview
AndroidOverviewAndroidOverview
AndroidOverview
 
Lec001
Lec001Lec001
Lec001
 
Android application development
Android application developmentAndroid application development
Android application development
 
POWERPOINT2
POWERPOINT2POWERPOINT2
POWERPOINT2
 
Android 130923124440-phpapp01
Android 130923124440-phpapp01Android 130923124440-phpapp01
Android 130923124440-phpapp01
 
1319571 634635606205391250
1319571 6346356062053912501319571 634635606205391250
1319571 634635606205391250
 
Part 1 robot in the making
Part 1 robot in the makingPart 1 robot in the making
Part 1 robot in the making
 
PRESENTATION ON ANDROID
PRESENTATION ON ANDROIDPRESENTATION ON ANDROID
PRESENTATION ON ANDROID
 
Android based os
Android based osAndroid based os
Android based os
 
Mobile application development4
Mobile application development4Mobile application development4
Mobile application development4
 
Mobile application development
Mobile application developmentMobile application development
Mobile application development
 
Mobile application development2
Mobile application development2Mobile application development2
Mobile application development2
 
Mobile application development2
Mobile application development2Mobile application development2
Mobile application development2
 
Secured Mobile Application Development in Android, Blackberry & iOS
Secured Mobile Application Development in Android, Blackberry & iOSSecured Mobile Application Development in Android, Blackberry & iOS
Secured Mobile Application Development in Android, Blackberry & iOS
 
Android
AndroidAndroid
Android
 
Android technology
Android technology Android technology
Android technology
 

Dernier

The basics of sentences session 3pptx.pptx
The basics of sentences session 3pptx.pptxThe basics of sentences session 3pptx.pptx
The basics of sentences session 3pptx.pptx
heathfieldcps1
 
Activity 01 - Artificial Culture (1).pdf
Activity 01 - Artificial Culture (1).pdfActivity 01 - Artificial Culture (1).pdf
Activity 01 - Artificial Culture (1).pdf
ciinovamais
 
Jual Obat Aborsi Hongkong ( Asli No.1 ) 085657271886 Obat Penggugur Kandungan...
Jual Obat Aborsi Hongkong ( Asli No.1 ) 085657271886 Obat Penggugur Kandungan...Jual Obat Aborsi Hongkong ( Asli No.1 ) 085657271886 Obat Penggugur Kandungan...
Jual Obat Aborsi Hongkong ( Asli No.1 ) 085657271886 Obat Penggugur Kandungan...
ZurliaSoop
 
Spellings Wk 3 English CAPS CARES Please Practise
Spellings Wk 3 English CAPS CARES Please PractiseSpellings Wk 3 English CAPS CARES Please Practise
Spellings Wk 3 English CAPS CARES Please Practise
AnaAcapella
 

Dernier (20)

The basics of sentences session 3pptx.pptx
The basics of sentences session 3pptx.pptxThe basics of sentences session 3pptx.pptx
The basics of sentences session 3pptx.pptx
 
How to Manage Global Discount in Odoo 17 POS
How to Manage Global Discount in Odoo 17 POSHow to Manage Global Discount in Odoo 17 POS
How to Manage Global Discount in Odoo 17 POS
 
Accessible Digital Futures project (20/03/2024)
Accessible Digital Futures project (20/03/2024)Accessible Digital Futures project (20/03/2024)
Accessible Digital Futures project (20/03/2024)
 
Asian American Pacific Islander Month DDSD 2024.pptx
Asian American Pacific Islander Month DDSD 2024.pptxAsian American Pacific Islander Month DDSD 2024.pptx
Asian American Pacific Islander Month DDSD 2024.pptx
 
Sociology 101 Demonstration of Learning Exhibit
Sociology 101 Demonstration of Learning ExhibitSociology 101 Demonstration of Learning Exhibit
Sociology 101 Demonstration of Learning Exhibit
 
Micro-Scholarship, What it is, How can it help me.pdf
Micro-Scholarship, What it is, How can it help me.pdfMicro-Scholarship, What it is, How can it help me.pdf
Micro-Scholarship, What it is, How can it help me.pdf
 
ICT role in 21st century education and it's challenges.
ICT role in 21st century education and it's challenges.ICT role in 21st century education and it's challenges.
ICT role in 21st century education and it's challenges.
 
Unit-IV- Pharma. Marketing Channels.pptx
Unit-IV- Pharma. Marketing Channels.pptxUnit-IV- Pharma. Marketing Channels.pptx
Unit-IV- Pharma. Marketing Channels.pptx
 
Application orientated numerical on hev.ppt
Application orientated numerical on hev.pptApplication orientated numerical on hev.ppt
Application orientated numerical on hev.ppt
 
Magic bus Group work1and 2 (Team 3).pptx
Magic bus Group work1and 2 (Team 3).pptxMagic bus Group work1and 2 (Team 3).pptx
Magic bus Group work1and 2 (Team 3).pptx
 
On National Teacher Day, meet the 2024-25 Kenan Fellows
On National Teacher Day, meet the 2024-25 Kenan FellowsOn National Teacher Day, meet the 2024-25 Kenan Fellows
On National Teacher Day, meet the 2024-25 Kenan Fellows
 
TỔNG ÔN TẬP THI VÀO LỚP 10 MÔN TIẾNG ANH NĂM HỌC 2023 - 2024 CÓ ĐÁP ÁN (NGỮ Â...
TỔNG ÔN TẬP THI VÀO LỚP 10 MÔN TIẾNG ANH NĂM HỌC 2023 - 2024 CÓ ĐÁP ÁN (NGỮ Â...TỔNG ÔN TẬP THI VÀO LỚP 10 MÔN TIẾNG ANH NĂM HỌC 2023 - 2024 CÓ ĐÁP ÁN (NGỮ Â...
TỔNG ÔN TẬP THI VÀO LỚP 10 MÔN TIẾNG ANH NĂM HỌC 2023 - 2024 CÓ ĐÁP ÁN (NGỮ Â...
 
ICT Role in 21st Century Education & its Challenges.pptx
ICT Role in 21st Century Education & its Challenges.pptxICT Role in 21st Century Education & its Challenges.pptx
ICT Role in 21st Century Education & its Challenges.pptx
 
Activity 01 - Artificial Culture (1).pdf
Activity 01 - Artificial Culture (1).pdfActivity 01 - Artificial Culture (1).pdf
Activity 01 - Artificial Culture (1).pdf
 
Basic Civil Engineering first year Notes- Chapter 4 Building.pptx
Basic Civil Engineering first year Notes- Chapter 4 Building.pptxBasic Civil Engineering first year Notes- Chapter 4 Building.pptx
Basic Civil Engineering first year Notes- Chapter 4 Building.pptx
 
Unit-IV; Professional Sales Representative (PSR).pptx
Unit-IV; Professional Sales Representative (PSR).pptxUnit-IV; Professional Sales Representative (PSR).pptx
Unit-IV; Professional Sales Representative (PSR).pptx
 
Spatium Project Simulation student brief
Spatium Project Simulation student briefSpatium Project Simulation student brief
Spatium Project Simulation student brief
 
Jual Obat Aborsi Hongkong ( Asli No.1 ) 085657271886 Obat Penggugur Kandungan...
Jual Obat Aborsi Hongkong ( Asli No.1 ) 085657271886 Obat Penggugur Kandungan...Jual Obat Aborsi Hongkong ( Asli No.1 ) 085657271886 Obat Penggugur Kandungan...
Jual Obat Aborsi Hongkong ( Asli No.1 ) 085657271886 Obat Penggugur Kandungan...
 
ComPTIA Overview | Comptia Security+ Book SY0-701
ComPTIA Overview | Comptia Security+ Book SY0-701ComPTIA Overview | Comptia Security+ Book SY0-701
ComPTIA Overview | Comptia Security+ Book SY0-701
 
Spellings Wk 3 English CAPS CARES Please Practise
Spellings Wk 3 English CAPS CARES Please PractiseSpellings Wk 3 English CAPS CARES Please Practise
Spellings Wk 3 English CAPS CARES Please Practise
 

Introduction to Android

  • 1. A Developer’s Introduction to Mobile computing &Google Android Dr. Frank McCown Harding University Fall 2011 Edited by Ahmed Daoud This work is licensed under Creative Commons Attribution-NonCommercial 3.0
  • 2. Why Mobile Computing? • Mobile platform is the platform of the future – Double-digit growth in world-wide smartphone ownership3 • Job market is hot – Market for mobile software surges from $4.1 billion in 2009 to $17.5 billion by 20121 – 2010 Dice.com survey: 72% of recruiters looking for iPhone app developers, 60% for Android1 – Dice.com: mobile app developers made $85,000 in 2010 and salaries expected to rise2 • It’s a lot of fun! 1http://www.businessweek.com/technology/content/oct2010/tc20101020_639668.htm 2http://it-jobs.fins.com/Articles/SB129606993144879991/Mobile-App-Developers-Wanted-at-Ad-Agencies 2 3http://www.gartner.com/it/page.jsp?id=1466313
  • 3. Smartphones BlackBerry iPhone 4 LG Revolution HTC Trophy Curve 3
  • 5. Tablets Galaxy Tab 10.1 Acer Iconia Tab W500 iPad 2 5
  • 6. Device Usage 6 http://www.androidauthority.com/nielsen-report-americans-use-tablets-smartphones-as-tv-buddies-14564/
  • 7. Smartphone vs. PC Sales http://www.businessinsider.com/chart-of-the-day-smartphone-sales-to-beat-pc-sales-by-2011-2009-8 7
  • 9. Top US Smartphone OS Platforms http://gigaom.com/apple/iphone-flat-in-u-s-as-android-takes-market-share-lead/ 9
  • 10. Mobile Devices: Advantages • Always with the user • Typically have Internet access • Typically GPS enabled • Typically have accelerometer & compass • Typically have cameras & microphones • Apps are free or low-cost 10
  • 11. Mobile Devices: Disadvantages • Limited screen size • Limited battery life • Limited processor speed • Limited and sometimes slow network access • Limited or awkward input: soft keyboard, phone keypad, touch screen, or stylus • Limited web browser functionality • Range of platforms & configurations across devices 11
  • 12. Mobile Applications • What are they? – Any application that runs on a mobile device • Types – Web apps: run in a web browser • HTML, JavaScript, Flash, server-side components, etc. – Native: compiled binaries for the device • Economics – Free (often ad-supported) vs. paid 12
  • 13. Free vs. Paid Apps 13 http://backtogeek.com/2011/04/27/there-are-now-more-free-apps-for-android-than-for-the-iphone-distimo/
  • 14. Popular Development Environments • Java ME • .NET Compact Framework (C++, C#, VB.NET) for Windows Mobile • Windows Phone 7 (Silverlight and XNA) • Qualcomm’s BREW (C or C++) • Symbian (C++) • BlackBerry (Java) • Android (Java) • iPhone (Objective-C) • Is having so many choices a good thing? 14
  • 15. xCode IDE & iPhone Emulator 15 http://developer.apple.com/iphone/library/referencelibrary/GettingStarted/Creating_an_iPhone_App/index.html
  • 16. Eclipse and Android Emulator 16
  • 17. Brief History • 2005 – Google acquires startup Android Inc. to start Android platform – Work on Dalvik VM begins • 2007 – Open Handset Alliance announced – Early look at SDK • 2008 – Google sponsors 1st Android Developer Challenge – T-Mobile G1 announced – SDK 1.0 released – Android released open source (Apache License) – Android Dev Phone 1 released Pro Android by Hashimi & Komatineni (2009) 17
  • 18. Brief History cont. • 2009 – SDK 1.5 (Cupcake) • New soft keyboard with “autocomplete” feature – SDK 1.6 (Donut) • Support Wide VGA – SDK 2.0/2.0.1/2.1 (Eclair) • Revamped UI, browser • 2010 – Nexus One released to the public – SDK 2.2 (Froyo) • Flash support, tethering – SDK 2.3 (Gingerbread) • UI update, system-wide copy-paste 18
  • 19. Brief History cont. • 2011 – SDK 3.0 (Honeycomb) for tablets only • New UI for tablets, support multi-core processors – SDK 3.1 and 3.2 • Hardware support and UI improvements – SDK 4.0 (Ice Cream Sandwich) • For Q4, combination of Gingerbread and Honeycomb 19
  • 21. What is Google Android? • A software stack for mobile devices that includes – An operating system – Middleware – Key Applications • Uses Linux to provide core system services – Security – Memory management – Process management – Power management – Hardware drivers
  • 23. Setup Development Environment • Install JDK 5, 6, or 7 • Install Eclipse IDE for Java EE Developers (version 3.7 - Indigo) • Download and unpack the Android SDK • Install Android Development Tools (ADT) plugin for Eclipse • Detailed install instructions available on Android site http://developer.android.com/sdk/installing.html
  • 24. 24
  • 25. Android Emulator or AVD • Emulator is essential to testing app but is not a substitute for a real device • Emulators are called Android Virtual Devices (AVDs) • Android SDK and AVD Manager allows you to create AVDs that target any Android API level • AVD have configurable resolutions, RAM, SD cards, skins, and other hardware 25
  • 29. Emulator Basics • Host computer’s keyboard works • Host’s mouse works like finger • Uses host’s Internet connection • Side buttons work: Home, Menu, Back, Search, volume up and down, etc. • Ctrl-F11 toggle landscape  portrait • Alt-Enter toggle full-screen mode • More info at http://developer.android.com/guide/developing/devices/emulator.html 29
  • 30. Emulator Limitations • No support for placing or receiving actual phone calls – Simulate phone calls (placed and received) through the emulator console • No support for USB connections • No support for camera/video capture (input) • No support for device-attached headphones • No support for determining connected state • No support for determining battery charge level and AC charging state • No support for determining SD card insert/eject • No support for Bluetooth • No support for simulating the accelerometer – Use OpenIntents’s Sensor Simulator 30
  • 31. In other words, test your app on an actual device! 31
  • 32. Create an AVD using Android SDK and AVD Manager 32
  • 33. Or From the Command Line C:android-sdk-windowstools>android create avd -n MyDevice -t android-8 Android 2.2 is a basic Android platform. Do you wish to create a custom hardware profile [no] Created AVD 'MyDevice2' based on Android 2.2, Device name with the following hardware config: Target platform hw.lcd.density=240 vm.heapSize=24 C:android-sdk-windowstools>emulator -avd MyDevice Launch device More info: http://developer.android.com/guide/developing/devices/managing-avds-cmdline.html 33
  • 34. Android Runtime: Dalvik VM • Subset of Java developed by Google • Optimized for mobile devices (better memory management, battery utilization, etc.) • Dalvik runs .dex files that are compiled from .class files • Introduces some new libraries • Does not support some Java libraries like AWT
  • 35. Applications Are Boxed • By default, each app is run in its own Linux process – Process started when app’s code needs to be executed – Threads can be started to handle time-consuming operations • Each process has its own Dalvik VM • By default, each app is assigned unique Linux ID – Permissions are set so app’s files are only visible to that app
  • 36. Producing an Android App javac Java code Byte code dx .java .class Dalvik exe classes.dex aapt Byte code <xml> Other .class files AndroidManifest.xml .apk <str> Resources
  • 37. Hello Android Tutorial http://developer.android.com/resources/tutorials/hello-world.html
  • 38. Important Files • src/HelloAndroid.java – Activity which is started when app executes • res/layout/main.xml – Defines & lays out widgets for the activity • res/values/strings.xml – String constants used by app • gen/R.java (Don’t touch!) – Auto-generated file with identifiers from main.xml, strings.xml, and elsewhere • AndroidManifest.xml – Declares all the app’s components – Names libraries app needs to be linked against – Identifies permissions the app expects to be granted 38
  • 39. src/HelloAndroid.java • Activity which is started when app executes 39
  • 40. res/layout/main.xml • Declares layouts & widgets for the activity Tree from: http://developer.android.com/guide/topics/ui/index.html 40
  • 42. Various Widgets 42 http://developer.android.com/resources/tutorials/views/index.html
  • 43. res/values/strings.xml • String constants used by app • Used for supporting Localization – res/values-es/values/strings.xml to support Spanish – res/values-fr/values/strings.xml to support French – Etc. 43
  • 44. gen/R.java • Auto-generated file with identifiers from main.xml, strings.xml, and elsewhere Do not modify! 44
  • 45. AndroidManifest.xml • Declares all the app’s components • Names libraries app needs to be linked against • Identifies permissions the app expects to be granted 45
  • 46. Four Application Components 1. Activities – Presents a visual UI for a single endeavor – Single app may be composed of several activities – Examples: list of photos, buttons to start/stop a song 2. Services – Performs background work (no UI) – Examples: play background music, retrieve data over a network 3. Broadcast Receivers – Receives and reacts to broadcast announcements (no UI) – Broadcast examples: battery is low, pic is taken, lang pref changed 4. Content Providers – Provides app data to other applications (no UI) – Examples: share contact info from SQLite, image from the file system 46
  • 48. Activity Lifecycle http://developer.android.com/reference/android/app/Activity.html
  • 50. References • Android Introduction by Marko Gargenta, http://www.lecturemaker.com/2009/10/andr oid-software-platform/ • Android Dev Guide http://developer.android.com/guide/topics/fu ndamentals.html • Pro Android by Hashimi & Komatineni (2009)

Notes de l'éditeur

  1. Worldwide, Nokia still leads smartphone sales with 44.3% of the market, but that represents a significant slide over the last few years. As recently as 2006, Nokia&apos;s Symbian platform accounted for over 72% of smartphones sold; now it represents just 50.3%.Nokia has particularly lost ground among business users due to the popularity of RIM&apos;s BlackBerry, which now claims a 20.9% share of smartphones. Nokia recently announced a &quot;partnership&quot; with Microsoft, which largely just involves porting Pocket Office apps to Symbian in a bid to make Nokia&apos;s devices more competitive with the BlackBerry. In October, 2009, Gartner Inc. predicted that by 2012, Android would become the world&apos;s second most popular smartphone platform, behind only the Symbian OS which powers Nokia phones very popular outside the US. Meanwhile, BlackBerry would fall from 2nd to 5th place, iPhone would remain in 3rd place, and Microsoft&apos;s Windows Mobile would remain in 4th place.
  2. BREW: Binary Runtime Environment WirelessProprietary mobile device platform developed by Qualcomm.Developmentlanguage is C with C++ interfaces.Certification and development process is expensive.
  3.  Open Handset Alliance, a consortium of 47 hardware, software, and telecom companies devoted to advancing open standards for mobile devices. Includes Texas Instruments, Broadcom Corporation, Google, HTC, Intel, LG, Marvell Technology Group, Motorola, Nvidia, Qualcomm, Samsung Electronics, Sprint Nextel and T-Mobile
  4. Every application must have an AndroidManifest.xml file (with precisely that name) in its root directory. The manifest presents essential information about the application to the Android system, information the system must have before it can run any of the application&apos;s code. Among other things, the manifest does the following:It names the Java package for the application. The package name serves as a unique identifier for the application.It describes the components of the application — the activities, services, broadcast receivers, and content providers that the application is composed of. 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 determines which processes will host application components.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&apos;s components.It lists the Instrumentation classes that provide profiling and other information as the application is running. These declarations are present in the manifest only while the application is being developed and tested; they&apos;re removed before the application is published.It declares the minimum level of the Android API that the application requires.It lists the libraries that the application must be linked against.
  5. A ViewGroup is a special view that can contain other views (called children.) The view group is the base class for layouts and views containers. The ViewGroup subclass is the base class for layouts, which are invisible containers that hold other Views (or other ViewGroups) and define their layout properties. LinearLayout is a subclass of ViewGroup. The View class represents the basic building block for user interface components. A View occupies a rectangular area on the screen and is responsible for drawing and event handling. View is the base class for widgets, which are used to create interactive UI components (buttons, text fields, etc.).
  6. This is the most common IntentFilter seen in Android applications. The action android.intent.action.MAIN indicates that this is the first activity that should be executed when starting this app. The category android.intent.category.LAUNCHER places this Activity inthe launcher window (the window that lists all the available apps).