Android Overview

1,891 views

Published on

Introduction to Android programming.

0 Comments
0 Likes
Statistics
Notes
  • Be the first to comment

  • Be the first to like this

No Downloads
Views
Total views
1,891
On SlideShare
0
From Embeds
0
Number of Embeds
13
Actions
Shares
0
Downloads
67
Comments
0
Likes
0
Embeds 0
No embeds

No notes for slide

Android Overview

  1. 1. Android  Overview   Jussi  Pohjolainen  
  2. 2. What  is  Android?   •  Android  is  a  free  open  source  mobile   opera<ng  system  using  modified  version  of   the  Linux  Kernel   – Google  apps  are  not  open  source  (Market,  Gmail,   Maps)   •  Offers  full  stack:  OS,  middleware,  apps,  sdk..   •  Developers  write  apps  using  Java  language   and  Google  Java  libraries   – OS,  middleware,  key  mobile  apps  
  3. 3. PlaMorm  Versions  (Feb  24th,  2015)  
  4. 4. Architecture   WriUen   in  Java   APIs  for   program mers   UI  elements  Access  data  from   another  apps   Access  to  non-­‐ code  resources   Lifecycle  of  Apps   Display   alerts   C   Libraries   Core   libraries   and  VM   Kernel  
  5. 5. Linux  Kernel  on  Android   •  Has  standard  Linux  kernel  with  kernel   enhancements  to  support  Android   •  No  standard  GNU  C  (glibc)  Library  support   –  Uses  custom  libc  (bionic  libc)  because  of  performance   and  licensing  issues   •  No  na<ve  windowing  system   •  Does  not  include  full  set  of  standard  Linux   u<li<es   •  To  access  shell,  use  adb shell  command  
  6. 6. Dalvik  VM   •  Dalvik  VM  is  a  so]ware  that  runs  the  apps  on  android   devices   –  Dalvik  can  be  found  on  phones,  tablets,  TVs   •  Not  Java  VM!   –  Designed  for  slow  CPUs  and  liUle  RAM   •  Programs  are  wriUen  with  Java,  compiled  to  bytecode   and  then  converted  to  Dalvik  executable  files  (.dex)   –  .java  -­‐>  .class  -­‐>  .dex   •  The  .dex  files  and  resources  are  zipped  into  android   packages  (.apk)   –  *.dex  -­‐>  myapp.apk    
  7. 7. Distribu<on   •  You  have  several  op<ons  for  distribu<on   –  .apk  files  can  be  installed  via  memory  card,  web  sites,   e-­‐mail   –  App  stores   •  Several  stores  available   –  Google  Play  Store   –  Amazon  App  Store   –  GetJar  App  Store   –  Samsung  Apps   –  (  Nokia  Store  )  
  8. 8. Google  Play  (Android  Market)   •  Google  Play  is  an  online  so]ware  store  developed  by   Google   –  Music,  Books,  Magazines,  Movies  and  Apps   •  Preinstalled  on  some  Android  devices   •  To  publish,  developer  must  pay  ~16€  (Visa,  Visa   Electron)   •  Developer  gets  70%  of  the  app  price   •  No  human  verifica<on;  apps  are  uploaded  to  store   immediately!  
  9. 9. ANDROID  TOOLS  
  10. 10. Tools   •  SDK  Tools  (Google)   – Standalone  command  line  tools  for  building   android  apps   •  IDE   – Android  Studio  (Google)   •  This  will  install  also  SDK  Tools  on  startup   – Eclipse  (requires  plugin)   – IntelliJ  Idea  
  11. 11. SDK  tools   •  SDK  tools  are  all  you  need   •  Contains  all  necessary  command  line  tools  for   building  and  running  your  apps   •  When  SDK  tools  are  downloaded  and   installed,  you  must   – Install  Android  PlaMorm   – Configure  emulator  
  12. 12. SDK  Tools  
  13. 13. Command  Line  Tools:  tools/
  14. 14. Command  Line  Tools:  platform-tools/
  15. 15. Install  PlaMorms   •  To  install  plaMorms  (2.2,   …  4.4),  open  SDK   Manager   •  How?   –  android sdk •  Select  the  plaMorms   you  like  to  install
  16. 16. plaMorms/  
  17. 17. Create  and  Configure  Emulators   •  To  create  and  configure   emulators  (android   virtual  devices)   –  android avd •  Click  "New…"  to  create   new  virtual  device
  18. 18. Virtual  Device  is  SLOW….   •  Don't  use  virtual  device,  use   real  device   •  Use  HAXM!   •  Buy  SSD   •  [x]  Snapshot  saves  a  snapshot   of  emulators  RAM  (hibernate)   –  Speeds  up  boo<ng   •  [x]  Use  Host  GPU  uses  host   computer's  graphics  card   –  Speeds  up  all  graphics   opera<ons   •  You  cannot  have  both  of  these   on  at  the  same  <me!  
  19. 19. HAXM?   •  Download  HAXM  using   SDK  Manager   •  Install  it   •  Configure  your  editor  to   use  INTEL  cpu   •  When  launching  the   emulator  you  should   see  something  like  HAX   is  working  
  20. 20. Genymo<on   •  Fast  third-­‐party  emulator  to  run  and  test  your   apps   •  20  pre-­‐configured  devices   •  Resizable  windows   •  Sensor  emula<on,  mul<-­‐touch,  camera,  etc.   •  Free  for  personal  use    
  21. 21. Android  Studio   •  Installs  SDK  Tools   – Mac:  /Users/<user>/Library/Android/sdk   – Win:  /Users/<user>/sdk   •  Features   – GitHub  integra<on   – Build  apps  for  phones,  TV,  Google  Glass   – BeUer  virtual  device  manager   – Layout  editor   – Built  on  top  of  IntelliJ  IDEA  
  22. 22. CREATING  ANDROID  APP   COMMAND  LINE  
  23. 23. Android  SDK  Essen<al  Tools   •  android –  To  create/update  Android  projects  and  modify  Android  Virtual   Devices   •  Android  Emulator   –  To  run  your  app   •  adb  (Android  Debug  Bridge)   –  Interface  between  emulator  or  device.  Install  apps,  shell  the   device,  issue  commands   •  Other  needed  tools   –  Ant   •  To  compile  and  build  your  apps   –  Keytool  and  Jarsigner   •  To  sign  your  .apk  package  
  24. 24. Crea<ng  Project:  Targets  
  25. 25. Crea<ng  Project  
  26. 26. Result  
  27. 27. Building   •  Install  Ant   – http://ant.apache.org/bindownload.cgi •  For  debug:   – ant debug •  For  release   – ant release •  Release  version  must  signed  using  keytool  and   jarsigner  
  28. 28. Building  
  29. 29. Result  
  30. 30. Android  Virtual  Devices   •  To  run  the  emulator,  you  must  configure   android  virtual  device   •  To  open  AVD,  use  command  android avd •  Click  new  to  create  new  AVD  
  31. 31. Star<ng  the  Emulator   •  In  avd,  click  start   Or     •  use  emulator –avd youravd  command  in   command  line  
  32. 32. Installing  App   •  The  compiled  and  packaged  applica<on  can  be   found  in  the  bin/  directory   •  In  debug  –  mode,  the  app  cannot  be  distributed   in  Google  Play,  but  it  can  be  installed  on  device   or  emulator   •  To  see  list  of  devices  aUached  to  your  computer   (devices,  emulators),  use  command     –  adb devices •  adb? =  Android  Debug  Bridge,  command  line   tool  for  communica<ng  between  devices  and   emulators  
  33. 33. Installing   •  You  need  to  use  the  adb  app  to  install  the  app   •  If  you  have  only  one  device  aUached,  the   following  command  is  enough:   – adb install HelloWorld-debug.apk •  If  you  have  several  devices  aUached,  then  you   must  specify  the  target   – adb –s emulator-5554 install HelloWorld- debug.apk  

×