Upgrade to Pro — share decks privately, control downloads, hide ads and more …

Android MVP with kotlin

TaeHwan
February 20, 2017

Android MVP with kotlin

GDG Inchon is a presentation on "Android MVP with Kotlin".

TaeHwan

February 20, 2017
Tweet

More Decks by TaeHwan

Other Decks in Technology

Transcript

  1. Introduce • 5֙ରী ੽যٚ Android ѐߊ੗ • GDG Seoul ਍৔੗

    • BLOG : Է ݆਷ ѐߊ੗о غ੗ ਍৔઺ • h5p:/ /thdev.tech • h5p:/ /thdev.net GDG Incheon - thdev.tech, Taehwan 2017 2
  2. MVC - Model • ؘ੉ఠܳ ੿੄ೠ׮. • ֎౟ਕ௼ ؘ੉ఠ, DB

    ١ GDG Incheon - thdev.tech, Taehwan 2017 8
  3. MVC - View • Ac$vity/Fragment/layoutਸ ನೣೞৈ View ੿੄ оמ •

    layout ݅ਸ View ੿੄ оמ • Realm ನझ౴ : উ٘۽੉٘੄ MVC, MVP, MVVM ઙ೤ উղࢲ • Control ੿੄ী ٮۄ Modelਸ ࠛ۞৬ Viewܳ јन ೠ׮ GDG Incheon - thdev.tech, Taehwan 2017 9
  4. MVC - Control • ৻ࠗ੄ ࢎਊ੗ ੑ۱ਸ ߉Ҋ, ݽ؛੄ ੿੄ী

    ٮۄ View੄ јनਸ ذח׮ • Ac*vity/Fragmentо ੉ ৉ഝਸ ೣԋ ೠ׮ GDG Incheon - thdev.tech, Taehwan 2017 10
  5. MVP - Model • ؘ੉ఠܳ ੿੄ೠ׮. • ֎౟ਕ௼ ؘ੉ఠ, DB

    ١ GDG Incheon - thdev.tech, Taehwan 2017 15
  6. MVP - View • Ac$vity/Fragment ੹୓ܳ ViewۄҊ ೠ׮. • Control(ࢎਊ੗

    ੉߮౟)ܳ ߉ই ੉ܳ Presenter۽ ੹׳ೠ׮. • Presenter۽ ࠗఠ ੉߮౟ܳ ߉ই View јनೠ׮. GDG Incheon - thdev.tech, Taehwan 2017 16
  7. MVP - Presenter • View৬ 1:1 ҙ҅ܳ ਬ૑ೠ׮ • View۽ࠗఠ

    ੉߮౟ܳ ߉Ҋ, ੉ܳ Modelҗ੄ ҙ҅ী ٮۄ View јनਸ ਬب GDG Incheon - thdev.tech, Taehwan 2017 17
  8. MVVM - Model • ؘ੉ఠܳ ੿੄ೠ׮. • ֎౟ਕ௼ ؘ੉ఠ, DB

    ١ GDG Incheon - thdev.tech, Taehwan 2017 21
  9. MVVM - View • Ac$vity/Fragment ੹୓ܳ ViewۄҊ ೠ׮. • Control(ࢎਊ੗

    ੉߮౟)ܳ ߉ই ੉ܳ ViewModel ٜ۽ ੹׳ೠ׮. • ViewModel ٜ۽ ੉߮౟ܳ ੹׳ ߉ই ੉ܳ јनೠ׮ GDG Incheon - thdev.tech, Taehwan 2017 22
  10. MVVM - ViewModel • Presenter৬ ਬࢎೠ ഋక੉׮. • ViewModel੄ ੿੄ח

    ݽ؛ ߹۽ ܻ࠙ೞ޲۽, Viewী ઙࣘغ૑ ঋח׮. GDG Incheon - thdev.tech, Taehwan 2017 23
  11. MVVM • Reac&ve ੸ੋ ߑߨ(kickstarter)ਸ ࢎਊೞৈ ੸ਊ оמ • Rx੄

    Subjectܳ ࢎਊೞৈ ੸ਊ оמ • DataBindingਸ ాೠ ੸ਊ оמ GDG Incheon - thdev.tech, Taehwan 2017 24
  12. Architecture ੸ਊ੄ ݾ੸ • ௏٘ ࠂ੟ب ߂ झ౵ѱ౭ ௏٘ ઴੉ӝ

    • ݺഛೠ ௏٘ ੘ࢿ • ਬ૑ࠁࣻо ಞೠ ௏٘ ੘ࢿ • పझ౟ оמೠ ഋక੄ ௏٘ ੘ࢿ • ۨ੉যܳ ܻ࠙ೞৈ ӭՔೠ ௏٘ ੘ࢿ GDG Incheon - thdev.tech, Taehwan 2017 35
  13. ੉۠ ࠗ࠙਷ • Architecture ౵ঈೞҊ ૓೯ • Reac-ve • DataBinding

    • Model ੿੄ ݺഛࢿ GDG Incheon - thdev.tech, Taehwan 2017 36
  14. Presenter ࢎਊೞח ߑߨਸ ݢ੷ ঌইࠁ੗ • Presenter(View/Presenter) - interface ੿੄

    / PresenterImpl(ҳഅ) • Contract(View/Presenter) - interface ੿੄ / Presenter(ҳഅ) • View - interface ੿੄ / Presenter(ҳഅ) GDG Incheon - thdev.tech, Taehwan 2017 38
  15. Contract(View/Presenter)/Presenter(ҳഅ) - 1 interface SampleContract { interface View { //

    View method } interface Presenter { // presenter method fun setView(view: View) } } GDG Incheon - thdev.tech, Taehwan 2017 43
  16. Contract(View/Presenter)/Presenter(ҳഅ) - 2 interface SamplePresenter : SampleContract.Presenter { private lateinit

    var view: View override fun setView(view: View) { this.view = view } // presenter method } GDG Incheon - thdev.tech, Taehwan 2017 44
  17. View - interface ੿੄ / Presenter(ҳഅ) - 1 interface SampleView

    { // View method } class SamplePresenter(view: View) { // Presenter method } GDG Incheon - thdev.tech, Taehwan 2017 46
  18. View - interface ੿੄ / Presenter(ҳഅ) - 2 class SampleActivity

    : SampleView { val presenter: SamplePresenter override fun onCreate(savedInstanceState: Bundle?) { super.onCreate(savedInstanceState) // ࢬۚ presenter = SamplePresenter(this) } } GDG Incheon - thdev.tech, Taehwan 2017 47
  19. ଵҊ੗ܐ • উ٘۽੉٘੄ MVC, MVP, MVVM ઙ೤ উղࢲ - realm

    • উ٘۽੉٘ MVP - taehwan • Android Architecture Blueprints • kotlin reference • MVP Login Sample ௏٘ - taehwan GDG Incheon - thdev.tech, Taehwan 2017 51