SlideShare una empresa de Scribd logo
1 de 40
Descargar para leer sin conexión
www.immobilienscout24.de




Coexisting of Android and Robots
Introduction to RoboGuice & Robotium
Android Meetup Berlin | 30.05.2012 | Hasan Hosgel
About me
 www.immobilienscout24.de




Hasan Hoşgel
Twitter: @alosdev
Github: alosdev
G+: Hasan Hosgel

Senior Developer
Mobile enthusiast,
Man of action
Germany‘s leading
ImmobilienScout24
                                              real-estate portal
                                              550 employees,
                                              160 in the IT




 Seite | Coexisting of Android and Robots |
 3     Hasan Hosgel
Germany‘s leading
ImmobilienScout24
                                              real-estate portal
                                              550 employees,
 > 7.5 Million unique users                   160 in the IT
 > 2 Billion PI
 > 260 Million Expose views
 ~ 1.5 Million active listings
 > 110,000 Vendors
 ... per month
 > 3 Mio App-Downloads
 Seite | Coexisting of Android and Robots |
 4     Hasan Hosgel
Germany‘s leading
ImmobilienScout24
                                              real-estate portal
                                              550 employees,
 > 7.5 Million unique users                   160 in the IT
 > 2 Billion PI                                     2 datacenter
 > 260 Million Expose views                         ~100 physical
 ~ 1.5 Million active listings                      ~800 virtual
 > 110,000 Vendors                                  ... machines
 ... per month
 > 3 Mio App-Downloads
 Seite | Coexisting of Android and Robots |
 5     Hasan Hosgel
Normal activity




Seite 6   | Coexisting of Android and Robots | Hasan Hosgel
Normal activity



                                                              do you like it?




Seite 7   | Coexisting of Android and Robots | Hasan Hosgel
Normal activity



                                                              do you like it?

                                                               a lot of boilerplate
                                                               code




Seite 8   | Coexisting of Android and Robots | Hasan Hosgel
How to avoid this?




Seite 9   | Coexisting of Android and Robots | Hasan Hosgel
How to avoid this?




                         as the talk subject
                         says RoboGuice




Seite 10 | Coexisting of Android and Robots | Hasan Hosgel
RoboGuice


                                                              DI & IOC Framework
                                                              for Android




Source: http://roboguice.org




 Seite 11 | Coexisting of Android and Robots | Hasan Hosgel
RoboGuice


                                                              DI & IOC Framework
                                                              for Android

                                                              based on Google Guice no
                                                              AOP (JSR-330 compatible)




Source: http://roboguice.org




 Seite 12 | Coexisting of Android and Robots | Hasan Hosgel
RoboGuice


                                                              DI & IOC Framework
                                                              for Android

                                                              based on Google Guice no
                                                              AOP (JSR-330 compatible)

                                                              actual version 2.0


Source: http://roboguice.org




 Seite 13 | Coexisting of Android and Robots | Hasan Hosgel
definition IOC & DI
source: http://wikipedia.com
 In software engineering, Inversion of Control (IoC) is an object-oriented
 programming practice whereby the object coupling is bound at run time by
 an "assembler" object and is typically not knowable at compile time using
 static analysis.

 Dependency injection is a software design pattern that allows a choice of
 component to be made at run-time rather than compile time. This can be
 used, for example, as a simple way to load plugins dynamically or to choose
 mock objects in test environments vs. real objects in production
 environments.




Seite 14 | Coexisting of Android and Robots | Hasan Hosgel
definition IOC & DI
source: http://wikipedia.com
 In software engineering, Inversion of Control (IoC) is an object-oriented
 programming practice whereby the object coupling is bound at run time by
 an "assembler" object and is typically not knowable at compile time using
 static analysis.

 Dependency injection is a software design pattern that allows a choice of
 component to be made at run-time rather than compile time. This can be
 used, for example, as a simple way to load plugins dynamically or to choose
 mock objects in test environments vs. real objects in production
 environments.


                Spring                                       Google Guice

               EJB (> 3.0)                                   JBoss Seam

Seite 15 | Coexisting of Android and Robots | Hasan Hosgel
What you need for RoboGuice?


       Android project


       RoboGuice 2.0


       Guice 3.0 no AOP


       javax.inject


Seite 16 | Coexisting of Android and Robots | Hasan Hosgel
Configuration


       extend Robo* classes




Seite 17 | Coexisting of Android and Robots | Hasan Hosgel
Configuration


       extend Robo* classes

       create
       roboguice_modules.xml




Seite 18 | Coexisting of Android and Robots | Hasan Hosgel
Configuration


       extend Robo* classes

       create
       roboguice_modules.xml

       create your
       AbstractModule




Seite 19 | Coexisting of Android and Robots | Hasan Hosgel
Configuration


       extend Robo* classes

       create
       roboguice_modules.xml

       create your
       AbstractModule

       configure the module
       in the xml

Seite 20 | Coexisting of Android and Robots | Hasan Hosgel
Injection Types




Seite 21 | Coexisting of Android and Robots | Hasan Hosgel
Injection Types


   member injection




Seite 22 | Coexisting of Android and Robots | Hasan Hosgel
Injection Types


   member injection




   setter injection




Seite 23 | Coexisting of Android and Robots | Hasan Hosgel
injection types


   member injection




   setter injection



   constructor
   injection


Seite 24 | Coexisting of Android and Robots | Hasan Hosgel
annotation types part 1

! @Inject
   ! standard Guice annotation
! @InjectView(resId)
   ! inject views after „setContentView()“ in „onCreate()“
! @InjectResource(resId)
   ! inject resource in „onCreate()“
! @InjectExtra(extraName)
   ! inject extra only in „onCreate()“ NOT „onNewIntent()“
! @InjectPreference(keyName)
   ! reads preference by keyName
! @InjectFragment(resId, tagName)
   ! inject the fragment to the resId with the tagName

Seite 25 | Coexisting of Android and Robots | Hasan Hosgel
annotation types part 2

! @ContentView(resId)
   ! set layout for activity/ fragment
! @Named(valueName)
   ! with the valueName a specific configuration can be
           done
! no annotation but related Provider<T>
   ! asynchronous injection, if the creation is expensive and
           not always used. The method #get() can be used




Seite 26 | Coexisting of Android and Robots | Hasan Hosgel
RoboGuiced activity




Seite 27 | Coexisting of Android and Robots | Hasan Hosgel
Normal activity



                                                             for comparison




Seite 28 | Coexisting of Android and Robots | Hasan Hosgel
RoboGuiced activity




                                                             much better &
                                                             clearer




Seite 29 | Coexisting of Android and Robots | Hasan Hosgel
RoboGuice in Action




Seite 30 | Coexisting of Android and Robots | Hasan Hosgel
RoboGuice in Action




                         Live Coding...




Seite 31 | Coexisting of Android and Robots | Hasan Hosgel
Robotium


       Test Framework for
       Android

       similar to Selenium/
       WebTest

       actual version 3.2.1




Seite 32 | Coexisting of Android and Robots | Hasan Hosgel
What you need for Robotium?


       robotium-solo-3.2.1

         extend from
         ActivityInstrumentationTestCase2

       instanciate Solo

          finishInactiveActivities &
          finishOpenedActivities on solo in
          teardown
Seite 33 | Coexisting of Android and Robots | Hasan Hosgel
What you can do with Robotium?

!   remote run of application/ black box tests
!   click on view
!   long click on view
!   scroll
!   search for text and view
!   wait for text and view
!   enter text
!   send keys


! configure sleeper/ waiter? NO è use fork
    https://github.com/alosdev/robotium




Seite 34 | Coexisting of Android and Robots | Hasan Hosgel
Robotium in Action




Seite 35 | Coexisting of Android and Robots | Hasan Hosgel
Robotium in Action




                         Live Coding...




Seite 36 | Coexisting of Android and Robots | Hasan Hosgel
Why this fuss?

! clearer structure/ better API
! better testable/ test automation
! state of the art è proven in production (@IS24 since more
    than 1 year)
! good for libraries

           use RoboGuice & Robotium for Android




Seite 37 | Coexisting of Android and Robots | Hasan Hosgel
Dive into the topic & sources

! github with sample project of presentation:
    ! https://github.com/alosdev/amu-roboguice
! slideshare:
    ! http://www.slideshare.net/hosgel/coexisting-of-
           android-robots
! RoboGuice:
   ! http://roboguice.org/
! Robotium:
   ! http://robotium.org/
! deeper look into RoboGuice:
   ! http://www.blog.project13.pl/wp-content/uploads/
           2011/12/presentation.html



Seite 38 | Coexisting of Android and Robots | Hasan Hosgel
Thanks for your
attention! Questions?




               http://www.flickr.com/photos/peterjlambert/97671748/sizes/o/in/photostream/
www.immobilienscout24.de

Vielen Dank für Ihre
Aufmerksamkeit!

Kontakt:
ImmobilienScout24          Fon:   030/24301-11 00
Andreasstraße 10           Email: info@immobilienscout24.de.
10243 Berlin               URL: www.immobilienscout24.de

Más contenido relacionado

Destacado

Trastorno antisocial de la personalidad
Trastorno antisocial de la personalidadTrastorno antisocial de la personalidad
Trastorno antisocial de la personalidad
Diego Neyra
 
Procesos para llegar a la calidad total
Procesos para llegar a la calidad totalProcesos para llegar a la calidad total
Procesos para llegar a la calidad total
Andres Rodriguez
 
Arquitecturas empresariales para Ingenieros de Sistemas/Informáticos/de Software
Arquitecturas empresariales para Ingenieros de Sistemas/Informáticos/de SoftwareArquitecturas empresariales para Ingenieros de Sistemas/Informáticos/de Software
Arquitecturas empresariales para Ingenieros de Sistemas/Informáticos/de Software
Marta Silvia Tabares
 
Distribucion comercial colgate palmolive.
Distribucion comercial colgate palmolive.Distribucion comercial colgate palmolive.
Distribucion comercial colgate palmolive.
Daianna Reyes
 
Electrodinamica.
Electrodinamica.Electrodinamica.
Electrodinamica.
garnan68
 

Destacado (14)

Administracion del tiempo y realizacion personal
Administracion del tiempo y realizacion personalAdministracion del tiempo y realizacion personal
Administracion del tiempo y realizacion personal
 
MANTENER EL CEREBRO SIEMPRE JOVEN
MANTENER EL CEREBRO SIEMPRE JOVENMANTENER EL CEREBRO SIEMPRE JOVEN
MANTENER EL CEREBRO SIEMPRE JOVEN
 
Cine Forum Wes Anderson Villarrubia de los Ojos
Cine Forum Wes Anderson Villarrubia de los OjosCine Forum Wes Anderson Villarrubia de los Ojos
Cine Forum Wes Anderson Villarrubia de los Ojos
 
Photovoltaik – Produktionstechnik und Technologie im Wandel der Zeit
Photovoltaik – Produktionstechnik und Technologie im Wandel der ZeitPhotovoltaik – Produktionstechnik und Technologie im Wandel der Zeit
Photovoltaik – Produktionstechnik und Technologie im Wandel der Zeit
 
Waste management presentation
Waste management presentationWaste management presentation
Waste management presentation
 
MonetizacióN 2.0 3dic09 (Marta Dominguez)
MonetizacióN 2.0   3dic09  (Marta Dominguez)MonetizacióN 2.0   3dic09  (Marta Dominguez)
MonetizacióN 2.0 3dic09 (Marta Dominguez)
 
Investment proposal for sustainable energy project
Investment proposal for sustainable energy projectInvestment proposal for sustainable energy project
Investment proposal for sustainable energy project
 
Trastorno antisocial de la personalidad
Trastorno antisocial de la personalidadTrastorno antisocial de la personalidad
Trastorno antisocial de la personalidad
 
Procesos para llegar a la calidad total
Procesos para llegar a la calidad totalProcesos para llegar a la calidad total
Procesos para llegar a la calidad total
 
Los Flip Flops
Los Flip FlopsLos Flip Flops
Los Flip Flops
 
Arquitecturas empresariales para Ingenieros de Sistemas/Informáticos/de Software
Arquitecturas empresariales para Ingenieros de Sistemas/Informáticos/de SoftwareArquitecturas empresariales para Ingenieros de Sistemas/Informáticos/de Software
Arquitecturas empresariales para Ingenieros de Sistemas/Informáticos/de Software
 
Distribucion comercial colgate palmolive.
Distribucion comercial colgate palmolive.Distribucion comercial colgate palmolive.
Distribucion comercial colgate palmolive.
 
Electrodinamica.
Electrodinamica.Electrodinamica.
Electrodinamica.
 
Geofisica agua
Geofisica aguaGeofisica agua
Geofisica agua
 

Similar a Coexisting of Android & Robots

Tools to Use in Android Development Or iOS Development.pdf
Tools to Use in Android Development Or iOS Development.pdfTools to Use in Android Development Or iOS Development.pdf
Tools to Use in Android Development Or iOS Development.pdf
Technology News & Updates
 
Cross Platform Mobile Apps with the Ionic Framework
Cross Platform Mobile Apps with the Ionic FrameworkCross Platform Mobile Apps with the Ionic Framework
Cross Platform Mobile Apps with the Ionic Framework
Troy Miles
 

Similar a Coexisting of Android & Robots (20)

iOS & Android App Indexing & App Actions
iOS & Android App Indexing & App ActionsiOS & Android App Indexing & App Actions
iOS & Android App Indexing & App Actions
 
HealthyCodeMay2014
HealthyCodeMay2014HealthyCodeMay2014
HealthyCodeMay2014
 
Why hybrid-is-important
Why hybrid-is-importantWhy hybrid-is-important
Why hybrid-is-important
 
Holidu Android Instant App
Holidu Android Instant AppHolidu Android Instant App
Holidu Android Instant App
 
Android Minnebar
Android MinnebarAndroid Minnebar
Android Minnebar
 
Bringing the Ruby language into the mobile world
Bringing the Ruby language into the mobile worldBringing the Ruby language into the mobile world
Bringing the Ruby language into the mobile world
 
Android development first steps
Android development   first stepsAndroid development   first steps
Android development first steps
 
Android Developer Days 2013 - MultiDevice Nightmare
Android Developer Days 2013 - MultiDevice NightmareAndroid Developer Days 2013 - MultiDevice Nightmare
Android Developer Days 2013 - MultiDevice Nightmare
 
Hybrid application development
Hybrid application developmentHybrid application development
Hybrid application development
 
Instant app Intro
Instant app IntroInstant app Intro
Instant app Intro
 
DroidCon 2011: Developing HTML5 and hybrid Android apps using Phonegap
DroidCon 2011: Developing HTML5 and hybrid Android apps using PhonegapDroidCon 2011: Developing HTML5 and hybrid Android apps using Phonegap
DroidCon 2011: Developing HTML5 and hybrid Android apps using Phonegap
 
Supercharge your Android UI
Supercharge your Android UISupercharge your Android UI
Supercharge your Android UI
 
Project Flogo: An Event-Driven Stack for the Enterprise
Project Flogo: An Event-Driven Stack for the EnterpriseProject Flogo: An Event-Driven Stack for the Enterprise
Project Flogo: An Event-Driven Stack for the Enterprise
 
Vahid Garousi-SE meets robotics
Vahid Garousi-SE meets roboticsVahid Garousi-SE meets robotics
Vahid Garousi-SE meets robotics
 
Tools to Use in Android Development Or iOS Development.pdf
Tools to Use in Android Development Or iOS Development.pdfTools to Use in Android Development Or iOS Development.pdf
Tools to Use in Android Development Or iOS Development.pdf
 
Mobile applications in a new way with React Native
Mobile applications in a new way with React NativeMobile applications in a new way with React Native
Mobile applications in a new way with React Native
 
Mobile applications in a new way with React Native (by Eugene Zharkov) - Hack...
Mobile applications in a new way with React Native (by Eugene Zharkov) - Hack...Mobile applications in a new way with React Native (by Eugene Zharkov) - Hack...
Mobile applications in a new way with React Native (by Eugene Zharkov) - Hack...
 
Comparisons react native vs. flutter vs. ionic vs. xamarin vs. native script
Comparisons  react native vs. flutter vs. ionic vs. xamarin vs. native scriptComparisons  react native vs. flutter vs. ionic vs. xamarin vs. native script
Comparisons react native vs. flutter vs. ionic vs. xamarin vs. native script
 
The Best Alternatives To The Ionic Framework.pdf
The Best Alternatives To The Ionic Framework.pdfThe Best Alternatives To The Ionic Framework.pdf
The Best Alternatives To The Ionic Framework.pdf
 
Cross Platform Mobile Apps with the Ionic Framework
Cross Platform Mobile Apps with the Ionic FrameworkCross Platform Mobile Apps with the Ionic Framework
Cross Platform Mobile Apps with the Ionic Framework
 

Más de Hasan Hosgel

Más de Hasan Hosgel (12)

DevFest Istanbul 2014 - Developing for the Big Screen - from Android TV to Ch...
DevFest Istanbul 2014 - Developing for the Big Screen - from Android TV to Ch...DevFest Istanbul 2014 - Developing for the Big Screen - from Android TV to Ch...
DevFest Istanbul 2014 - Developing for the Big Screen - from Android TV to Ch...
 
Android Developer Days 2014 How second screen can enhance your app
Android Developer Days 2014 How second screen can enhance your appAndroid Developer Days 2014 How second screen can enhance your app
Android Developer Days 2014 How second screen can enhance your app
 
Mtc spring 2014 best practices to develop for different android device classi...
Mtc spring 2014 best practices to develop for different android device classi...Mtc spring 2014 best practices to develop for different android device classi...
Mtc spring 2014 best practices to develop for different android device classi...
 
Droidcon it 2014 best practices to develop for different android device class...
Droidcon it 2014 best practices to develop for different android device class...Droidcon it 2014 best practices to develop for different android device class...
Droidcon it 2014 best practices to develop for different android device class...
 
Droidcon nl 2013 best practices to develop for different android device class...
Droidcon nl 2013 best practices to develop for different android device class...Droidcon nl 2013 best practices to develop for different android device class...
Droidcon nl 2013 best practices to develop for different android device class...
 
MTC 2013 Berlin - Best Practices for Multi Devices
MTC 2013 Berlin - Best Practices for Multi DevicesMTC 2013 Berlin - Best Practices for Multi Devices
MTC 2013 Berlin - Best Practices for Multi Devices
 
Droidcon 2013 Multidevice Nightmare
Droidcon 2013 Multidevice NightmareDroidcon 2013 Multidevice Nightmare
Droidcon 2013 Multidevice Nightmare
 
Android bootcamp 2013 Lists & Adapter
Android bootcamp 2013 Lists & AdapterAndroid bootcamp 2013 Lists & Adapter
Android bootcamp 2013 Lists & Adapter
 
Customer's Choice @ Moosecon 2013
Customer's Choice @ Moosecon 2013Customer's Choice @ Moosecon 2013
Customer's Choice @ Moosecon 2013
 
Customer&rsquo;s Choice @ GDG Android Berlin on January meetup
Customer&rsquo;s Choice @ GDG Android Berlin on January meetupCustomer&rsquo;s Choice @ GDG Android Berlin on January meetup
Customer&rsquo;s Choice @ GDG Android Berlin on January meetup
 
Continuously Break The Android
Continuously Break The AndroidContinuously Break The Android
Continuously Break The Android
 
Mobile Development across Different Platforms @ Immobilienscout24
Mobile Development across Different Platforms @ Immobilienscout24Mobile Development across Different Platforms @ Immobilienscout24
Mobile Development across Different Platforms @ Immobilienscout24
 

Último

Artificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and MythsArtificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and Myths
Joaquim Jorge
 

Último (20)

presentation ICT roal in 21st century education
presentation ICT roal in 21st century educationpresentation ICT roal in 21st century education
presentation ICT roal in 21st century education
 
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
 
A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)
 
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationFrom Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
 
Automating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps ScriptAutomating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps Script
 
HTML Injection Attacks: Impact and Mitigation Strategies
HTML Injection Attacks: Impact and Mitigation StrategiesHTML Injection Attacks: Impact and Mitigation Strategies
HTML Injection Attacks: Impact and Mitigation Strategies
 
Artificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and MythsArtificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and Myths
 
A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?
 
Manulife - Insurer Innovation Award 2024
Manulife - Insurer Innovation Award 2024Manulife - Insurer Innovation Award 2024
Manulife - Insurer Innovation Award 2024
 
🐬 The future of MySQL is Postgres 🐘
🐬  The future of MySQL is Postgres   🐘🐬  The future of MySQL is Postgres   🐘
🐬 The future of MySQL is Postgres 🐘
 
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost SavingRepurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
 
Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024
 
Partners Life - Insurer Innovation Award 2024
Partners Life - Insurer Innovation Award 2024Partners Life - Insurer Innovation Award 2024
Partners Life - Insurer Innovation Award 2024
 
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
 
Data Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonData Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt Robison
 
GenAI Risks & Security Meetup 01052024.pdf
GenAI Risks & Security Meetup 01052024.pdfGenAI Risks & Security Meetup 01052024.pdf
GenAI Risks & Security Meetup 01052024.pdf
 
Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024
 
Artificial Intelligence Chap.5 : Uncertainty
Artificial Intelligence Chap.5 : UncertaintyArtificial Intelligence Chap.5 : Uncertainty
Artificial Intelligence Chap.5 : Uncertainty
 
Top 5 Benefits OF Using Muvi Live Paywall For Live Streams
Top 5 Benefits OF Using Muvi Live Paywall For Live StreamsTop 5 Benefits OF Using Muvi Live Paywall For Live Streams
Top 5 Benefits OF Using Muvi Live Paywall For Live Streams
 
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
 

Coexisting of Android & Robots

  • 1. www.immobilienscout24.de Coexisting of Android and Robots Introduction to RoboGuice & Robotium Android Meetup Berlin | 30.05.2012 | Hasan Hosgel
  • 2. About me www.immobilienscout24.de Hasan Hoşgel Twitter: @alosdev Github: alosdev G+: Hasan Hosgel Senior Developer Mobile enthusiast, Man of action
  • 3. Germany‘s leading ImmobilienScout24 real-estate portal 550 employees, 160 in the IT Seite | Coexisting of Android and Robots | 3 Hasan Hosgel
  • 4. Germany‘s leading ImmobilienScout24 real-estate portal 550 employees, > 7.5 Million unique users 160 in the IT > 2 Billion PI > 260 Million Expose views ~ 1.5 Million active listings > 110,000 Vendors ... per month > 3 Mio App-Downloads Seite | Coexisting of Android and Robots | 4 Hasan Hosgel
  • 5. Germany‘s leading ImmobilienScout24 real-estate portal 550 employees, > 7.5 Million unique users 160 in the IT > 2 Billion PI 2 datacenter > 260 Million Expose views ~100 physical ~ 1.5 Million active listings ~800 virtual > 110,000 Vendors ... machines ... per month > 3 Mio App-Downloads Seite | Coexisting of Android and Robots | 5 Hasan Hosgel
  • 6. Normal activity Seite 6 | Coexisting of Android and Robots | Hasan Hosgel
  • 7. Normal activity do you like it? Seite 7 | Coexisting of Android and Robots | Hasan Hosgel
  • 8. Normal activity do you like it? a lot of boilerplate code Seite 8 | Coexisting of Android and Robots | Hasan Hosgel
  • 9. How to avoid this? Seite 9 | Coexisting of Android and Robots | Hasan Hosgel
  • 10. How to avoid this? as the talk subject says RoboGuice Seite 10 | Coexisting of Android and Robots | Hasan Hosgel
  • 11. RoboGuice DI & IOC Framework for Android Source: http://roboguice.org Seite 11 | Coexisting of Android and Robots | Hasan Hosgel
  • 12. RoboGuice DI & IOC Framework for Android based on Google Guice no AOP (JSR-330 compatible) Source: http://roboguice.org Seite 12 | Coexisting of Android and Robots | Hasan Hosgel
  • 13. RoboGuice DI & IOC Framework for Android based on Google Guice no AOP (JSR-330 compatible) actual version 2.0 Source: http://roboguice.org Seite 13 | Coexisting of Android and Robots | Hasan Hosgel
  • 14. definition IOC & DI source: http://wikipedia.com In software engineering, Inversion of Control (IoC) is an object-oriented programming practice whereby the object coupling is bound at run time by an "assembler" object and is typically not knowable at compile time using static analysis. Dependency injection is a software design pattern that allows a choice of component to be made at run-time rather than compile time. This can be used, for example, as a simple way to load plugins dynamically or to choose mock objects in test environments vs. real objects in production environments. Seite 14 | Coexisting of Android and Robots | Hasan Hosgel
  • 15. definition IOC & DI source: http://wikipedia.com In software engineering, Inversion of Control (IoC) is an object-oriented programming practice whereby the object coupling is bound at run time by an "assembler" object and is typically not knowable at compile time using static analysis. Dependency injection is a software design pattern that allows a choice of component to be made at run-time rather than compile time. This can be used, for example, as a simple way to load plugins dynamically or to choose mock objects in test environments vs. real objects in production environments. Spring Google Guice EJB (> 3.0) JBoss Seam Seite 15 | Coexisting of Android and Robots | Hasan Hosgel
  • 16. What you need for RoboGuice? Android project RoboGuice 2.0 Guice 3.0 no AOP javax.inject Seite 16 | Coexisting of Android and Robots | Hasan Hosgel
  • 17. Configuration extend Robo* classes Seite 17 | Coexisting of Android and Robots | Hasan Hosgel
  • 18. Configuration extend Robo* classes create roboguice_modules.xml Seite 18 | Coexisting of Android and Robots | Hasan Hosgel
  • 19. Configuration extend Robo* classes create roboguice_modules.xml create your AbstractModule Seite 19 | Coexisting of Android and Robots | Hasan Hosgel
  • 20. Configuration extend Robo* classes create roboguice_modules.xml create your AbstractModule configure the module in the xml Seite 20 | Coexisting of Android and Robots | Hasan Hosgel
  • 21. Injection Types Seite 21 | Coexisting of Android and Robots | Hasan Hosgel
  • 22. Injection Types member injection Seite 22 | Coexisting of Android and Robots | Hasan Hosgel
  • 23. Injection Types member injection setter injection Seite 23 | Coexisting of Android and Robots | Hasan Hosgel
  • 24. injection types member injection setter injection constructor injection Seite 24 | Coexisting of Android and Robots | Hasan Hosgel
  • 25. annotation types part 1 ! @Inject ! standard Guice annotation ! @InjectView(resId) ! inject views after „setContentView()“ in „onCreate()“ ! @InjectResource(resId) ! inject resource in „onCreate()“ ! @InjectExtra(extraName) ! inject extra only in „onCreate()“ NOT „onNewIntent()“ ! @InjectPreference(keyName) ! reads preference by keyName ! @InjectFragment(resId, tagName) ! inject the fragment to the resId with the tagName Seite 25 | Coexisting of Android and Robots | Hasan Hosgel
  • 26. annotation types part 2 ! @ContentView(resId) ! set layout for activity/ fragment ! @Named(valueName) ! with the valueName a specific configuration can be done ! no annotation but related Provider<T> ! asynchronous injection, if the creation is expensive and not always used. The method #get() can be used Seite 26 | Coexisting of Android and Robots | Hasan Hosgel
  • 27. RoboGuiced activity Seite 27 | Coexisting of Android and Robots | Hasan Hosgel
  • 28. Normal activity for comparison Seite 28 | Coexisting of Android and Robots | Hasan Hosgel
  • 29. RoboGuiced activity much better & clearer Seite 29 | Coexisting of Android and Robots | Hasan Hosgel
  • 30. RoboGuice in Action Seite 30 | Coexisting of Android and Robots | Hasan Hosgel
  • 31. RoboGuice in Action Live Coding... Seite 31 | Coexisting of Android and Robots | Hasan Hosgel
  • 32. Robotium Test Framework for Android similar to Selenium/ WebTest actual version 3.2.1 Seite 32 | Coexisting of Android and Robots | Hasan Hosgel
  • 33. What you need for Robotium? robotium-solo-3.2.1 extend from ActivityInstrumentationTestCase2 instanciate Solo finishInactiveActivities & finishOpenedActivities on solo in teardown Seite 33 | Coexisting of Android and Robots | Hasan Hosgel
  • 34. What you can do with Robotium? ! remote run of application/ black box tests ! click on view ! long click on view ! scroll ! search for text and view ! wait for text and view ! enter text ! send keys ! configure sleeper/ waiter? NO è use fork https://github.com/alosdev/robotium Seite 34 | Coexisting of Android and Robots | Hasan Hosgel
  • 35. Robotium in Action Seite 35 | Coexisting of Android and Robots | Hasan Hosgel
  • 36. Robotium in Action Live Coding... Seite 36 | Coexisting of Android and Robots | Hasan Hosgel
  • 37. Why this fuss? ! clearer structure/ better API ! better testable/ test automation ! state of the art è proven in production (@IS24 since more than 1 year) ! good for libraries use RoboGuice & Robotium for Android Seite 37 | Coexisting of Android and Robots | Hasan Hosgel
  • 38. Dive into the topic & sources ! github with sample project of presentation: ! https://github.com/alosdev/amu-roboguice ! slideshare: ! http://www.slideshare.net/hosgel/coexisting-of- android-robots ! RoboGuice: ! http://roboguice.org/ ! Robotium: ! http://robotium.org/ ! deeper look into RoboGuice: ! http://www.blog.project13.pl/wp-content/uploads/ 2011/12/presentation.html Seite 38 | Coexisting of Android and Robots | Hasan Hosgel
  • 39. Thanks for your attention! Questions? http://www.flickr.com/photos/peterjlambert/97671748/sizes/o/in/photostream/
  • 40. www.immobilienscout24.de Vielen Dank für Ihre Aufmerksamkeit! Kontakt: ImmobilienScout24 Fon: 030/24301-11 00 Andreasstraße 10 Email: info@immobilienscout24.de. 10243 Berlin URL: www.immobilienscout24.de