Successfully reported this slideshow.
We use your LinkedIn profile and activity data to personalize ads and to show you more relevant ads. You can change your ad preferences anytime.

Coexisting of Android & Robots

3,299 views

Published on

This slides are a small introduction to RoboGuice and Robotium at the berlin based Android meetup in May 2012.

Published in: Technology, Business
  • Be the first to comment

Coexisting of Android & Robots

  1. 1. www.immobilienscout24.deCoexisting of Android and RobotsIntroduction to RoboGuice & RobotiumAndroid Meetup Berlin | 30.05.2012 | Hasan Hosgel
  2. 2. About me www.immobilienscout24.deHasan HoşgelTwitter: @alosdevGithub: alosdevG+: Hasan HosgelSenior DeveloperMobile enthusiast,Man of action
  3. 3. Germany‘s leadingImmobilienScout24 real-estate portal 550 employees, 160 in the IT Seite | Coexisting of Android and Robots | 3 Hasan Hosgel
  4. 4. Germany‘s leadingImmobilienScout24 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. 5. Germany‘s leadingImmobilienScout24 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. 6. Normal activitySeite 6 | Coexisting of Android and Robots | Hasan Hosgel
  7. 7. Normal activity do you like it?Seite 7 | Coexisting of Android and Robots | Hasan Hosgel
  8. 8. Normal activity do you like it? a lot of boilerplate codeSeite 8 | Coexisting of Android and Robots | Hasan Hosgel
  9. 9. How to avoid this?Seite 9 | Coexisting of Android and Robots | Hasan Hosgel
  10. 10. How to avoid this? as the talk subject says RoboGuiceSeite 10 | Coexisting of Android and Robots | Hasan Hosgel
  11. 11. RoboGuice DI & IOC Framework for AndroidSource: http://roboguice.org Seite 11 | Coexisting of Android and Robots | Hasan Hosgel
  12. 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. 13. RoboGuice DI & IOC Framework for Android based on Google Guice no AOP (JSR-330 compatible) actual version 2.0Source: http://roboguice.org Seite 13 | Coexisting of Android and Robots | Hasan Hosgel
  14. 14. definition IOC & DIsource: 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. 15. definition IOC & DIsource: 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 SeamSeite 15 | Coexisting of Android and Robots | Hasan Hosgel
  16. 16. What you need for RoboGuice? Android project RoboGuice 2.0 Guice 3.0 no AOP javax.injectSeite 16 | Coexisting of Android and Robots | Hasan Hosgel
  17. 17. Configuration extend Robo* classesSeite 17 | Coexisting of Android and Robots | Hasan Hosgel
  18. 18. Configuration extend Robo* classes create roboguice_modules.xmlSeite 18 | Coexisting of Android and Robots | Hasan Hosgel
  19. 19. Configuration extend Robo* classes create roboguice_modules.xml create your AbstractModuleSeite 19 | Coexisting of Android and Robots | Hasan Hosgel
  20. 20. Configuration extend Robo* classes create roboguice_modules.xml create your AbstractModule configure the module in the xmlSeite 20 | Coexisting of Android and Robots | Hasan Hosgel
  21. 21. Injection TypesSeite 21 | Coexisting of Android and Robots | Hasan Hosgel
  22. 22. Injection Types member injectionSeite 22 | Coexisting of Android and Robots | Hasan Hosgel
  23. 23. Injection Types member injection setter injectionSeite 23 | Coexisting of Android and Robots | Hasan Hosgel
  24. 24. injection types member injection setter injection constructor injectionSeite 24 | Coexisting of Android and Robots | Hasan Hosgel
  25. 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 tagNameSeite 25 | Coexisting of Android and Robots | Hasan Hosgel
  26. 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 usedSeite 26 | Coexisting of Android and Robots | Hasan Hosgel
  27. 27. RoboGuiced activitySeite 27 | Coexisting of Android and Robots | Hasan Hosgel
  28. 28. Normal activity for comparisonSeite 28 | Coexisting of Android and Robots | Hasan Hosgel
  29. 29. RoboGuiced activity much better & clearerSeite 29 | Coexisting of Android and Robots | Hasan Hosgel
  30. 30. RoboGuice in ActionSeite 30 | Coexisting of Android and Robots | Hasan Hosgel
  31. 31. RoboGuice in Action Live Coding...Seite 31 | Coexisting of Android and Robots | Hasan Hosgel
  32. 32. Robotium Test Framework for Android similar to Selenium/ WebTest actual version 3.2.1Seite 32 | Coexisting of Android and Robots | Hasan Hosgel
  33. 33. What you need for Robotium? robotium-solo-3.2.1 extend from ActivityInstrumentationTestCase2 instanciate Solo finishInactiveActivities & finishOpenedActivities on solo in teardownSeite 33 | Coexisting of Android and Robots | Hasan Hosgel
  34. 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/robotiumSeite 34 | Coexisting of Android and Robots | Hasan Hosgel
  35. 35. Robotium in ActionSeite 35 | Coexisting of Android and Robots | Hasan Hosgel
  36. 36. Robotium in Action Live Coding...Seite 36 | Coexisting of Android and Robots | Hasan Hosgel
  37. 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 AndroidSeite 37 | Coexisting of Android and Robots | Hasan Hosgel
  38. 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.htmlSeite 38 | Coexisting of Android and Robots | Hasan Hosgel
  39. 39. Thanks for yourattention! Questions? http://www.flickr.com/photos/peterjlambert/97671748/sizes/o/in/photostream/
  40. 40. www.immobilienscout24.deVielen Dank für IhreAufmerksamkeit!Kontakt:ImmobilienScout24 Fon: 030/24301-11 00Andreasstraße 10 Email: info@immobilienscout24.de.10243 Berlin URL: www.immobilienscout24.de

×