$30 off During Our Annual Pro Sale. View Details »

How To: Build Android and iOS app in Java

Alexey Buzdin
September 18, 2015

How To: Build Android and iOS app in Java

So you’ve decided to go cross-platform? Now its time to choose the right tool! Lets talk about various mobile cross-platfrom tools, their pros and cons. When and why you would like to go cross-platform in the first place and why RoboVM might be a good choice for you. Also lets look at what advantages does RoboVM/Xamarin architecture provides you as a developer and a wanna be Open Source Commiter.

Alexey Buzdin

September 18, 2015
Tweet

More Decks by Alexey Buzdin

Other Decks in Programming

Transcript

  1. How To: Develop an app for Android and iOS in

    Java Alexey Buzdin, September 2015
  2. @AlexeyBuzdin Developer / Trainer at C.T.Co

  3. None
  4. Angry Birds

  5. Inbox

  6. Spotify

  7. Twitter

  8. go X-platform? Go Native or

  9. None
  10. New product checklist - Release date - Platform count -

    Platform priorities - App future __________ __________ __________ __________ ? ? ? ?
  11. - Release date - Platform count - Platform priorities -

    App future __________ __________ __________ __________ 1 New product checklist
  12. - Release date - Platform count - Platform priorities -

    App future Native __________ __________ __________ __________ 1 New product checklist
  13. - Release date - Platform count - Platform priorities -

    App future __________ __________ __________ __________ All Fast All at once ? New product checklist
  14. - Release date - Platform count - Platform priorities -

    App future __________ __________ __________ __________ All Fast Cordova / PhoneGap All at once New product checklist Short Lasting
  15. Cordova / PhoneGap

  16. - Performance problems - Non native UI - Easy to

    add Platforms - One codebase - Native interop Cordova / PhoneGap Consequences
  17. - Release date - Platform count - Platform priorities -

    App future __________ __________ __________ __________ All Fast All at once Short Lasting New product checklist
  18. - Release date - Platform count - Platform priorities -

    App future __________ __________ __________ __________ All Fast Xamarin Forms / CodenameOne All at once Short Lasting New product checklist
  19. Xamarin Forms / CodenameOne

  20. - Performance like native - Native UI - Hard to

    modify gen code - Native interop - One codebase Xamarin Forms / CodenameOne Consequences
  21. - Release date - Platform count - Platform priorities -

    App future __________ __________ __________ __________ All Long One by One Long living New product checklist
  22. - Release date - Platform count - Platform priorities -

    App future __________ __________ __________ __________ All Long Xamarin / RoboVM / Tengu One by One Long living New product checklist
  23. Xamarin / RoboVM / Tengu

  24. - Performance like native - Native UI - Native library

    binding - Shared common core - Separate UI modules per platform Xamarin / RoboVM / Tengu Consequences
  25. http://java.dzone.com/articles/state-native-vs-web-vs-hybrid Great article

  26. Xamarin / RoboVM / Tengu

  27. None
  28. Core UI UI With one language

  29. Core UI UI With one language 30-50% 50-70%

  30. C# Java iOS Xamarin / RoboVM / Tengu

  31. what are we sharing?

  32. None
  33. MVVM ViewModel Model View

  34. View - User Interface Model - Logic and Data ViewModel

    - binds UI properties with internals - communicate with commands
  35. MVVM ViewModel Model View

  36. MVVM View Model ViewModel shared

  37. Activity ViewController ViewModel Service DAO

  38. None
  39. Activity ViewController onLongClick(coord) ViewModel putPoint()

  40. Activity ViewController onLongClick(coord) ViewModel putPoint() DAO savePoint()

  41. None
  42. Activity ViewController search(input) ViewModel search(input)

  43. Activity ViewController search(input) ViewModel search(input) Service internalSearch(input)

  44. Activity ViewController search(input) ViewModel search(input) Service internalSearch(input) sends ShowLocationEvent

  45. RoboVM 1.8.0 Released yesterday http://www.robovm.org/

  46. -Java bytecode to native -familiar infrastructure gradle, maven, Idea, eclipse

    java library reuse -ios lib binding; Robopods -Debugger
  47. None
  48. None
  49. -uses android-rt library -no code generation -has reflection support -xcode

    ui bindings jackson or gson should work
  50. Core UI UI With Java

  51. -Library reuse Together -Build scripts reuse -Model / persistance reuse

    -Java 8 with retrolambda
  52. More sharing?

  53. Activity ViewController onClick() ViewModel DAO savePoint(coord) saveCurrentLocation()

  54. Activity ViewController onClick() ViewModel DAO savePoint(coord) ? saveCurrentLocation()

  55. Activity ViewController onClick() ViewModel saveCurrentLocation() DAO savePoint(coord) ? Service getCoord()

  56. Service IGPSService Android Impl iOS Impl shared client- specific

  57. How to provide igpsservice?

  58. - dao = new dao()

  59. - gps = new iOSGPSservice() - dao = new dao()

  60. - vm = new ViewModel(gps, dao) - gps = new

    iOSGPSservice() - dao = new dao()
  61. - new Activity(vm) - vm = new ViewModel(gps, dao) -

    gps = new iOSGPSservice() - dao = new dao()
  62. Dependency injection

  63. which di?

  64. which di? guice or weld!

  65. which di? guice or weld! code generation sorry

  66. ever heard of Dagger? http://square.github.io/dagger/

  67. COMPILE-TIME CODE GENERATION!* Dagger features *partially

  68. COMPILE-TIME CODE GENERATION!* Dagger features *partially sorry won’t work on

    and
  69. ever heard of Dagger 2.0? http://google.github.io/dagger/

  70. COMPILE-TIME CODE GENERATION! Dagger 2.0 features will work on and

  71. https://github.com/LArchaon/robovm-dagger2-sample

  72. Summary -no silver bullet -java xamarin is here! -think of

    reuse in advance -involve in Robovm design
  73. q&A

  74. http://ej.uz/jug-gdg-vilnius-2015 September 24