SlideShare una empresa de Scribd logo
1 de 38
Descargar para leer sin conexión
Programmierung
                                     von Apps
                               Android Application Framework
Danny Fürniß, 28.10..2012, 1
Die Studierenden
                                  kennen die Bausteine des
                               Android Application Framework
                               und verstehen, wie sich daraus
                                eine Android App zusammen-
                                        bauen lässt.
Danny Fürniß, 28.10..2012, 2
Android
                               Application Framework
Danny Fürniß, 28.10..2012, 3




                               Bildquelle: http://s31.a2zinc.net/clients/ezlandscape/congress12/public/Content.aspx?ID=3577&sortMenu=104000
BAUSTEINE
Danny Fürniß, 28.10..2012, 4




                                Bildquelle: http://developer.android.com/guide/basics/what-is-android.html
Woraus besteht eine
                                 Android App?
Danny Fürniß, 28.10..2012, 5




                               Bildquelle: http://ecom-software.com/2114-android-mega-games-pack-87-games-july-2011-pdu.html
Danny Fürniß, 28.10..2012, 6




                               Sicht
                               Kontext
Danny Fürniß, 28.10..2012, 7




                               Black Box Sicht
Black Box Sicht
                                                    ContentProviders




                               BroadcastReceivers                         AndroidManifest.xml




                                                    Activities/Services
Danny Fürniß, 28.10..2012, 8
Black Box Sicht
                                                    ContentProviders




                               BroadcastReceivers                         AndroidManifest.xml




                                                    Activities/Services
Danny Fürniß, 28.10..2012, 9
AndroidManifest.xml
                                <manifest
                                       package=„com.dfuerniss.app“
                                       <uses-permission>
                                       <uses-feature>
                                       <supports-screens>
                                       <application>
                                              <activitiy>
                                              <service>
                                              <receiver>
                                              <provider>
Danny Fürniß, 28.10..2012, 10




                                       <uses-sdk>
                                       …
<manifest>
                                package
                                xmlns:android
                                versionCode
                                versionName
                                installLocation
                                …
Danny Fürniß, 28.10..2012, 11




                                     http://developer.android.com/guide/topics/m
                                     anifest/manifest‐intro.html
<uses-permission>
                                android.permission.INTERNET
                                android.permission.ACCESS_NETWORK_STATE
                                android.permission.USE_CREDENTIALS
                                android.permission.AUTHENTICATE_ACCOUNTS
                                android.permission.READ_CONTACTS
                                android.permission.WRITE_CONTACTS
                                android.permission.WRITE_EXTERNAL_STORAGE
                                …
Danny Fürniß, 28.10..2012, 12




                                  http://developer.android.com/reference
                                     /android/Manifest.permission.html
Application Object




                                                       Klasse
                                public class PVAUebungApplication extends application…
Danny Fürniß, 28.10..2012, 13




                                                 AndroidManifest.xml
                                 <application android:name=„PVAUebungApplication“…
Danny Fürniß, 28.10..2012, 14




                                Resources
Resource Types

                                                      res/animator
                                                          res/anim
                                                          res/color
                                                       res/drawable
                                                         res/layout
                                                         res/menu
                                                           res/raw
                                                         res/values
                                                           res/xml
Danny Fürniß, 28.10..2012, 15




                                Quelle: http://developer.android.com/guide/topics/resources/providing-resources.html
Resource Qualifiers

                                Language/Region                                            /values‐en‐rUS

                                Screen‐Size                                                /layout‐xlarge

                                Screen‐Orientation                                         /layout‐land

                                Platform‐Version                                           /color‐v13

                                etc.                                                       etc.
Danny Fürniß, 28.10..2012, 16




                                       Quelle: http://developer.android.com/guide/topics/resources/providing-resources.html
R.java (generated)
                                public final class R {
                                  public static final class color {
                                    public static final int background_gradient_66=0x7f060001;
                                    public static final int bar_color=0x7f060003;
                                  }
                                  public static final class dimen {
                                    public static final int text_size_large=0x7f070004;
                                    public static final int text_size_small=0x7f070002;
                                  }
                                  public static final class drawable {
                                    public static final int chart_bar_gradient_co2=0x7f020001;
                                    public static final int chart_bar_gradient_gp=0x7f020002;
                                    public static final int chart_bar_gradient_ht=0x7f020003;
Danny Fürniß, 28.10..2012, 17




                                    public static final int chart_bar_gradient_nt=0x7f020004;
                                  }
                                }
Danny Fürniß, 28.10..2012, 18




                                Activities
Activity
                                Lifecycle
Danny Fürniß, 28.10..2012, 19




                                Siehe auch „Learning Android“, S. 29
onSaveInstanceState()



                                   onCreate(Bundle
                                 savedInstanceState)
Danny Fürniß, 28.10..2012, 20
Danny Fürniß, 28.10..2012, 21




                                Fragments
Danny Fürniß, 28.10..2012, 22




                                Lifecycle
                                Fragment
Danny Fürniß, 28.10..2012, 23




                                Loaders
Danny Fürniß, 28.10..2012, 24




                                Intents
Danny Fürniß, 28.10..2012, 25




                                Explizite Intents
Danny Fürniß, 28.10..2012, 26




                                Implizite Intents
PendingIntent
                                Intent intent = new Intent(context, DashboardActivity.class)

                                PendingIntent pendingIntent =
                                  PendingIntent.getActivity(context, 0, intent,
                                    PendingIntent.FLAG_ONE_SHOT)
Danny Fürniß, 28.10..2012, 27
Danny Fürniß, 28.10..2012, 28




                                startActivityForResult()
Danny Fürniß, 28.10..2012, 29




                                Services
Services
Danny Fürniß, 28.10..2012, 30




                                Threading berücksichtigen!
Danny Fürniß, 28.10..2012, 31




                                Local Service
Danny Fürniß, 28.10..2012, 32




                                Remote Service
Intent Service
Danny Fürniß, 28.10..2012, 33




                                public class FetchDataService extends IntentService
Danny Fürniß, 28.10..2012, 34




                                Receivers
                                Broadcast
Konfiguration über
                                   Intent-Filter
Danny Fürniß, 28.10..2012, 35




                                    Permission ACCESS_NETWORK_STATE notwendig
Danny Fürniß, 28.10..2012, 36




                                Content Providers
Danny Fürniß, 28.10..2012, 37




                                ContentProvider
Portions of this presentation
                                are modifications based on
                                work created and shared by
                                Google and used according
                                    to terms described in
                                 the Creative Commons 3.0
                                     Attribution License.
Danny Fürniß, 28.10..2012, 38

Más contenido relacionado

Destacado

Product Design Trends in 2024 | Teenage Engineerings
Product Design Trends in 2024 | Teenage EngineeringsProduct Design Trends in 2024 | Teenage Engineerings
Product Design Trends in 2024 | Teenage EngineeringsPixeldarts
 
How Race, Age and Gender Shape Attitudes Towards Mental Health
How Race, Age and Gender Shape Attitudes Towards Mental HealthHow Race, Age and Gender Shape Attitudes Towards Mental Health
How Race, Age and Gender Shape Attitudes Towards Mental HealthThinkNow
 
AI Trends in Creative Operations 2024 by Artwork Flow.pdf
AI Trends in Creative Operations 2024 by Artwork Flow.pdfAI Trends in Creative Operations 2024 by Artwork Flow.pdf
AI Trends in Creative Operations 2024 by Artwork Flow.pdfmarketingartwork
 
PEPSICO Presentation to CAGNY Conference Feb 2024
PEPSICO Presentation to CAGNY Conference Feb 2024PEPSICO Presentation to CAGNY Conference Feb 2024
PEPSICO Presentation to CAGNY Conference Feb 2024Neil Kimberley
 
Content Methodology: A Best Practices Report (Webinar)
Content Methodology: A Best Practices Report (Webinar)Content Methodology: A Best Practices Report (Webinar)
Content Methodology: A Best Practices Report (Webinar)contently
 
How to Prepare For a Successful Job Search for 2024
How to Prepare For a Successful Job Search for 2024How to Prepare For a Successful Job Search for 2024
How to Prepare For a Successful Job Search for 2024Albert Qian
 
Social Media Marketing Trends 2024 // The Global Indie Insights
Social Media Marketing Trends 2024 // The Global Indie InsightsSocial Media Marketing Trends 2024 // The Global Indie Insights
Social Media Marketing Trends 2024 // The Global Indie InsightsKurio // The Social Media Age(ncy)
 
Trends In Paid Search: Navigating The Digital Landscape In 2024
Trends In Paid Search: Navigating The Digital Landscape In 2024Trends In Paid Search: Navigating The Digital Landscape In 2024
Trends In Paid Search: Navigating The Digital Landscape In 2024Search Engine Journal
 
5 Public speaking tips from TED - Visualized summary
5 Public speaking tips from TED - Visualized summary5 Public speaking tips from TED - Visualized summary
5 Public speaking tips from TED - Visualized summarySpeakerHub
 
ChatGPT and the Future of Work - Clark Boyd
ChatGPT and the Future of Work - Clark Boyd ChatGPT and the Future of Work - Clark Boyd
ChatGPT and the Future of Work - Clark Boyd Clark Boyd
 
Getting into the tech field. what next
Getting into the tech field. what next Getting into the tech field. what next
Getting into the tech field. what next Tessa Mero
 
Google's Just Not That Into You: Understanding Core Updates & Search Intent
Google's Just Not That Into You: Understanding Core Updates & Search IntentGoogle's Just Not That Into You: Understanding Core Updates & Search Intent
Google's Just Not That Into You: Understanding Core Updates & Search IntentLily Ray
 
Time Management & Productivity - Best Practices
Time Management & Productivity -  Best PracticesTime Management & Productivity -  Best Practices
Time Management & Productivity - Best PracticesVit Horky
 
The six step guide to practical project management
The six step guide to practical project managementThe six step guide to practical project management
The six step guide to practical project managementMindGenius
 
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...RachelPearson36
 
Unlocking the Power of ChatGPT and AI in Testing - A Real-World Look, present...
Unlocking the Power of ChatGPT and AI in Testing - A Real-World Look, present...Unlocking the Power of ChatGPT and AI in Testing - A Real-World Look, present...
Unlocking the Power of ChatGPT and AI in Testing - A Real-World Look, present...Applitools
 
12 Ways to Increase Your Influence at Work
12 Ways to Increase Your Influence at Work12 Ways to Increase Your Influence at Work
12 Ways to Increase Your Influence at WorkGetSmarter
 

Destacado (20)

Product Design Trends in 2024 | Teenage Engineerings
Product Design Trends in 2024 | Teenage EngineeringsProduct Design Trends in 2024 | Teenage Engineerings
Product Design Trends in 2024 | Teenage Engineerings
 
How Race, Age and Gender Shape Attitudes Towards Mental Health
How Race, Age and Gender Shape Attitudes Towards Mental HealthHow Race, Age and Gender Shape Attitudes Towards Mental Health
How Race, Age and Gender Shape Attitudes Towards Mental Health
 
AI Trends in Creative Operations 2024 by Artwork Flow.pdf
AI Trends in Creative Operations 2024 by Artwork Flow.pdfAI Trends in Creative Operations 2024 by Artwork Flow.pdf
AI Trends in Creative Operations 2024 by Artwork Flow.pdf
 
Skeleton Culture Code
Skeleton Culture CodeSkeleton Culture Code
Skeleton Culture Code
 
PEPSICO Presentation to CAGNY Conference Feb 2024
PEPSICO Presentation to CAGNY Conference Feb 2024PEPSICO Presentation to CAGNY Conference Feb 2024
PEPSICO Presentation to CAGNY Conference Feb 2024
 
Content Methodology: A Best Practices Report (Webinar)
Content Methodology: A Best Practices Report (Webinar)Content Methodology: A Best Practices Report (Webinar)
Content Methodology: A Best Practices Report (Webinar)
 
How to Prepare For a Successful Job Search for 2024
How to Prepare For a Successful Job Search for 2024How to Prepare For a Successful Job Search for 2024
How to Prepare For a Successful Job Search for 2024
 
Social Media Marketing Trends 2024 // The Global Indie Insights
Social Media Marketing Trends 2024 // The Global Indie InsightsSocial Media Marketing Trends 2024 // The Global Indie Insights
Social Media Marketing Trends 2024 // The Global Indie Insights
 
Trends In Paid Search: Navigating The Digital Landscape In 2024
Trends In Paid Search: Navigating The Digital Landscape In 2024Trends In Paid Search: Navigating The Digital Landscape In 2024
Trends In Paid Search: Navigating The Digital Landscape In 2024
 
5 Public speaking tips from TED - Visualized summary
5 Public speaking tips from TED - Visualized summary5 Public speaking tips from TED - Visualized summary
5 Public speaking tips from TED - Visualized summary
 
ChatGPT and the Future of Work - Clark Boyd
ChatGPT and the Future of Work - Clark Boyd ChatGPT and the Future of Work - Clark Boyd
ChatGPT and the Future of Work - Clark Boyd
 
Getting into the tech field. what next
Getting into the tech field. what next Getting into the tech field. what next
Getting into the tech field. what next
 
Google's Just Not That Into You: Understanding Core Updates & Search Intent
Google's Just Not That Into You: Understanding Core Updates & Search IntentGoogle's Just Not That Into You: Understanding Core Updates & Search Intent
Google's Just Not That Into You: Understanding Core Updates & Search Intent
 
How to have difficult conversations
How to have difficult conversations How to have difficult conversations
How to have difficult conversations
 
Introduction to Data Science
Introduction to Data ScienceIntroduction to Data Science
Introduction to Data Science
 
Time Management & Productivity - Best Practices
Time Management & Productivity -  Best PracticesTime Management & Productivity -  Best Practices
Time Management & Productivity - Best Practices
 
The six step guide to practical project management
The six step guide to practical project managementThe six step guide to practical project management
The six step guide to practical project management
 
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
 
Unlocking the Power of ChatGPT and AI in Testing - A Real-World Look, present...
Unlocking the Power of ChatGPT and AI in Testing - A Real-World Look, present...Unlocking the Power of ChatGPT and AI in Testing - A Real-World Look, present...
Unlocking the Power of ChatGPT and AI in Testing - A Real-World Look, present...
 
12 Ways to Increase Your Influence at Work
12 Ways to Increase Your Influence at Work12 Ways to Increase Your Influence at Work
12 Ways to Increase Your Influence at Work
 

Android Application Framework

  • 1. Programmierung von Apps Android Application Framework Danny Fürniß, 28.10..2012, 1
  • 2. Die Studierenden kennen die Bausteine des Android Application Framework und verstehen, wie sich daraus eine Android App zusammen- bauen lässt. Danny Fürniß, 28.10..2012, 2
  • 3. Android Application Framework Danny Fürniß, 28.10..2012, 3 Bildquelle: http://s31.a2zinc.net/clients/ezlandscape/congress12/public/Content.aspx?ID=3577&sortMenu=104000
  • 4. BAUSTEINE Danny Fürniß, 28.10..2012, 4 Bildquelle: http://developer.android.com/guide/basics/what-is-android.html
  • 5. Woraus besteht eine Android App? Danny Fürniß, 28.10..2012, 5 Bildquelle: http://ecom-software.com/2114-android-mega-games-pack-87-games-july-2011-pdu.html
  • 7. Danny Fürniß, 28.10..2012, 7 Black Box Sicht
  • 8. Black Box Sicht ContentProviders BroadcastReceivers AndroidManifest.xml Activities/Services Danny Fürniß, 28.10..2012, 8
  • 9. Black Box Sicht ContentProviders BroadcastReceivers AndroidManifest.xml Activities/Services Danny Fürniß, 28.10..2012, 9
  • 10. AndroidManifest.xml <manifest package=„com.dfuerniss.app“ <uses-permission> <uses-feature> <supports-screens> <application> <activitiy> <service> <receiver> <provider> Danny Fürniß, 28.10..2012, 10 <uses-sdk> …
  • 11. <manifest> package xmlns:android versionCode versionName installLocation … Danny Fürniß, 28.10..2012, 11 http://developer.android.com/guide/topics/m anifest/manifest‐intro.html
  • 12. <uses-permission> android.permission.INTERNET android.permission.ACCESS_NETWORK_STATE android.permission.USE_CREDENTIALS android.permission.AUTHENTICATE_ACCOUNTS android.permission.READ_CONTACTS android.permission.WRITE_CONTACTS android.permission.WRITE_EXTERNAL_STORAGE … Danny Fürniß, 28.10..2012, 12 http://developer.android.com/reference /android/Manifest.permission.html
  • 13. Application Object Klasse public class PVAUebungApplication extends application… Danny Fürniß, 28.10..2012, 13 AndroidManifest.xml <application android:name=„PVAUebungApplication“…
  • 15. Resource Types res/animator res/anim res/color res/drawable res/layout res/menu res/raw res/values res/xml Danny Fürniß, 28.10..2012, 15 Quelle: http://developer.android.com/guide/topics/resources/providing-resources.html
  • 16. Resource Qualifiers Language/Region /values‐en‐rUS Screen‐Size /layout‐xlarge Screen‐Orientation /layout‐land Platform‐Version /color‐v13 etc. etc. Danny Fürniß, 28.10..2012, 16 Quelle: http://developer.android.com/guide/topics/resources/providing-resources.html
  • 17. R.java (generated) public final class R { public static final class color { public static final int background_gradient_66=0x7f060001; public static final int bar_color=0x7f060003; } public static final class dimen { public static final int text_size_large=0x7f070004; public static final int text_size_small=0x7f070002; } public static final class drawable { public static final int chart_bar_gradient_co2=0x7f020001; public static final int chart_bar_gradient_gp=0x7f020002; public static final int chart_bar_gradient_ht=0x7f020003; Danny Fürniß, 28.10..2012, 17 public static final int chart_bar_gradient_nt=0x7f020004; } }
  • 19. Activity Lifecycle Danny Fürniß, 28.10..2012, 19 Siehe auch „Learning Android“, S. 29
  • 20. onSaveInstanceState() onCreate(Bundle savedInstanceState) Danny Fürniß, 28.10..2012, 20
  • 22. Danny Fürniß, 28.10..2012, 22 Lifecycle Fragment
  • 25. Danny Fürniß, 28.10..2012, 25 Explizite Intents
  • 26. Danny Fürniß, 28.10..2012, 26 Implizite Intents
  • 27. PendingIntent Intent intent = new Intent(context, DashboardActivity.class) PendingIntent pendingIntent = PendingIntent.getActivity(context, 0, intent, PendingIntent.FLAG_ONE_SHOT) Danny Fürniß, 28.10..2012, 27
  • 28. Danny Fürniß, 28.10..2012, 28 startActivityForResult()
  • 30. Services Danny Fürniß, 28.10..2012, 30 Threading berücksichtigen!
  • 31. Danny Fürniß, 28.10..2012, 31 Local Service
  • 32. Danny Fürniß, 28.10..2012, 32 Remote Service
  • 33. Intent Service Danny Fürniß, 28.10..2012, 33 public class FetchDataService extends IntentService
  • 34. Danny Fürniß, 28.10..2012, 34 Receivers Broadcast
  • 35. Konfiguration über Intent-Filter Danny Fürniß, 28.10..2012, 35 Permission ACCESS_NETWORK_STATE notwendig
  • 36. Danny Fürniß, 28.10..2012, 36 Content Providers
  • 37. Danny Fürniß, 28.10..2012, 37 ContentProvider
  • 38. Portions of this presentation are modifications based on work created and shared by Google and used according to terms described in the Creative Commons 3.0 Attribution License. Danny Fürniß, 28.10..2012, 38