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

VIPER on Android

VIPER on Android

A brief overview with code examples on how to use VIPER architecture on Android development.

The code can be found on Github:
https://github.com/natangr/AndroidViper

Natan Grando
https://github.com/natangr
https://linkedin.com/in/natan-grando-36820397/

Cheesecake Labs

April 06, 2017
Tweet

More Decks by Cheesecake Labs

Other Decks in Programming

Transcript

  1. Agenda • Create a new Android project • Configure Kotlin

    • Introduce Contracts • Introduce VIPER • Create a VIPER login module
  2. Kotlin • Install Kotlin plugin. • Tools > Kotlin >

    Configure Kotlin in Project • Android with gradle • Select latest Kotlin version • Add Kotlin Extensions plugin to gradle file apply plugin: 'kotlin-android-extensions'
  3. Contracts interface LoginContract { interface View { fun showMessage(message: String)

    } interface Presenter { fun onLoginClicked(username: String, password: String) } interface Interactor { fun performLogin(username: String, password: String) } interface InteractorOutput { fun onLoginSucceeded() fun onLoginFailed(message: String?) } interface Router { fun presentDashboard() } }