0
Introduction to Android     Development         Can Elmas        March 07, 2012
Who am I ?• 2008 GSU graduate• Software Development Team Leader at Pozitron   – http://www.pozitron.com• Interest in mobil...
Agenda• What is Android?• Why Android?• Android Architecture• Android Building Blocks• Demo
What is Android ?
What is Android?• Software stack for mobile devices including an  operating system, middleware , key applications  and ric...
What is Android?• Based on Linux Kernel• Security, Memory Management, Process Management,  Network Stack, Driver stack• No...
What is Android?• Applications written primarily in customized version of  Java• No, android is not Java   – Uses Java lan...
What is Android?• Free and open   – No need of any user id or account for SDK access   – Source at http://source.android.c...
What is Android?• Android Market, 450.000 apps as of February  2012• 850.000 devices activated every day,  according to Go...
What is Android?• Mulitasking• Integrated browser based on WebKit Engine• 3d Graphics based on the OpenGL Es• SQLite• Came...
Why Android?
Why Android?• Free SDK   – Available at http://developer.android.com• Open Source• All applications are equal• Dalvik Virt...
Why Android?• Rich Development Environment   – Full Device Emulator   – Tools for debugging DDMS (Dalvik Debug Monitor Ser...
Android Architecture
Android Architecture• Relies on Linux kernel version 2.6 for core system services• Every Android application runs on its o...
Android Building Blocks
Vocabulary• Activity• Views• Resources• Intents• Intent Filters• AndroidManifest.xml
Activity• What the user see on the screen• An Android application with User Interface  consists of one or more Activities.
Activity
Activity
Activity• Moving through screens is by starting new activities• Managed as an activity stack• LIFO (Last In First Out)• On...
Source : http://developer.android.com
Activity States• Active   – At the top of the stack• Paused   – Lost focusbut still visible   – Can be killed by Low Memor...
Activity• An empty activity with no content
Views• Views are basic UI building blocks• They know how to draw themselves   – Android framework responsible for measurin...
Views• Views and view groups trees build up complex GUIs : widgets  – android.widget.ListView  – android.widget.TextView  ...
Views• Subclasses of ViewGroup, Layouts• Standard layouts :  – LinearLayout  – FrameLayout  – TableLayout  – RelativeLayou...
Views• Android UI in XML : /res/layout/main_act.xml
Resources• External sources other than your code  (images, views and layouts in xml, strings  etc.) should be externalized...
Resources• Accessing application resources :  – R class• All reources IDs are defined in R class, which is  automatically ...
Activity• An empty activity with no content
Activity
Activity
Intents• An Intention to do something• Abstract description of an operation to be performed• A message to the OS that you ...
Intents• Facilitates app to app communication• Primary Attributes  – Action     • The general action to be performed  – Da...
Intent Filters• Description of what intent an activity is  capable of handling
Intent Filters
AndroidManifest .xml• Description of the android application including  activities, intent receivers, permissions, applica...
AndroidManifest.xml
More Advanced Topics• How Android deal with Fragmentation?  – API Levels (Cupcake, Donut, Eclair, Froyo,    Gingerbread, H...
More Advanced Topics• Single Threaded UI Model• APK (Android Package)• Application Signing
Thank you• We’re Hiring  – http://pozitron.com/careers.php  – ik@pozitron.com• Twitter  – @foragoodpurpose  – @Pozitron_Mo...
Demo• Phase 1:  – Create a new Android project with package name    com.gsuandroid.activities  – Create a new Activity cal...
Demo• Phase 2:   – Create another activity called ActTwo   – Create a layout for your new activity containing a TextView  ...
Demo• Phase 3:  – Pass a text message “That’s it for today” when    moving from MainActivity to ActTwo  – Run your applica...
Full Code
main_act.xml
act_two.xml
Introduction to Android Development
Introduction to Android Development
Introduction to Android Development
Introduction to Android Development
Upcoming SlideShare
Loading in...5
×

Introduction to Android Development

874

Published on

Introduction to Android Development - Galatasaray University

Published in: Technology
0 Comments
4 Likes
Statistics
Notes
  • Be the first to comment

No Downloads
Views
Total Views
874
On Slideshare
0
From Embeds
0
Number of Embeds
0
Actions
Shares
0
Downloads
36
Comments
0
Likes
4
Embeds 0
No embeds

No notes for slide

Transcript of "Introduction to Android Development"

  1. 1. Introduction to Android Development Can Elmas March 07, 2012
  2. 2. Who am I ?• 2008 GSU graduate• Software Development Team Leader at Pozitron – http://www.pozitron.com• Interest in mobile platforms• Experience with mobile platforms such as Symbian (Java ME), BlackBerry and Android• Experience with server side development
  3. 3. Agenda• What is Android?• Why Android?• Android Architecture• Android Building Blocks• Demo
  4. 4. What is Android ?
  5. 5. What is Android?• Software stack for mobile devices including an operating system, middleware , key applications and rich set of APIs• Project by Open Handset Alliance led by Google, a consortium of 86 companies (Samsung, Motorola, Sony, HTC, LG, Dell, Intel, Nvidia etc.)• First Release in November 2007
  6. 6. What is Android?• Based on Linux Kernel• Security, Memory Management, Process Management, Network Stack, Driver stack• No, Android is not Linux (No native windowing system, no glibc, no standard GNU/linux utilities)• Linux Kernel enhancements (alarm, ashmem, power management, low memory killer - no swap space)• Robust and proven over time
  7. 7. What is Android?• Applications written primarily in customized version of Java• No, android is not Java – Uses Java language – Implements part of the Java 5 SE specification (Collections, generics support) – Runs on Dalvik Virtual Machine instead of JVM – Multiple VMs
  8. 8. What is Android?• Free and open – No need of any user id or account for SDK access – Source at http://source.android.com• Rich Developer Community• Cheaper and more innovative Mobile Devices• Extendable – Players can add proprietary functionality to their products – Companies can remove functionality if they choose
  9. 9. What is Android?• Android Market, 450.000 apps as of February 2012• 850.000 devices activated every day, according to Google’s Andy Rubin
  10. 10. What is Android?• Mulitasking• Integrated browser based on WebKit Engine• 3d Graphics based on the OpenGL Es• SQLite• Camera, GPS, compass and accelerometer
  11. 11. Why Android?
  12. 12. Why Android?• Free SDK – Available at http://developer.android.com• Open Source• All applications are equal• Dalvik Virtual Machine• Development on Windows, Linux or Mac OS• Starting development easy and cheap
  13. 13. Why Android?• Rich Development Environment – Full Device Emulator – Tools for debugging DDMS (Dalvik Debug Monitor Server) – Memory and performance profiling• Rich Documentation• Very large community and target audience• Open Market Place – Instant publishing
  14. 14. Android Architecture
  15. 15. Android Architecture• Relies on Linux kernel version 2.6 for core system services• Every Android application runs on its own process, with its own Dalvik Virtual Machine• C/C++ libraries (Surface Manager , Media Libraries, SQLite etc.)• Native set of core applications including email client, SMS, Calendar, maps, browser, contacts and others
  16. 16. Android Building Blocks
  17. 17. Vocabulary• Activity• Views• Resources• Intents• Intent Filters• AndroidManifest.xml
  18. 18. Activity• What the user see on the screen• An Android application with User Interface consists of one or more Activities.
  19. 19. Activity
  20. 20. Activity
  21. 21. Activity• Moving through screens is by starting new activities• Managed as an activity stack• LIFO (Last In First Out)• Only one is visible• Only one is active• Activity Lifecycle
  22. 22. Source : http://developer.android.com
  23. 23. Activity States• Active – At the top of the stack• Paused – Lost focusbut still visible – Can be killed by Low Memory Killer• Stopped – Not at the top of the stack• Dropped – Killed to reclaim its memory
  24. 24. Activity• An empty activity with no content
  25. 25. Views• Views are basic UI building blocks• They know how to draw themselves – Android framework responsible for measuring, laying out and drawing• Respond to events• Implementation : – Java code – XML – Separation of presentation of the application from the code controlling the behavior. – Ease of visualization of the UI structure – Strings, color, styles, shapes, animations etc can be described as XML
  26. 26. Views• Views and view groups trees build up complex GUIs : widgets – android.widget.ListView – android.widget.TextView – android.widget.Button – android.widget.ImageView
  27. 27. Views• Subclasses of ViewGroup, Layouts• Standard layouts : – LinearLayout – FrameLayout – TableLayout – RelativeLayout – AbsoluteLayout
  28. 28. Views• Android UI in XML : /res/layout/main_act.xml
  29. 29. Resources• External sources other than your code (images, views and layouts in xml, strings etc.) should be externalized, so that you can maintain them independently
  30. 30. Resources• Accessing application resources : – R class• All reources IDs are defined in R class, which is automatically generated by Android aapt tool
  31. 31. Activity• An empty activity with no content
  32. 32. Activity
  33. 33. Activity
  34. 34. Intents• An Intention to do something• Abstract description of an operation to be performed• A message to the OS that you want to do something (pre-defined action)• Used to move from one Activity to another
  35. 35. Intents• Facilitates app to app communication• Primary Attributes – Action • The general action to be performed – Data • The data to operate on (a contact, an url, the new activity etc.)
  36. 36. Intent Filters• Description of what intent an activity is capable of handling
  37. 37. Intent Filters
  38. 38. AndroidManifest .xml• Description of the android application including activities, intent receivers, permissions, application icon, application name, version information etc.• It’s the glue that specifies which Intents your activities might receive• An activity should be declared as the main entry point
  39. 39. AndroidManifest.xml
  40. 40. More Advanced Topics• How Android deal with Fragmentation? – API Levels (Cupcake, Donut, Eclair, Froyo, Gingerbread, Honeycomb, Ice Cream Sandwich)• How are the resources selected at run time according to different screen sizes and densities?
  41. 41. More Advanced Topics• Single Threaded UI Model• APK (Android Package)• Application Signing
  42. 42. Thank you• We’re Hiring – http://pozitron.com/careers.php – ik@pozitron.com• Twitter – @foragoodpurpose – @Pozitron_Mobile
  43. 43. Demo• Phase 1: – Create a new Android project with package name com.gsuandroid.activities – Create a new Activity called MainActivity – Create a layout for MainActivity which will consist of a LinearLayout containing a TextView with predefined text “Hello Android” – Run your application
  44. 44. Demo• Phase 2: – Create another activity called ActTwo – Create a layout for your new activity containing a TextView without setting a text in XML – Modify your MainActivity’s layout xml in and add a Button with setting and id, android:id="@+id/btn_go_to_act_two » and text « Go to Next Activity» – Start ActTwo when user presses button inserted in the MainActivity – Run your application
  45. 45. Demo• Phase 3: – Pass a text message “That’s it for today” when moving from MainActivity to ActTwo – Run your application
  46. 46. Full Code
  47. 47. main_act.xml
  48. 48. act_two.xml
  1. A particular slide catching your eye?

    Clipping is a handy way to collect important slides you want to go back to later.

×