Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Features
Speaker Deck
PRO
Sign in
Sign up for free
Search
Search
Android Dev em 2017 - Desenvolvendo para milhões de usuários
Search
Angelo Castelan
May 28, 2017
Programming
0
29
Android Dev em 2017 - Desenvolvendo para milhões de usuários
Palestra dada no I/O Extended Porto Alegre em 28/05/2017
Angelo Castelan
May 28, 2017
Tweet
Share
Other Decks in Programming
See All in Programming
雑に思考を整理する技術と効能
konifar
60
29k
見た目から始める生産性向上
ikumatadokoro
7
840
Compose-View Interop in Practice (mDevCamp 2024)
stewemetal
0
140
Fragment Composition of GraphQL
quramy
7
1k
サイコロで理解する統計的仮説検定の考え方
tatamiya
4
940
Hanami and htmx
bkuhlmann
0
210
Changed Rules: Architectures with Lightweight Stores
manfredsteyer
PRO
0
240
デフォルトにして至高、RubyMineの大好きな所
ruzia
0
380
Build Apps for iOS, Android & Desktop in 100% Kotlin With Compose Multiplatform (mDevCamp 2024)
zsmb
0
330
DMMプラットフォームがTiDB Cloudを採用した背景
pospome
8
4.1k
Elm Form Validation
bkuhlmann
0
510
ONE WEDGE_company_guide
1wedge_one
0
480
Featured
See All Featured
Unsuck your backbone
ammeep
663
57k
Building a Modern Day E-commerce SEO Strategy
aleyda
17
6.4k
The Art of Programming - Codeland 2020
erikaheidi
42
12k
The Invisible Customer
myddelton
114
12k
Designing Experiences People Love
moore
136
23k
The Illustrated Children's Guide to Kubernetes
chrisshort
31
46k
From Idea to $5000 a Month in 5 Months
shpigford
377
45k
Six Lessons from altMBA
skipperchong
21
3k
It's Worth the Effort
3n
180
27k
Dealing with People You Can't Stand - Big Design 2015
cassininazir
357
22k
Infographics Made Easy
chrislema
238
18k
ReactJS: Keep Simple. Everything can be a component!
pedronauck
659
120k
Transcript
Android Dev em 2017 Desenvolvendo para milhões de usuários @castelanjr
None
POR QUE? ⭐⭐⭐⭐⭐
Código Limpo == Código Testável
MVC MVP MVVM
Model View Presenter • Model: entidades, repositórios e ações do
app • View: interface passiva que mostra os dados e chama o Presenter nos comandos do usuário • Presenter: controla o model e o apresenta na view
View Presenter Model Eventos do Usuário Atualiza Model Mudança de
estado Atualiza View
Model View ViewModel • Model: entidades, repositórios e ações do
app • View: a UI • ViewModel: uma abstração da View com propriedades e comandos • Data Binding: sincroniza View e ViewModel
View ViewModel Model DataBinding Atualiza Model Mudança de estado
Não existe a opção correta!
Unit Tests UI Tests
JUnit
Mockito
Robolectric
Espresso
Android Architecture Blueprints https://github.com/googlesamples/android-architecture
Operações Assíncronas
Callback Hell }); }); }); }); }); }); }); });
}); });
RxJava • Reactive Extensions para a JVM • Gerenciamento de
programas assíncronos e baseados em eventos usando sequências de Observables • Programação Funcional
RxJava uploader.uploadFile(file) .flatMap { data -> entryRepository.createEntry(data) } .subscribeOn(Schedulers.io()) .observeOn(AndroidSchedulers.mainThread())
.subscribe({ entry -> showEntry(entry) }, { throwable -> Log.e(TAG, "Erro no upload", throwable) showErrorMessage() })
RxJava uploader.uploadFile(file) .flatMap { data -> entryRepository.createEntry(data) } .subscribeOn(Schedulers.io()) .observeOn(AndroidSchedulers.mainThread())
.subscribe({ entry -> showEntry(entry) }, { throwable -> Log.e(TAG, "Erro no upload", throwable) showErrorMessage() })
RxJava uploader.uploadFile(file) .flatMap { data -> entryRepository.createEntry(data) } .subscribeOn(Schedulers.io()) .observeOn(AndroidSchedulers.mainThread())
.subscribe({ entry -> showEntry(entry) }, { throwable -> Log.e(TAG, "Erro no upload", throwable) showErrorMessage() })
RxJava uploader.uploadFile(file) .flatMap { data -> entryRepository.createEntry(data) } .subscribeOn(Schedulers.io()) .observeOn(AndroidSchedulers.mainThread())
.subscribe({ entry -> showEntry(entry) }, { throwable -> Log.e(TAG, "Erro no upload", throwable) showErrorMessage() })
RxJava uploader.uploadFile(file) .flatMap { data -> entryRepository.createEntry(data) } .subscribeOn(Schedulers.io()) .observeOn(AndroidSchedulers.mainThread())
.subscribe({ entry -> showEntry(entry) }, { throwable -> Log.e(TAG, "Erro no upload", throwable) showErrorMessage() })
A própria linguagem!
Kotlin • Moderna, divertida, madura, robusta • 100% interoperável com
Java • Funcional • Tipagem estática e null safe • Melhor linguagem de todas
Null Safety var nonNullString: String = "Striiiiing" nonNullString = null
// Não compila!
Null Safety val nullValue: String? = null nullValue.length // Não
compila!
Null Safety val nullValue: String? = null nullValue?.length //
Default Parameters fun sayHello(name: String = "Walter White") { println("Hello,
$name!") } sayHello("Donald Draper") sayHello()
Data Classes data class User(val id: Long, val username: String,
val name: String, val followers: Long, val following: Long)
Extension Functions fun String?.isNullOrEmpty(): Boolean { return this == null
|| this.isEmpty() } "".isNullOrEmpty()
Oficializada pelo Google!
Processo Constante
Obrigado! @castelanjr