SlideShare una empresa de Scribd logo
1 de 24
Google Android
     Based on android-sdk_2.2


  Mobile Computing




Bruce Scharlau, University of Aberdeen, 2010
Android is part of the ‘build a
   better phone’ process
Open Handset Alliance produces
 Android

Comprises handset manufacturers,
 software firms, mobile operators, and
 other manufactures and funding
 companies

   http://www.openhandsetalliance.com/


            Bruce Scharlau, University of Aberdeen, 2010
Android is growing
                          Uneven distribution of OS by regions




                 Does not include iTouch or iPad, as not smartphones



http://metrics.admob.com/wp-content/uploads/2010/06/May-2010-AdMob-Mobile-Metrics-Highlights.pdf
                           Bruce Scharlau, University of Aberdeen, 2010
Android makes mobile Java easier




                                             Well, sort of…




                                Bruce Scharlau, University of Aberdeen, 2010
http://code.google.com/android/goodies/index.html
Android applications are written
           in Java
package com.google.android.helloactivity;

import android.app.Activity;
import android.os.Bundle;

public class HelloActivity extends Activity {
  public HelloActivity() {
  }
@Override
  public void onCreate(Bundle icicle) {
     super.onCreate(icicle);
     setContentView(R.layout.hello_activity);
  }
}               Bruce Scharlau, University of Aberdeen, 2010
Android applications are
 compiled to Dalvik bytecode
Write app in Java
Write app in Java
                                     Compiled in Java
                                     Compiled in Java



               Transformed to Dalvik bytecode
               Transformed to Dalvik bytecode



                                                    Loaded into Dalvik VM
                                                    Loaded into Dalvik VM

                                                       Linux OS


                Bruce Scharlau, University of Aberdeen, 2010
The Dalvik runtime is optimised
    for mobile applications



     Run multiple VMs efficiently

     Each app has its own VM

     Minimal memory footprint
       Bruce Scharlau, University of Aberdeen, 2010
Android has many components




       Bruce Scharlau, University of Aberdeen, 2010
Can assume that most have
                android 2.1 or 2.2




                                Bruce Scharlau, University of Aberdeen, 2010
http://developer.android.com/resources/dashboard/platform-versions.html
Android has a working emulator




       Bruce Scharlau, University of Aberdeen, 2010
All applications are written in
Java and available to each other

   Android designed to enable reuse of
    components in other applications


 Each application can publish its
  capabilities which other apps can use


          Bruce Scharlau, University of Aberdeen, 2010
Android applications have
Views such as
Views such as common structure
lists, grids, text
lists, grids, text                                        An Activity Manager that
                                                          An Activity Manager that
boxes, buttons,
boxes, buttons,                                           manages the life cycle of
                                                          manages the life cycle of
and even an
and even an                                               applications and provides
                                                          applications and provides
embeddable web
embeddable web                                            a common navigation
                                                          a common navigation
browser
browser                                                   backstack
                                                          backstack
Content
Content                                                   A Notification Manager
                                                          A Notification Manager
Providers that
Providers that                                            that enables all apps to
                                                          that enables all apps to
enable
enable                                                    display custom alerts in the
                                                          display custom alerts in the
applications to
applications to                                           status bar
                                                          status bar
access data from
access data from
other applications
other applications                                         A Resource Manager,
                                                           A Resource Manager,
(such as
(such as                                                   providing access to non-
                                                           providing access to non-
Contacts), or to
Contacts), or to                                           code resources such as
                                                           code resources such as
share their own
share their own                                            localized strings,
                                                           localized strings,
data
data                                                       graphics, and layout files
                                                           graphics, and layout files
                     Bruce Scharlau, University of Aberdeen, 2010
Android applications have
              common structure
Broadcast
Broadcast                                                   Activity is the presentation
                                                            Activity is the presentation
receivers can
receivers can                                               layer of your app: there will
                                                            layer of your app: there will
trigger intents that
trigger intents that                                        be one per screen, and the
                                                            be one per screen, and the
start an application
start an application                                        Views provide the UI to the
                                                            Views provide the UI to the
                                                            activity
                                                            activity
Data storage
Data storage
provide data for
provide data for                                            Intents specify what
                                                            Intents specify what
your apps, and
your apps, and                                              specific action should be
                                                            specific action should be
can be shared
can be shared                                               performed
                                                            performed
between apps –
between apps –
database, file,
database, file,
and shared
and shared                                                    Services run in the
                                                              Services run in the
preferences
preferences                                                   background and have
                                                              background and have
(hash map) used
(hash map) used                                               no UI for the user –
                                                              no UI for the user –
by group of
by group of                                                   they will update data,
                                                              they will update data,
applications
applications                                                  and trigger events
                                                              and trigger events

                       Bruce Scharlau, University of Aberdeen, 2010
There is a common file structure
         for applications
  code
                                                          Autogenerated
   files                                                  resource list
  images

                                                          UI layouts


                                                          constants



           Bruce Scharlau, University of Aberdeen, 2010
Standard components form
building blocks for Android apps
                     Notifications
                                   Has life-cycle
                     Activity
                                  screen
                    Views
                                App to handle content
                   Intents
                                  Background app
                    Service       Like music player



                    manifest

                ContentProviders                        Other applications
        Bruce Scharlau, University of Aberdeen, 2010
The AndroidManifest lists
           application details
<?xml version="1.0" encoding="utf-8"?>
<manifest
  xmlns:android="http://schemas.android.com/apk/res/android"
  package="com.my_domain.app.helloactivity">
  <application android:label="@string/app_name">
    <activity android:name=".HelloActivity">
       <intent-filter>
          <action android:name="android.intent.action.MAIN"/>
          <category
  android:name="android.intent.category.LAUNCHER"/>
       </intent-filter>
    </activity>
  </application>
                 Bruce Scharlau, University of Aberdeen, 2010
Activity is one thing you can do




                      Bruce Scharlau, University of Aberdeen, 2010
From fundamentals page in sdk
Intent provides late running
        binding to other apps

It can be thought of as the glue between
   activities. It is basically a passive data
   structure holding an abstract description of
   an action to be performed.

   Written as action/data pairs such as:
   VIEW_ACTION/ACTION content://contacts/1



              Bruce Scharlau, University of Aberdeen, 2010
Services declared in the manifest
      and provide support
Services run in the background:
Music player providing the music playing in
 an audio application



Intensive background apps, might need to
  spawn their own thread so as to not block
  the application
            Bruce Scharlau, University of Aberdeen, 2010
Notifications let you know of
     background events
This way you know that an SMS arrived,
 or that your phone is ringing, and the
 MP3 player should pause




        Bruce Scharlau, University of Aberdeen, 2010
ContentProviders share data

You need one if your application shares data
 with other applications

This way you can share the contact list with the
 IM application

If you don’t need to share data, then you can
   use SQLlite database

              Bruce Scharlau, University of Aberdeen, 2010
UI layouts are in Java and XML




setContentView(R.layout.hello_activity); //will load the XML UI file
                  Bruce Scharlau, University of Aberdeen, 2010
Security in Android follows
     standard Linux guidelines
 Each application runs in its own process
 Process permissions are enforced at user
   and group IDs assigned to processes
 Finer grained permissions are then
   granted (revoked) per operations

<manifest xmlns:android="http://schemas.android.com/apk/res/android"
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
  package="com.google.android.app.myapp" >
  package="com.google.android.app.myapp" >
<uses-permission id="android.permission.RECEIVE_SMS" />
<uses-permission id="android.permission.RECEIVE_SMS" />
</manifest>
</manifest>
                 Bruce Scharlau, University of Aberdeen, 2010
There are lots of sources of
             information
• The sdk comes with the API references,
  sample applications and lots of docs
• Blog http://android-developers.blogspot.com/
  which has lots of useful examples, details
• There is http://www.anddev.org




              Bruce Scharlau, University of Aberdeen, 2010

Más contenido relacionado

Destacado (8)

Powerpoint schattige dieren
Powerpoint schattige dierenPowerpoint schattige dieren
Powerpoint schattige dieren
 
เครื่องควบคุมความเร็ว
เครื่องควบคุมความเร็วเครื่องควบคุมความเร็ว
เครื่องควบคุมความเร็ว
 
الدهناء
الدهناءالدهناء
الدهناء
 
Communicatie & co
Communicatie & coCommunicatie & co
Communicatie & co
 
Foreclosure experts san diego
Foreclosure experts san diegoForeclosure experts san diego
Foreclosure experts san diego
 
Palnitkar solarenergyindependenceasusedinruralindia
Palnitkar solarenergyindependenceasusedinruralindiaPalnitkar solarenergyindependenceasusedinruralindia
Palnitkar solarenergyindependenceasusedinruralindia
 
โครงการชลประทาน ใหม่
โครงการชลประทาน ใหม่โครงการชลประทาน ใหม่
โครงการชลประทาน ใหม่
 
โครงการชลประทาน
โครงการชลประทานโครงการชลประทาน
โครงการชลประทาน
 

Similar a Mc android

Android architecture
Android architectureAndroid architecture
Android architecture
Hari Krishna
 
Android technology
Android technologyAndroid technology
Android technology
Dhruv Modh
 

Similar a Mc android (20)

Google Android Mobile Computing
Google Android Mobile ComputingGoogle Android Mobile Computing
Google Android Mobile Computing
 
Android the future
Android  the futureAndroid  the future
Android the future
 
Second Serenoa Newsletter
Second Serenoa NewsletterSecond Serenoa Newsletter
Second Serenoa Newsletter
 
All about android
All about androidAll about android
All about android
 
Android- Introduction for Beginners
Android- Introduction for BeginnersAndroid- Introduction for Beginners
Android- Introduction for Beginners
 
VSX 2012 Desktop Virtualization 101
VSX 2012 Desktop Virtualization 101VSX 2012 Desktop Virtualization 101
VSX 2012 Desktop Virtualization 101
 
App-V og UE-V
App-V og UE-VApp-V og UE-V
App-V og UE-V
 
Brief about Windows Azure Platform
Brief about Windows Azure Platform Brief about Windows Azure Platform
Brief about Windows Azure Platform
 
Android platform
Android platform Android platform
Android platform
 
Enterprise Mobility with Sybase Unwired Platform
Enterprise Mobility with Sybase Unwired PlatformEnterprise Mobility with Sybase Unwired Platform
Enterprise Mobility with Sybase Unwired Platform
 
Android
AndroidAndroid
Android
 
Android Introduction by Kajal
Android Introduction by KajalAndroid Introduction by Kajal
Android Introduction by Kajal
 
android
androidandroid
android
 
Android architecture
Android architectureAndroid architecture
Android architecture
 
Android 1-intro n architecture
Android 1-intro n architectureAndroid 1-intro n architecture
Android 1-intro n architecture
 
Applicaton Software
Applicaton SoftwareApplicaton Software
Applicaton Software
 
Introduction to Android Development Part 1
Introduction to Android Development Part 1Introduction to Android Development Part 1
Introduction to Android Development Part 1
 
SensActions-Report
SensActions-ReportSensActions-Report
SensActions-Report
 
What are the Benefits of Java for Mobile App Development.pdf
What are the Benefits of Java for Mobile App Development.pdfWhat are the Benefits of Java for Mobile App Development.pdf
What are the Benefits of Java for Mobile App Development.pdf
 
Android technology
Android technologyAndroid technology
Android technology
 

Último

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
 
1029-Danh muc Sach Giao Khoa khoi 6.pdf
1029-Danh muc Sach Giao Khoa khoi  6.pdf1029-Danh muc Sach Giao Khoa khoi  6.pdf
1029-Danh muc Sach Giao Khoa khoi 6.pdf
QucHHunhnh
 
Activity 01 - Artificial Culture (1).pdf
Activity 01 - Artificial Culture (1).pdfActivity 01 - Artificial Culture (1).pdf
Activity 01 - Artificial Culture (1).pdf
ciinovamais
 

Último (20)

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
 
Introduction to Nonprofit Accounting: The Basics
Introduction to Nonprofit Accounting: The BasicsIntroduction to Nonprofit Accounting: The Basics
Introduction to Nonprofit Accounting: The Basics
 
Mehran University Newsletter Vol-X, Issue-I, 2024
Mehran University Newsletter Vol-X, Issue-I, 2024Mehran University Newsletter Vol-X, Issue-I, 2024
Mehran University Newsletter Vol-X, Issue-I, 2024
 
Kodo Millet PPT made by Ghanshyam bairwa college of Agriculture kumher bhara...
Kodo Millet  PPT made by Ghanshyam bairwa college of Agriculture kumher bhara...Kodo Millet  PPT made by Ghanshyam bairwa college of Agriculture kumher bhara...
Kodo Millet PPT made by Ghanshyam bairwa college of Agriculture kumher bhara...
 
Unit-IV- Pharma. Marketing Channels.pptx
Unit-IV- Pharma. Marketing Channels.pptxUnit-IV- Pharma. Marketing Channels.pptx
Unit-IV- Pharma. Marketing Channels.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
 
Key note speaker Neum_Admir Softic_ENG.pdf
Key note speaker Neum_Admir Softic_ENG.pdfKey note speaker Neum_Admir Softic_ENG.pdf
Key note speaker Neum_Admir Softic_ENG.pdf
 
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
 
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)
 
SKILL OF INTRODUCING THE LESSON MICRO SKILLS.pptx
SKILL OF INTRODUCING THE LESSON MICRO SKILLS.pptxSKILL OF INTRODUCING THE LESSON MICRO SKILLS.pptx
SKILL OF INTRODUCING THE LESSON MICRO SKILLS.pptx
 
1029-Danh muc Sach Giao Khoa khoi 6.pdf
1029-Danh muc Sach Giao Khoa khoi  6.pdf1029-Danh muc Sach Giao Khoa khoi  6.pdf
1029-Danh muc Sach Giao Khoa khoi 6.pdf
 
Activity 01 - Artificial Culture (1).pdf
Activity 01 - Artificial Culture (1).pdfActivity 01 - Artificial Culture (1).pdf
Activity 01 - Artificial Culture (1).pdf
 
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
 
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
 
SOC 101 Demonstration of Learning Presentation
SOC 101 Demonstration of Learning PresentationSOC 101 Demonstration of Learning Presentation
SOC 101 Demonstration of Learning Presentation
 
This PowerPoint helps students to consider the concept of infinity.
This PowerPoint helps students to consider the concept of infinity.This PowerPoint helps students to consider the concept of infinity.
This PowerPoint helps students to consider the concept of infinity.
 
Food safety_Challenges food safety laboratories_.pdf
Food safety_Challenges food safety laboratories_.pdfFood safety_Challenges food safety laboratories_.pdf
Food safety_Challenges food safety laboratories_.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.
 
microwave assisted reaction. General introduction
microwave assisted reaction. General introductionmicrowave assisted reaction. General introduction
microwave assisted reaction. General introduction
 
Unit-V; Pricing (Pharma Marketing Management).pptx
Unit-V; Pricing (Pharma Marketing Management).pptxUnit-V; Pricing (Pharma Marketing Management).pptx
Unit-V; Pricing (Pharma Marketing Management).pptx
 

Mc android

  • 1. Google Android Based on android-sdk_2.2 Mobile Computing Bruce Scharlau, University of Aberdeen, 2010
  • 2. Android is part of the ‘build a better phone’ process Open Handset Alliance produces Android Comprises handset manufacturers, software firms, mobile operators, and other manufactures and funding companies http://www.openhandsetalliance.com/ Bruce Scharlau, University of Aberdeen, 2010
  • 3. Android is growing Uneven distribution of OS by regions Does not include iTouch or iPad, as not smartphones http://metrics.admob.com/wp-content/uploads/2010/06/May-2010-AdMob-Mobile-Metrics-Highlights.pdf Bruce Scharlau, University of Aberdeen, 2010
  • 4. Android makes mobile Java easier Well, sort of… Bruce Scharlau, University of Aberdeen, 2010 http://code.google.com/android/goodies/index.html
  • 5. Android applications are written in Java package com.google.android.helloactivity; import android.app.Activity; import android.os.Bundle; public class HelloActivity extends Activity { public HelloActivity() { } @Override public void onCreate(Bundle icicle) { super.onCreate(icicle); setContentView(R.layout.hello_activity); } } Bruce Scharlau, University of Aberdeen, 2010
  • 6. Android applications are compiled to Dalvik bytecode Write app in Java Write app in Java Compiled in Java Compiled in Java Transformed to Dalvik bytecode Transformed to Dalvik bytecode Loaded into Dalvik VM Loaded into Dalvik VM Linux OS Bruce Scharlau, University of Aberdeen, 2010
  • 7. The Dalvik runtime is optimised for mobile applications Run multiple VMs efficiently Each app has its own VM Minimal memory footprint Bruce Scharlau, University of Aberdeen, 2010
  • 8. Android has many components Bruce Scharlau, University of Aberdeen, 2010
  • 9. Can assume that most have android 2.1 or 2.2 Bruce Scharlau, University of Aberdeen, 2010 http://developer.android.com/resources/dashboard/platform-versions.html
  • 10. Android has a working emulator Bruce Scharlau, University of Aberdeen, 2010
  • 11. All applications are written in Java and available to each other Android designed to enable reuse of components in other applications Each application can publish its capabilities which other apps can use Bruce Scharlau, University of Aberdeen, 2010
  • 12. Android applications have Views such as Views such as common structure lists, grids, text lists, grids, text An Activity Manager that An Activity Manager that boxes, buttons, boxes, buttons, manages the life cycle of manages the life cycle of and even an and even an applications and provides applications and provides embeddable web embeddable web a common navigation a common navigation browser browser backstack backstack Content Content A Notification Manager A Notification Manager Providers that Providers that that enables all apps to that enables all apps to enable enable display custom alerts in the display custom alerts in the applications to applications to status bar status bar access data from access data from other applications other applications A Resource Manager, A Resource Manager, (such as (such as providing access to non- providing access to non- Contacts), or to Contacts), or to code resources such as code resources such as share their own share their own localized strings, localized strings, data data graphics, and layout files graphics, and layout files Bruce Scharlau, University of Aberdeen, 2010
  • 13. Android applications have common structure Broadcast Broadcast Activity is the presentation Activity is the presentation receivers can receivers can layer of your app: there will layer of your app: there will trigger intents that trigger intents that be one per screen, and the be one per screen, and the start an application start an application Views provide the UI to the Views provide the UI to the activity activity Data storage Data storage provide data for provide data for Intents specify what Intents specify what your apps, and your apps, and specific action should be specific action should be can be shared can be shared performed performed between apps – between apps – database, file, database, file, and shared and shared Services run in the Services run in the preferences preferences background and have background and have (hash map) used (hash map) used no UI for the user – no UI for the user – by group of by group of they will update data, they will update data, applications applications and trigger events and trigger events Bruce Scharlau, University of Aberdeen, 2010
  • 14. There is a common file structure for applications code Autogenerated files resource list images UI layouts constants Bruce Scharlau, University of Aberdeen, 2010
  • 15. Standard components form building blocks for Android apps Notifications Has life-cycle Activity screen Views App to handle content Intents Background app Service Like music player manifest ContentProviders Other applications Bruce Scharlau, University of Aberdeen, 2010
  • 16. The AndroidManifest lists application details <?xml version="1.0" encoding="utf-8"?> <manifest xmlns:android="http://schemas.android.com/apk/res/android" package="com.my_domain.app.helloactivity"> <application android:label="@string/app_name"> <activity android:name=".HelloActivity"> <intent-filter> <action android:name="android.intent.action.MAIN"/> <category android:name="android.intent.category.LAUNCHER"/> </intent-filter> </activity> </application> Bruce Scharlau, University of Aberdeen, 2010
  • 17. Activity is one thing you can do Bruce Scharlau, University of Aberdeen, 2010 From fundamentals page in sdk
  • 18. Intent provides late running binding to other apps It can be thought of as the glue between activities. It is basically a passive data structure holding an abstract description of an action to be performed. Written as action/data pairs such as: VIEW_ACTION/ACTION content://contacts/1 Bruce Scharlau, University of Aberdeen, 2010
  • 19. Services declared in the manifest and provide support Services run in the background: Music player providing the music playing in an audio application Intensive background apps, might need to spawn their own thread so as to not block the application Bruce Scharlau, University of Aberdeen, 2010
  • 20. Notifications let you know of background events This way you know that an SMS arrived, or that your phone is ringing, and the MP3 player should pause Bruce Scharlau, University of Aberdeen, 2010
  • 21. ContentProviders share data You need one if your application shares data with other applications This way you can share the contact list with the IM application If you don’t need to share data, then you can use SQLlite database Bruce Scharlau, University of Aberdeen, 2010
  • 22. UI layouts are in Java and XML setContentView(R.layout.hello_activity); //will load the XML UI file Bruce Scharlau, University of Aberdeen, 2010
  • 23. Security in Android follows standard Linux guidelines Each application runs in its own process Process permissions are enforced at user and group IDs assigned to processes Finer grained permissions are then granted (revoked) per operations <manifest xmlns:android="http://schemas.android.com/apk/res/android" <manifest xmlns:android="http://schemas.android.com/apk/res/android" package="com.google.android.app.myapp" > package="com.google.android.app.myapp" > <uses-permission id="android.permission.RECEIVE_SMS" /> <uses-permission id="android.permission.RECEIVE_SMS" /> </manifest> </manifest> Bruce Scharlau, University of Aberdeen, 2010
  • 24. There are lots of sources of information • The sdk comes with the API references, sample applications and lots of docs • Blog http://android-developers.blogspot.com/ which has lots of useful examples, details • There is http://www.anddev.org Bruce Scharlau, University of Aberdeen, 2010