Droidcon uk2012 androvm

21
AndroVM An alterna-ve to Android SDK emulator DROIDCON LONDON 25-26th October Daniel FAGES : [email protected]

description

The slides I used at the DroiconUK 2012 to present AndroVM - http://androvm.org

Transcript of Droidcon uk2012 androvm

Page 1: Droidcon uk2012 androvm

AndroVM  An  alterna-ve  to  Android  SDK  

emulator  

DROIDCON LONDON 25-26th October Daniel FAGES : à  [email protected]

Page 2: Droidcon uk2012 androvm

Android  Open  Source  Project              Presenta-on            Architecture            Building/Tes-ng            Contribu-on    AndroVM  project              Presenta-on            Usage            Architecture            We  need  your  help  !  

Agenda

Page 3: Droidcon uk2012 androvm

Ini-a-ve   from  the  Open  Handset  Alliance,   leaded  by  Google,   to   create   an   open   mobile   pla6orm   for   telcos,   OEMs   and  developers.    

Open  Source  project….but  strong  dependency  to  Google    

Ten   major   releases   (1.0,   1.1,   CupCake,   Donut,   Eclair,   Froyo,  Gingerbread,  Honeycomb,  ICS,  JB)  since  September  2008    

more  than  450M  devices  and  >1.3M  ac-va-ons  a  day  !    

Android Open Source Project

Page 4: Droidcon uk2012 androvm

Android Open Source Project

Page 5: Droidcon uk2012 androvm

The  last  release  of  AOSP  (Jelly  Bean/4.1)  supports    :  •  Nexus  S  (GSM,  CDMA/WiMAX)  •  Galaxy  Nexus  (GSM/HSDPA+,  CDMA/LTE)  •  Nexus  7  •  Motorola  Xoom  (WiFi  only,  CDMA/LTE)  •  PandaBoard  (development  board)    

But,  even  for  those,  -­‐>  Some  components  are  only  available  in  binary  form    -­‐>  Some  other  are  even  not  publicly  available  

 

Jelly Bean – Devices support

Page 6: Droidcon uk2012 androvm

“ROM   Cooking”   on   smartphones   and   tablets   (ex   :  CyanogenMod  project  –  more  than  1M  devices)  

Use   of   Android   on   new   pla[orms,   different   from  smartphones  and  tablets  

Applica-on  debugging  and  op-miza-on    Source  code  security  analysis    

AOSP – Source code interests

Page 7: Droidcon uk2012 androvm

Sources  •  Informa\on  Source  :  h]p://source.android.com  •  OS  Pre-­‐requisite  :  h]p://source.android.com/source/ini\alizing.html  •  Download  :  h]p://source.android.com/source/downloading.html    

Building   system   :   4GB   RAM  minimum   (16GB   be]er),   25GB   free  storage  minimum  (90GB  to  build  all  ‘targets’)  different  from  smartphones  and  tablets    Setup  /  repo  tool  :  $ mkdir ~/bin $ PATH=~/bin:$PATH $ curl https://dl-ssl.google.com/dl/googlesource/git-repo/repo > ~/bin/repo $ chmod a+x ~/bin/repo

AOSP JB - Building

Page 8: Droidcon uk2012 androvm

Source  code  download  :  $ mkdir android-4.1.2 $ repo init -u https://android.googlesource.com/platform/manifest -b android-4.1.2 $ repo sync

Target  selec\on  and  building:  $ source build/envsetup.sh $ lunch (select  target)  $ make –jX (where  X  is  the  number  of  parallel  compila\on  processes)

-­‐>  A  complete  build  can  take  from  20  minutes  to  8  hours  depending  on  the  building  system  configura\on…  (JBQ’s  host  :  Dual  Xeon  E5620  Quad-­‐core,  24GB  RAM  à30  minutes  to  build  ICS  for  the  Galaxy  Nexus).    Last  step  :  ROM  install  on  device,  or  execu\on  using  the  emulator  or  a  virtual  machine.  

AOSP JB - Building

Page 9: Droidcon uk2012 androvm

bionic/  :  «  libc  »  replacement  bootable/  :  reference  bootloader  build/  :  AOSP  build  scripts  cts/  :  «  Compa\bility  Test  Suite  »    dalvik/  :  Dalvik  virtual  machine  development/  :  Development  tools  device/  :  Device  specific  files  docs/  :  source.android.com  source  files  external/  :  External  projects  used  by  AOSP  frameworks/  :  System  services,  android.*  JAVA  classes,  …  hardware/  :  Hardware  support  libraries  libcore/  :  «  Apache  Harmony  »  project  ndk/  :  Na\ve  Development  Kit  packages/  :  Basic  Android  applica\ons  and  services    prebuilt/  prebuits/:  Precompiled  binaries  sdk/  :  Sorware  Development  Kit  system/  :  System  components  

AOSP – Sources code Structure

Page 10: Droidcon uk2012 androvm

CDD  =  Compa-bility  Defini-on  Document  •  Android  devices  specifica\ons  (one  CDD  for  each  Android  version),  •  A   required   condi\on   (but   not   enough…)   to   get   access   to   the  Google  Market/

Play  is  that  the  device  respect  the  Android  version  CDD.  •  Pre-­‐requisites  can  drama-cally  change  from  one  version  to  an  other            

AOSP – CDD & CTS

CTS  =  Compa-bility  Test  Suite  •  Tes\ng   tools   used   to   (partly)   check   the   conformity   of   a   device  

(and  its  Android  ROM)  towards  the  target  CDD.  

h]p://source.android.com/compa\bility/cts-­‐intro.html  

Page 11: Droidcon uk2012 androvm

h]p://source.android.com/source/submit-­‐patches.html  h]ps://android-­‐review.googlesource.com  

AOSP – Contribution

Everybody  can  contribute  code  to  Android,  but…    •  Every  contribu\on  is  subject  to  Google’s  valida-on    

ü  Code  quality  :  Android  «  code  style  guidelines  »    ü  Func\onal  code  ü  Strategic/Poli\c  ?  

 •  Same  func\on/piece  of  code  may  be  developed  at  same  \me  by  

Google…  •  Tool  based  on  Gerrit  •  Service  unavailable  during  >6  months  in  2011…  

Page 12: Droidcon uk2012 androvm

Objec-ves  :    §  Provide  func\onal  and  robust  Android  Virtual  images    §  Environment  :  un\l  now  mainly  focused  on  VirtualBox,  but  

images  are  running  well  on  VMWare  (minus  some  func\ons)    

Buildroid  

AndroVM - Introduction

Page 13: Droidcon uk2012 androvm

?   Genesis    Beginning  with  ICS,  AOSP  includes  a  «  VirtualBox  target  »  but  many  func\ons  were  missing.  -­‐>  That’s  how  come  the  idea  to  work  on  VirtualBox  support  in  AOSP…    

 Func-ons  developed  §  Mouse    §  Ethernet    §  RTC  (Real-­‐Time  Clock)    §  Power  Management    §  Audio    §  File  sharing  with  the  host    §  USB  

§  WiFi  emula-on    §  OpenGL  ES  2.0  Hardware    §  AndroVM  configura-on  tool  

AndroVM - AOSP Porting to VirtualBox

Page 14: Droidcon uk2012 androvm

Now,  AndroVM  and  android-­‐x86  images  can  run  na-ve  ARM  code    à  Got  a  phone,  Reverse-­‐engineered  the  “houdini”  libraries  implemen\ng  “ARM  

transla\on”,  Integrated  them  in  AndroVM  and  it  worked      h]p://androvm.org/blog/ex-­‐buildroid/2012/06/11/running-­‐arm-­‐apps/  h]p://androvm.org/blog/ex-­‐buildroid/2012/06/18/using-­‐arm-­‐emula\on-­‐on-­‐other-­‐android-­‐x86-­‐distribu\ons/  

AndroVM – ARM support

Page 15: Droidcon uk2012 androvm

>  200  000  VM  downloads  in  6  months    

Useful  for  ?  Developers  replacing  the  SDK  emulator    People  wan\ng  to  run  Android  applica\ons  on  their  x86  systems  People  wan\ng  to  make  a  Demo  OEM/Manufacturers  wan\ng  to  provide  development/demo  pla6orm  

 Why  ?  

§  Performance    §  OpenGL  issues    §  User-­‐friendly  

AndroVM – Why ?

Page 16: Droidcon uk2012 androvm

DEMO

Page 17: Droidcon uk2012 androvm

We’re  currently  working  on  :  §  An  AndroVM  management  tool  :  create/modify  VM,  start/stop  them,  

automa\cally  connect  adb,  ...  §  Sensors  emula-on  :  either  manual  or  using  input  data  from  USB-­‐connected  

Android  device    

What  could  be  next  :  §  Mul\-­‐touch  emula\on  §  Bluetooth  emula\on  §  NFC  emula\on  

 

     

AndroVM – More to come

Page 18: Droidcon uk2012 androvm

-­‐>  Android  developers,  please  help  us  make  your  life  easier  J  

 

From  “pure  technical  interest”  to  usage…  §  Do  you  feel  the  need  of  an  alterna\ve  to  the  

Android  SDK  emulator  ?  §  Are  you  able  to  use  HAXM  and  Hardware  

OpenGL  or  is  it  impossible  to  use  in  your  environment  ?  

§  What  func\ons  would  you  need  the  most  ?  Bluetooth  ?  NFC  ?  WiFi-­‐Direct  ?...  

§  Are  you  able  to  test  your  apps  with  variable  network  quality/reliability  ?  Do  you  feel  the  need  for  it  ?    

 à  [email protected]  

AndroVM – Need your Help !

Page 19: Droidcon uk2012 androvm

AOSP  building  instruc-ons:  h]p://source.android.com    Android  Google  groups:  

 h]p://groups.google.com/group/android-­‐building    h]p://groups.google.com/group/android-­‐por\ng    h]p://groups.google.com/group/android-­‐pla6orm    h]p://groups.google.com/group/android-­‐kernel  

 xda-­‐developers  forum  :    

 h]p://forum.xda-­‐developers.com/forumdisplay.php?f=564    Cyanogenmod  forum  :  h]p://forum.cyanogenmod.com    android-­‐x86  project  :  h]p://www.android-­‐x86.org    AndroVM  project  :  h]p://www.androvm.org/  

 

     

AOSP – Links

Page 20: Droidcon uk2012 androvm

 

     Ques-ons  ?  

Page 21: Droidcon uk2012 androvm

 

     

MERCI  !  Daniel  Fages  [email protected]  [email protected]