arquitetura móvel para diferentes contextos
TRANSCRIPT
![Page 1: Arquitetura móvel para diferentes contextos](https://reader035.vdocuments.pub/reader035/viewer/2022070520/58f0a04c1a28ab74788b4603/html5/thumbnails/1.jpg)
Arquitetura móvel para diferentes contextosMarcelo Quinta
@mrquinta
![Page 2: Arquitetura móvel para diferentes contextos](https://reader035.vdocuments.pub/reader035/viewer/2022070520/58f0a04c1a28ab74788b4603/html5/thumbnails/2.jpg)
![Page 3: Arquitetura móvel para diferentes contextos](https://reader035.vdocuments.pub/reader035/viewer/2022070520/58f0a04c1a28ab74788b4603/html5/thumbnails/3.jpg)
![Page 4: Arquitetura móvel para diferentes contextos](https://reader035.vdocuments.pub/reader035/viewer/2022070520/58f0a04c1a28ab74788b4603/html5/thumbnails/4.jpg)
![Page 5: Arquitetura móvel para diferentes contextos](https://reader035.vdocuments.pub/reader035/viewer/2022070520/58f0a04c1a28ab74788b4603/html5/thumbnails/5.jpg)
https://autosorfaos.wordpress.com/2010/08/10/ford-corcel-ii-7/
![Page 6: Arquitetura móvel para diferentes contextos](https://reader035.vdocuments.pub/reader035/viewer/2022070520/58f0a04c1a28ab74788b4603/html5/thumbnails/6.jpg)
![Page 7: Arquitetura móvel para diferentes contextos](https://reader035.vdocuments.pub/reader035/viewer/2022070520/58f0a04c1a28ab74788b4603/html5/thumbnails/7.jpg)
CONTEXTO
![Page 8: Arquitetura móvel para diferentes contextos](https://reader035.vdocuments.pub/reader035/viewer/2022070520/58f0a04c1a28ab74788b4603/html5/thumbnails/8.jpg)
Quem é seu usuário?
![Page 9: Arquitetura móvel para diferentes contextos](https://reader035.vdocuments.pub/reader035/viewer/2022070520/58f0a04c1a28ab74788b4603/html5/thumbnails/9.jpg)
![Page 10: Arquitetura móvel para diferentes contextos](https://reader035.vdocuments.pub/reader035/viewer/2022070520/58f0a04c1a28ab74788b4603/html5/thumbnails/10.jpg)
“Se quiser saber o que seu usuário quer, não pergunte a ele. Veja como ele se comporta.”
Não lembro quem me disse isso
![Page 11: Arquitetura móvel para diferentes contextos](https://reader035.vdocuments.pub/reader035/viewer/2022070520/58f0a04c1a28ab74788b4603/html5/thumbnails/11.jpg)
“Onde tem gambiarra, tem oportunidade”
Júlio Souza (Projeto Redação)
![Page 12: Arquitetura móvel para diferentes contextos](https://reader035.vdocuments.pub/reader035/viewer/2022070520/58f0a04c1a28ab74788b4603/html5/thumbnails/12.jpg)
Google Analytics
![Page 13: Arquitetura móvel para diferentes contextos](https://reader035.vdocuments.pub/reader035/viewer/2022070520/58f0a04c1a28ab74788b4603/html5/thumbnails/13.jpg)
![Page 14: Arquitetura móvel para diferentes contextos](https://reader035.vdocuments.pub/reader035/viewer/2022070520/58f0a04c1a28ab74788b4603/html5/thumbnails/14.jpg)
Fabric
![Page 15: Arquitetura móvel para diferentes contextos](https://reader035.vdocuments.pub/reader035/viewer/2022070520/58f0a04c1a28ab74788b4603/html5/thumbnails/15.jpg)
Contexto da tecnologia
![Page 16: Arquitetura móvel para diferentes contextos](https://reader035.vdocuments.pub/reader035/viewer/2022070520/58f0a04c1a28ab74788b4603/html5/thumbnails/16.jpg)
![Page 17: Arquitetura móvel para diferentes contextos](https://reader035.vdocuments.pub/reader035/viewer/2022070520/58f0a04c1a28ab74788b4603/html5/thumbnails/17.jpg)
SO
PROCESSOS
![Page 18: Arquitetura móvel para diferentes contextos](https://reader035.vdocuments.pub/reader035/viewer/2022070520/58f0a04c1a28ab74788b4603/html5/thumbnails/18.jpg)
BORA RESOLVER
![Page 19: Arquitetura móvel para diferentes contextos](https://reader035.vdocuments.pub/reader035/viewer/2022070520/58f0a04c1a28ab74788b4603/html5/thumbnails/19.jpg)
Nosso escopo será este
![Page 20: Arquitetura móvel para diferentes contextos](https://reader035.vdocuments.pub/reader035/viewer/2022070520/58f0a04c1a28ab74788b4603/html5/thumbnails/20.jpg)
Conexão Web
![Page 21: Arquitetura móvel para diferentes contextos](https://reader035.vdocuments.pub/reader035/viewer/2022070520/58f0a04c1a28ab74788b4603/html5/thumbnails/21.jpg)
Evitar múltiplas requisições repetidas (e também dar sincronia a estas quando não tiver opção)
![Page 22: Arquitetura móvel para diferentes contextos](https://reader035.vdocuments.pub/reader035/viewer/2022070520/58f0a04c1a28ab74788b4603/html5/thumbnails/22.jpg)
Requisição com lista infinita de acordo com a rede
Wifi
![Page 23: Arquitetura móvel para diferentes contextos](https://reader035.vdocuments.pub/reader035/viewer/2022070520/58f0a04c1a28ab74788b4603/html5/thumbnails/23.jpg)
Requisição com lista infinita de acordo com a rede
4G
![Page 24: Arquitetura móvel para diferentes contextos](https://reader035.vdocuments.pub/reader035/viewer/2022070520/58f0a04c1a28ab74788b4603/html5/thumbnails/24.jpg)
Requisição com lista infinita de acordo com a rede
2G
![Page 25: Arquitetura móvel para diferentes contextos](https://reader035.vdocuments.pub/reader035/viewer/2022070520/58f0a04c1a28ab74788b4603/html5/thumbnails/25.jpg)
Verificando a conexão
ConnectivityManager networkManager = (ConnectivityManager) getSystemService(Context.CONNECTIVITY_SERVICE);NetworkInfo info = networkManager.getActiveNetworkInfo();int type = info.getType();int type = info.getSubtype();
![Page 26: Arquitetura móvel para diferentes contextos](https://reader035.vdocuments.pub/reader035/viewer/2022070520/58f0a04c1a28ab74788b4603/html5/thumbnails/26.jpg)
Personalize os tempos de resposta!
![Page 27: Arquitetura móvel para diferentes contextos](https://reader035.vdocuments.pub/reader035/viewer/2022070520/58f0a04c1a28ab74788b4603/html5/thumbnails/27.jpg)
Erro? Não mostre uma tela vazia
https://github.com/xiprox/ErrorView
![Page 28: Arquitetura móvel para diferentes contextos](https://reader035.vdocuments.pub/reader035/viewer/2022070520/58f0a04c1a28ab74788b4603/html5/thumbnails/28.jpg)
Flat Buffers
https://google.github.io/flatbuffers/index.html
![Page 29: Arquitetura móvel para diferentes contextos](https://reader035.vdocuments.pub/reader035/viewer/2022070520/58f0a04c1a28ab74788b4603/html5/thumbnails/29.jpg)
Flat Buffers
https://google.github.io/flatbuffers/index.html
![Page 30: Arquitetura móvel para diferentes contextos](https://reader035.vdocuments.pub/reader035/viewer/2022070520/58f0a04c1a28ab74788b4603/html5/thumbnails/30.jpg)
Sem polling
![Page 31: Arquitetura móvel para diferentes contextos](https://reader035.vdocuments.pub/reader035/viewer/2022070520/58f0a04c1a28ab74788b4603/html5/thumbnails/31.jpg)
Diga ao servidor quem você é (ou peça a pessoa do back-end dar moral pra isso)
User-Agent
![Page 32: Arquitetura móvel para diferentes contextos](https://reader035.vdocuments.pub/reader035/viewer/2022070520/58f0a04c1a28ab74788b4603/html5/thumbnails/32.jpg)
Imageria
![Page 33: Arquitetura móvel para diferentes contextos](https://reader035.vdocuments.pub/reader035/viewer/2022070520/58f0a04c1a28ab74788b4603/html5/thumbnails/33.jpg)
Se pode fazer um drawable em XML ou SVG, faça
https://developer.android.com/intl/pt-br/guide/appendix/media-formats.html
![Page 34: Arquitetura móvel para diferentes contextos](https://reader035.vdocuments.pub/reader035/viewer/2022070520/58f0a04c1a28ab74788b4603/html5/thumbnails/34.jpg)
Use imagens com cuidado
https://github.com/EverythingMe/webp-android
http://www.html5rocks.com/en/tutorials/speed/img-compression/
![Page 35: Arquitetura móvel para diferentes contextos](https://reader035.vdocuments.pub/reader035/viewer/2022070520/58f0a04c1a28ab74788b4603/html5/thumbnails/35.jpg)
Picasso.with(context).load("http://i.imgur.com/DvpvklR.png").into(imageView);
![Page 36: Arquitetura móvel para diferentes contextos](https://reader035.vdocuments.pub/reader035/viewer/2022070520/58f0a04c1a28ab74788b4603/html5/thumbnails/36.jpg)
Envie a imagem adequada
Original: 969Kb Formato JPG
Comprimida em qualidade: 317Kb Formato JPG
![Page 37: Arquitetura móvel para diferentes contextos](https://reader035.vdocuments.pub/reader035/viewer/2022070520/58f0a04c1a28ab74788b4603/html5/thumbnails/37.jpg)
Outras opções ainda melhores
Original: 20Kb Formato WebP
Qualidade e tamanho otimizados : 25Kb Formato JPG
![Page 38: Arquitetura móvel para diferentes contextos](https://reader035.vdocuments.pub/reader035/viewer/2022070520/58f0a04c1a28ab74788b4603/html5/thumbnails/38.jpg)
Tudo junto
![Page 39: Arquitetura móvel para diferentes contextos](https://reader035.vdocuments.pub/reader035/viewer/2022070520/58f0a04c1a28ab74788b4603/html5/thumbnails/39.jpg)
Gerando uma nova imagem
Bitmap bmResolution = Bitmap.createBitmap(croppedImage, 0, 0, width, height, matrix, true);
ByteArrayOutputStream out = new ByteArrayOutputStream();...bmResolution.compress(Bitmap.CompressFormat.JPEG, 90, out);Bitmap decoded = BitmapFactory.decodeStream(new ByteArrayInputStream(out.toByteArray()));
![Page 40: Arquitetura móvel para diferentes contextos](https://reader035.vdocuments.pub/reader035/viewer/2022070520/58f0a04c1a28ab74788b4603/html5/thumbnails/40.jpg)
Mídias suportadas
https://developer.android.com/guide/appendix/media-formats.html#core
![Page 41: Arquitetura móvel para diferentes contextos](https://reader035.vdocuments.pub/reader035/viewer/2022070520/58f0a04c1a28ab74788b4603/html5/thumbnails/41.jpg)
Segurança
![Page 42: Arquitetura móvel para diferentes contextos](https://reader035.vdocuments.pub/reader035/viewer/2022070520/58f0a04c1a28ab74788b4603/html5/thumbnails/42.jpg)
OAuth, MD5 checking, HTTPS, SSL?
![Page 43: Arquitetura móvel para diferentes contextos](https://reader035.vdocuments.pub/reader035/viewer/2022070520/58f0a04c1a28ab74788b4603/html5/thumbnails/43.jpg)
Allow backup: true ou false?
![Page 44: Arquitetura móvel para diferentes contextos](https://reader035.vdocuments.pub/reader035/viewer/2022070520/58f0a04c1a28ab74788b4603/html5/thumbnails/44.jpg)
Localização
![Page 45: Arquitetura móvel para diferentes contextos](https://reader035.vdocuments.pub/reader035/viewer/2022070520/58f0a04c1a28ab74788b4603/html5/thumbnails/45.jpg)
GPS somente quando necessário
![Page 46: Arquitetura móvel para diferentes contextos](https://reader035.vdocuments.pub/reader035/viewer/2022070520/58f0a04c1a28ab74788b4603/html5/thumbnails/46.jpg)
Armazenamento
![Page 47: Arquitetura móvel para diferentes contextos](https://reader035.vdocuments.pub/reader035/viewer/2022070520/58f0a04c1a28ab74788b4603/html5/thumbnails/47.jpg)
Proguard nele! Cuidado com webviews e bibliotecas
![Page 48: Arquitetura móvel para diferentes contextos](https://reader035.vdocuments.pub/reader035/viewer/2022070520/58f0a04c1a28ab74788b4603/html5/thumbnails/48.jpg)
UI
![Page 49: Arquitetura móvel para diferentes contextos](https://reader035.vdocuments.pub/reader035/viewer/2022070520/58f0a04c1a28ab74788b4603/html5/thumbnails/49.jpg)
![Page 50: Arquitetura móvel para diferentes contextos](https://reader035.vdocuments.pub/reader035/viewer/2022070520/58f0a04c1a28ab74788b4603/html5/thumbnails/50.jpg)
Xinglings estão ficando cada dia mais doidos
![Page 51: Arquitetura móvel para diferentes contextos](https://reader035.vdocuments.pub/reader035/viewer/2022070520/58f0a04c1a28ab74788b4603/html5/thumbnails/51.jpg)
![Page 52: Arquitetura móvel para diferentes contextos](https://reader035.vdocuments.pub/reader035/viewer/2022070520/58f0a04c1a28ab74788b4603/html5/thumbnails/52.jpg)
Material Design Support Library
![Page 53: Arquitetura móvel para diferentes contextos](https://reader035.vdocuments.pub/reader035/viewer/2022070520/58f0a04c1a28ab74788b4603/html5/thumbnails/53.jpg)
Material Design Support Library
![Page 54: Arquitetura móvel para diferentes contextos](https://reader035.vdocuments.pub/reader035/viewer/2022070520/58f0a04c1a28ab74788b4603/html5/thumbnails/54.jpg)
![Page 55: Arquitetura móvel para diferentes contextos](https://reader035.vdocuments.pub/reader035/viewer/2022070520/58f0a04c1a28ab74788b4603/html5/thumbnails/55.jpg)
Cursos do Udacity que fiz e indico
Android Performance
https://www.udacity.com/course/android-performance--ud825
UX Design for Mobile developers
https://www.udacity.com/course/ux-design-for-mobile-developers--ud849
Advanced Android App Development
https://www.udacity.com/course/advanced-android-app-development--ud855
Developing Android Apps https://www.udacity.com/course/developing-android-apps--ud853
![Page 56: Arquitetura móvel para diferentes contextos](https://reader035.vdocuments.pub/reader035/viewer/2022070520/58f0a04c1a28ab74788b4603/html5/thumbnails/56.jpg)
Palestra interessante para assistir Building for billions on Android - Google I/O 2016
https://www.youtube.com/watch?v=vaEV8bNi1Dw
![Page 57: Arquitetura móvel para diferentes contextos](https://reader035.vdocuments.pub/reader035/viewer/2022070520/58f0a04c1a28ab74788b4603/html5/thumbnails/57.jpg)
Indicação de leitura
![Page 58: Arquitetura móvel para diferentes contextos](https://reader035.vdocuments.pub/reader035/viewer/2022070520/58f0a04c1a28ab74788b4603/html5/thumbnails/58.jpg)
Venha bater um papo com a gente
Google Developer Experts
![Page 59: Arquitetura móvel para diferentes contextos](https://reader035.vdocuments.pub/reader035/viewer/2022070520/58f0a04c1a28ab74788b4603/html5/thumbnails/59.jpg)
Marcelo Quinta@mrquinta
Obrigado
Muito dessa apt foi feito com material disponibilizado pelo Google. Dê uma olhada no canal do Youtube deles: https://www.youtube.com/user/GoogleDevelopers