The document discusses working effectively with ViewModels and test-driven development (TDD) in Android. It provides an overview of ViewModels and how they integrate with the Android lifecycle system using Lifecycle components and LiveData. It also covers tips for using ViewModels such as handling single emitted events, sharing data between fragments, RxJava support, and testing ViewModels with TestObserver and mock objects.
Having trouble getting selenium WebDriver to do what you want? Want to put together a Swiss Army library for WebDriver? Thinking about creating your own framework? This presentation will show you some of the most common functions you can do in WebDriver. These functions come from my current automation framework, my automation experience, and from common trends on the WebDriver Google group.
Efficient and Testable MVVM pattern
김범준
레이니스트 / 안드로이드 개발
레이니스트에서 뱅크샐러드 안드로이드 어플리케이션을 개발하고 있는 5년차 개발자 입니다. Reactive, 함수형 프로그래밍에 관심이 많으며 효율적이고 가독성 있는 코드를 짜는 것을 항상 목표로 부단히 노력중입니다.
The best practices approach for organizing Android applications into logical components has been widely debated by the developer community over the last several years. If you’ve had trouble choosing between MVC, MVP, MVVM and Reactive Architectures, or even understanding how they differ exactly, you’re not alone! Up until now, there has been no official guidance from Google, however at IO’17, Google announced Android Architecture Components as a recommended pattern moving forward. In this session you’ll learn how these architectural patterns relate to each other and the motivations behind each. You’ll also learn how to apply Android Architecture Components effectively through from live code and interactive demonstrations.
Would you like to make your Android UI code cleaner and more reactive? Android data binding can help. In this talk you’ll learn everything you need to know about data binding, including why it’s so powerful and how to use it effectively. If you haven’t tried data binding in the past, that’s okay! We’ll start with the basics, assuming no prior knowledge and slowly move into more advanced topics, such as 2-way binding, binding adapters, converters, best practices and common pitfalls to avoid.
SE2016 Android Mikle Anokhin "Speed up application development with data bind...Inhacking
Event: #SE2016
Stage: Android
Data: 4 of September 2016
Speaker: Mikle Anokhin
Topic: Speed up application development with data binding
INHACKING site: https://inhacking.com
SE2016 site: http://se2016.inhacking.com/
Google Plus SignIn : l'Authentification GoogleMathias Seguy
Cette conférence vous expliquera en détail pourquoi mettre en place cette authentification et surtout comment la mettre en place.
Vous découvrirez ainsi:
la console des GoogleService,
comment utiliser l’objet PlusClient et ConnectionResult pour gérer l’identification de votre utilisateur,
comment mettre en place la « magic connexion » et la « manual connexion »,
comment mettre en place cette authentification au sein du cycle de vie de votre application,
comment charger le graphe social de l’utilisateur, faire des posts interactifs et des « application activities »…
Un grand moment pour tous ceux qui se demandent encore quelle est la meilleure stratégie pour authentifier son utilisateur.
Cette conférence s’associe:
d’un tutorial que vous pouvez retrouver sur GitHub: SignInWithGoogleTutorial(https://github.com/MathiasSeguy-Android2EE/SignInWithGoogleTutorial) sur GitHub.
d’une application mettant en place cette authentification que vous pouvez retrouver sur GooglePlay: MyPublicGoogleProfile (https://play.google.com/store/apps/details?id=com.android2ee.project.gplus.signin.publicid&hl=fr).
Et bien sûr la conférence va être disponible sur Android2EE dès le Vendredi 20 au rayon OpenResource\Conférences.
Vous aussi, authentifiez vos utilisateurs, inter-agissez avec eux et simplifiez leur la vie:
En espérant que vous y découvrirez votre bonheur :) .
Having trouble getting selenium WebDriver to do what you want? Want to put together a Swiss Army library for WebDriver? Thinking about creating your own framework? This presentation will show you some of the most common functions you can do in WebDriver. These functions come from my current automation framework, my automation experience, and from common trends on the WebDriver Google group.
Efficient and Testable MVVM pattern
김범준
레이니스트 / 안드로이드 개발
레이니스트에서 뱅크샐러드 안드로이드 어플리케이션을 개발하고 있는 5년차 개발자 입니다. Reactive, 함수형 프로그래밍에 관심이 많으며 효율적이고 가독성 있는 코드를 짜는 것을 항상 목표로 부단히 노력중입니다.
The best practices approach for organizing Android applications into logical components has been widely debated by the developer community over the last several years. If you’ve had trouble choosing between MVC, MVP, MVVM and Reactive Architectures, or even understanding how they differ exactly, you’re not alone! Up until now, there has been no official guidance from Google, however at IO’17, Google announced Android Architecture Components as a recommended pattern moving forward. In this session you’ll learn how these architectural patterns relate to each other and the motivations behind each. You’ll also learn how to apply Android Architecture Components effectively through from live code and interactive demonstrations.
Would you like to make your Android UI code cleaner and more reactive? Android data binding can help. In this talk you’ll learn everything you need to know about data binding, including why it’s so powerful and how to use it effectively. If you haven’t tried data binding in the past, that’s okay! We’ll start with the basics, assuming no prior knowledge and slowly move into more advanced topics, such as 2-way binding, binding adapters, converters, best practices and common pitfalls to avoid.
SE2016 Android Mikle Anokhin "Speed up application development with data bind...Inhacking
Event: #SE2016
Stage: Android
Data: 4 of September 2016
Speaker: Mikle Anokhin
Topic: Speed up application development with data binding
INHACKING site: https://inhacking.com
SE2016 site: http://se2016.inhacking.com/
Google Plus SignIn : l'Authentification GoogleMathias Seguy
Cette conférence vous expliquera en détail pourquoi mettre en place cette authentification et surtout comment la mettre en place.
Vous découvrirez ainsi:
la console des GoogleService,
comment utiliser l’objet PlusClient et ConnectionResult pour gérer l’identification de votre utilisateur,
comment mettre en place la « magic connexion » et la « manual connexion »,
comment mettre en place cette authentification au sein du cycle de vie de votre application,
comment charger le graphe social de l’utilisateur, faire des posts interactifs et des « application activities »…
Un grand moment pour tous ceux qui se demandent encore quelle est la meilleure stratégie pour authentifier son utilisateur.
Cette conférence s’associe:
d’un tutorial que vous pouvez retrouver sur GitHub: SignInWithGoogleTutorial(https://github.com/MathiasSeguy-Android2EE/SignInWithGoogleTutorial) sur GitHub.
d’une application mettant en place cette authentification que vous pouvez retrouver sur GooglePlay: MyPublicGoogleProfile (https://play.google.com/store/apps/details?id=com.android2ee.project.gplus.signin.publicid&hl=fr).
Et bien sûr la conférence va être disponible sur Android2EE dès le Vendredi 20 au rayon OpenResource\Conférences.
Vous aussi, authentifiez vos utilisateurs, inter-agissez avec eux et simplifiez leur la vie:
En espérant que vous y découvrirez votre bonheur :) .
Testing Android apps based on Dagger and RxJava Droidcon UKFabio Collini
Writing reliable tests is not easy for many reasons, especially when asynchronous code is involved. Some libraries can be used to create a testable architecture (for example Dagger and RxJava) and to simplify testing (Mockito, AssertJ and DaggerMock). In this talk you'll learn how to write JVM and Espresso tests with particular attention on how to replace real objects with mocks and how to test asynchronous RxJava code. In this talk, you will also explore:
how to take advantage of Mockito and other libraries to write good JVM and Espresso tests in both Java and Kotlin
how to use DaggerMock (an open source library available on github to avoid boilerplate code in tests
how to test asynchronous RxJava code using a JVM test
Nessa apresentação demonstro como aplicar alguns dos Architecture Components disponíveis no Jetpack em uma arquitetura que segue o padrão Clean com MVVM.
Compose is stable, it's time to integrate it into our apps! But it can be harder than expected and there are some questions to answer. Can the same architecture of a View-based app be reused or should we change it? Should the Compose code be aware of the architecture at all? And should the non UI code be changed to start using Compose? What can be replaced with a Composable, only the layouts or also something else?
Probably the best answer to all these questions is “it depends”, in this talk we’ll see some reasons and how to leverage Compose and the other tools to create a good architecture. Compose is more than just a UI framework and it can seem appealing to use it in a big portion of an app, a good architecture can be useful to limit this portion and use it only when necessary.
Доклад включает в себя рассмотрение ключевых особенностей библиотеки. Также описывает обработку событий внутри библиотеки и в сформированных биндингах.
Дополнительно рассматривается создание собственных компонентов, расширяющих возможности элементов интерфейса, и в конце будет уделено отдельное внимание реализации двустороннего биндинга.
"Android Data Binding в массы" Михаил АнохинFwdays
Рассмотрим что это такое, как работает, какие возможности предоставляет библиотека, как обрабатываются события внутри бибилиотеки и фрагменты кода сгенерированные для биндингов.
Также узнаем как добавить библиотеку в проект и на практических примерах оценим ее достоинства и недостатки при использовании в проекте.
Dinheiro em Java: Joda-Money, Money API e alémOtávio Santana
Boa parte dos sistemas que desenvolvemos manipulam valores monetários. Mas os conceitos de "Dinheiro" e "Moeda" são comumente relegados a tipos primitivos como Double e BigDecimal. Muitas vezes são criados tipos customizados, mas problemas como taxa de câmbio, conversões, arredondamentos e formatação com diferentes moedas geralmente extrapolam o esperado.
Nesta palestra veremos vários casos de uso e muito código, mostrando como grandes empresas resolvem esses problemas ao lidarem com moedas e valores monetários. Veremos como o banco Credit Suisse, entre outras organizações, usam frameworks como o Joda-Money e a implementação de referência da JSR-354 (Money API) que estará presente no Java 9 – e como você já pode se beneficiar hoje dessas APIs.
Code to DI For - Dependency Injection for Modern ApplicationsCaleb Jenkins
This talk introduces the concepts of factories, strategy pattern, Inversion of Control, dependency injection and several of the available frameworks. We'll also look at common dependency injection patterns and various IoC/DI frameworks, the pros & cons, practical steps and guidance as well some of the real world scenarios with impact to unit testing and application architecture.
First presented at the Ft. Worth .NET Users Group on March 15th, 2016 - http://developingux.com/2016/03/14/code-to-di-for-in-ft-worth/ - Code will be posted to my GitHub soon! https://github.com/calebjenkins/ (Talks.Code-to-DI-For)
La conférence « ProTips » de Mathias Seguy (Android2EE).
Cette conférence a eu lieu lors du BarCamp de la DroidCon Paris, Lundi 17 Juin 2013.
Si vous êtes un JUG ou un AUG et que cette conférence vous interesse, n'hésitez pas à me contacter.
Si vous souhaitez apprendre la technologie Android, contacter moi: mathias.seguy@android2ee.com, je suis formateur Android et les formations Android que je dispense sont exceptionnelles.
Speaker:Mathias est le fondateur de la société Android2ee spécialisée dans la technologie Android.
Il est :
• formateur Android,
• expert logiciel Android,
• speaker Android sur de grandes conférences Java : AndroidCon, Devoxx France, Eclipse Day Toulouse, JCertif Africa, Toulouse JUG, CocoAhead,…
• Rédacteur Android sur Developpez.com ;
• Programmateur Android : MyLight, MyTorch, MySensors, JCertifMobile disponibles sur GooglePlay ;
• Docteur en Mathématiques Fondamentales et Ingénieur de l’ENSEEIHT ;
• Expert technique de l’agence nationale de la recherche française ;
Il présentera au cours de cette conférence sa vision sur la mise en place d’une architecture d’une application Android pertinente et partagera les meilleurs pro-tips (astuces de pro) de sa connaissance. A ne pas manquez.
Mathias Séguy
mathias.seguy@android2ee.com
Fondateur Android2EE
Formation – Expertise – Consulting Android.
Ebooks pour apprendre la programmation sous Android.
At the time of writing, React hooks are still in alpha but they can already be used and, since it takes a while to get used to them, it's better to understand them as soon as possible. In this talk we will see some use cases in which we refactor a class component into a hook-based functional component.
Reactive Model-View-ViewModel ArchitectureGyuwon Yi
컨텐츠 중심의 모바일 서비스 응용프로그램을 개발하기 위해 MVVM(Model-View-ViewModel) 패턴과 Rx(Reactive Extensions)를 활용해 설계한 Reactive MVVM 아키텍쳐를 설명합니다. 조금 더 자세한 설명은 블로그 포스트를 참고하세요. https://justhackem.wordpress.com/2015/03/19/rmvvm-architecture/
Testing Android apps based on Dagger and RxJava Droidcon UKFabio Collini
Writing reliable tests is not easy for many reasons, especially when asynchronous code is involved. Some libraries can be used to create a testable architecture (for example Dagger and RxJava) and to simplify testing (Mockito, AssertJ and DaggerMock). In this talk you'll learn how to write JVM and Espresso tests with particular attention on how to replace real objects with mocks and how to test asynchronous RxJava code. In this talk, you will also explore:
how to take advantage of Mockito and other libraries to write good JVM and Espresso tests in both Java and Kotlin
how to use DaggerMock (an open source library available on github to avoid boilerplate code in tests
how to test asynchronous RxJava code using a JVM test
Nessa apresentação demonstro como aplicar alguns dos Architecture Components disponíveis no Jetpack em uma arquitetura que segue o padrão Clean com MVVM.
Compose is stable, it's time to integrate it into our apps! But it can be harder than expected and there are some questions to answer. Can the same architecture of a View-based app be reused or should we change it? Should the Compose code be aware of the architecture at all? And should the non UI code be changed to start using Compose? What can be replaced with a Composable, only the layouts or also something else?
Probably the best answer to all these questions is “it depends”, in this talk we’ll see some reasons and how to leverage Compose and the other tools to create a good architecture. Compose is more than just a UI framework and it can seem appealing to use it in a big portion of an app, a good architecture can be useful to limit this portion and use it only when necessary.
Доклад включает в себя рассмотрение ключевых особенностей библиотеки. Также описывает обработку событий внутри библиотеки и в сформированных биндингах.
Дополнительно рассматривается создание собственных компонентов, расширяющих возможности элементов интерфейса, и в конце будет уделено отдельное внимание реализации двустороннего биндинга.
"Android Data Binding в массы" Михаил АнохинFwdays
Рассмотрим что это такое, как работает, какие возможности предоставляет библиотека, как обрабатываются события внутри бибилиотеки и фрагменты кода сгенерированные для биндингов.
Также узнаем как добавить библиотеку в проект и на практических примерах оценим ее достоинства и недостатки при использовании в проекте.
Dinheiro em Java: Joda-Money, Money API e alémOtávio Santana
Boa parte dos sistemas que desenvolvemos manipulam valores monetários. Mas os conceitos de "Dinheiro" e "Moeda" são comumente relegados a tipos primitivos como Double e BigDecimal. Muitas vezes são criados tipos customizados, mas problemas como taxa de câmbio, conversões, arredondamentos e formatação com diferentes moedas geralmente extrapolam o esperado.
Nesta palestra veremos vários casos de uso e muito código, mostrando como grandes empresas resolvem esses problemas ao lidarem com moedas e valores monetários. Veremos como o banco Credit Suisse, entre outras organizações, usam frameworks como o Joda-Money e a implementação de referência da JSR-354 (Money API) que estará presente no Java 9 – e como você já pode se beneficiar hoje dessas APIs.
Code to DI For - Dependency Injection for Modern ApplicationsCaleb Jenkins
This talk introduces the concepts of factories, strategy pattern, Inversion of Control, dependency injection and several of the available frameworks. We'll also look at common dependency injection patterns and various IoC/DI frameworks, the pros & cons, practical steps and guidance as well some of the real world scenarios with impact to unit testing and application architecture.
First presented at the Ft. Worth .NET Users Group on March 15th, 2016 - http://developingux.com/2016/03/14/code-to-di-for-in-ft-worth/ - Code will be posted to my GitHub soon! https://github.com/calebjenkins/ (Talks.Code-to-DI-For)
La conférence « ProTips » de Mathias Seguy (Android2EE).
Cette conférence a eu lieu lors du BarCamp de la DroidCon Paris, Lundi 17 Juin 2013.
Si vous êtes un JUG ou un AUG et que cette conférence vous interesse, n'hésitez pas à me contacter.
Si vous souhaitez apprendre la technologie Android, contacter moi: mathias.seguy@android2ee.com, je suis formateur Android et les formations Android que je dispense sont exceptionnelles.
Speaker:Mathias est le fondateur de la société Android2ee spécialisée dans la technologie Android.
Il est :
• formateur Android,
• expert logiciel Android,
• speaker Android sur de grandes conférences Java : AndroidCon, Devoxx France, Eclipse Day Toulouse, JCertif Africa, Toulouse JUG, CocoAhead,…
• Rédacteur Android sur Developpez.com ;
• Programmateur Android : MyLight, MyTorch, MySensors, JCertifMobile disponibles sur GooglePlay ;
• Docteur en Mathématiques Fondamentales et Ingénieur de l’ENSEEIHT ;
• Expert technique de l’agence nationale de la recherche française ;
Il présentera au cours de cette conférence sa vision sur la mise en place d’une architecture d’une application Android pertinente et partagera les meilleurs pro-tips (astuces de pro) de sa connaissance. A ne pas manquez.
Mathias Séguy
mathias.seguy@android2ee.com
Fondateur Android2EE
Formation – Expertise – Consulting Android.
Ebooks pour apprendre la programmation sous Android.
At the time of writing, React hooks are still in alpha but they can already be used and, since it takes a while to get used to them, it's better to understand them as soon as possible. In this talk we will see some use cases in which we refactor a class component into a hook-based functional component.
Reactive Model-View-ViewModel ArchitectureGyuwon Yi
컨텐츠 중심의 모바일 서비스 응용프로그램을 개발하기 위해 MVVM(Model-View-ViewModel) 패턴과 Rx(Reactive Extensions)를 활용해 설계한 Reactive MVVM 아키텍쳐를 설명합니다. 조금 더 자세한 설명은 블로그 포스트를 참고하세요. https://justhackem.wordpress.com/2015/03/19/rmvvm-architecture/
A collection of libraries that help you design robust, testable, and maintainable apps. Start with classes for managing your UI component lifecycle and handling data persistence.
Dicoding Developer Coaching merupakan webinar, yang membahas tuntas kendala maupun pertanyaan yang sering ditanyakan di Academy Dicoding.
Tema kali ini adalah "Mengenal Macam-Macam Software Design Pattern"
Design Pattern adalah sebuah solusi umum yang telah teruji dan bisa digunakan kembali untuk menyelesaikan suatu masalah yang sering terjadi pada perancangan perangkat lunak. Dalam pengembangan aplikasi Android dan pengembangan aplikasi pada umumnya, beberapa permasalahan yang bersifat berulang dapat diatasi dengan Design Patterns. Yaitu dengan meningkatkan kualitas rancangan aplikasi pada aspek-aspek penggunaan ulang (reusability), perluasan fungsi (extensibility), skalabilitas (scalability) dan pemeliharaan (maintainability).
Conductor is a lightweight alternative to Fragments that enables developers to build single activity apps in an easy way. In this talk I give an introduction to the library and some complex scenarios.
In this meetup Eyal Vardi will talk about Angular 2.0 architecture. The session will focus on the main parts of Angular 2.0:
Application Bootstrap
Angular Compiler
Hierarchical Injector
Component Lifecycle Hooks
Change Detector
Renderer
Dynamic component creation
Each part will be explained and analyzed. In some cases we will dive into Angular 2.0 source code. Our purpose is to list the Do's & Don’ts of Angular.
The session is mostly targeted for developers which already have some experience with Angular 2.0.
This talk was presented at TechTalks@Lohika - Android, Kyiv, UA, 22 Oct 2016
* How to build scalable, flexible and robust system;
* Why MVC/MVP/MVVM is not an architecture;
* What is Clean Architecture;
* Considering VIPER architecture as an adaptation of Bob Martin's CA for mobile projects: main components, principles, pros & cons;
* Explanation of many buzzwords: SRP, Flow of Control, Business Rules, Massive View Controllers etc.
Taming Core Data by Arek Holko, MacoscopeMacoscope
Core Data is a framework that you use to manage the model layer objects in your application. A framework that you use to build the persistence layer in your application.
Building Modern Apps using Android Architecture ComponentsHassan Abid
Android architecture components are part of Android Jetpack. They are a collection of libraries that help you design robust, testable, and maintainable apps. In this talk, We will cover LiveData, ViewModel, Room and lifecycle components. We will go through practical code example to understand modern android app architecture especially MVVM architecture.
Presentation from https://events.epam.com/events/mobile-people-open-android-meetup
Describes how alert dialogs can be treated in MVVM architecture and how we can use Android Databinding plugin to control their appearance.
Similar to Working effectively with ViewModels and TDD - UA Mobile 2019 (20)
Designing iOS+Android project without using multiplatform frameworks - UA Mob...UA Mobile
Using React Native, Flutter, Hybrid Web, Unity, Kotlin Multiplatform could be an interesting strategy, but what if we want to stay within traditional native development on both platforms?
A syntax of Swift and Kotlin looks pretty similar, especially if you are cooking it with RX. So, what if we will implement a new feature on one platform and then, kinda, copy-paste the code to another one, with minimum modification? How good it will work for us? How should we deal with platform-specific features? Will this strategy make a project too complex?
This speech will show the way, how to design your project in order to minimize the headache of implementing the same feature for both mobile platforms. Also, we will talk about gains and losses during implementation on a real project with this design idea.
http://uamobile.org/uk/topics/designing-iosandroid-project-without-using-multiplatform-frameworks
Декларативное программирование клиент-серверных приложений на андроид - UA Mo...UA Mobile
Практически сразу после написания первой программы возникла проблема повышения производительности труда программистов. Несмотря на предпринятые за прошедшее время большие усилия и достигнутые значительные результаты в повышении производительности труда, эта проблема и сейчас является актуальной.
Для решения указанной проблемы применяют разнообразные способы и методы. Основными из них являются организационно-социальные методы, использование разнообразных библиотек, паттернов, шаблонов. Перспективным является применение декларативных языков программирования. К сожалению, существующие декларативные языки ориентированы на ту или иную предметную область.
Сотрудниками компании “Брендер” (г. Харьков) создана библиотека реализующая принципы декларативного программирования при разработке клиент - серверных приложений на андроиде.
В докладе будут рассмотрены основы декларативного программирования клиент-серверных приложений на примере реального коммерческого проекта. Также будет показан анализ производительности и качества разработки приложений традиционными технологиями и с использованием библиотеки декларативного программирования.
Протягом останніх двох років Room був переважним рішенням для роботи з SQLite в Android. Але нещодавно була випущена нова версія бібліотеки SQLDelight, яка підтримує kotlin multiplatform, має перероблений api, новий генерований Kotlin-код, розширення до RxJava2, підтримує Paging-бібліотеки та багато іншого. З його можливістю генерувати в live-режимі typesafe kotlin код з чистого SQL за допомогою плагіну Android Studio важко конкурувати. Чи все ще варто розглядати інші рішення, маючи такий потужний інструмент?!
На цій сесії ми розглянемо основні можливості SQLDelight та в live-режимі побачимо, як він працює. Розберемо типові випадки його використання та поміркуємо про можливості multiplatform використання SQLDelight у майбутньому.
http://uamobile.org/uk/topics/leave-your-room-behind
OpenId and OAuth2: Rear, Medium, Well Done - UA Mobile 2019UA Mobile
Десятиліття тому Інтернет був зовсім не торт і мобільні пристрої не були вишенькою. Вразливості у доступі до персональних даних стирчали з таких місць, куди сьогодні може дістатись і дитина, та під час перегляду свинки Пеппи злити доступ до всіх ваших кредитних карт.
Прихід протоколу OAuth не зміг врятувати нас від ремейків Філіпа Кіркорова та клауд-репу, але спробував убезпечити доступ до наших даних. Але він не допоможе тобі, юзернейм, якщо ти не вмієш користуватися ним як слід.
Так що влаштовуйся покомфортніше на кухні мобільної авторизації, будемо готувати OAuth2 та OpenId.
Протягом цієї сесії я розповім:
- Що таке SAML (та про ледачі банки)
- Чим авторизація відрізняється від аутентифікації
- Що таке OAuth та OpenID та навіщо вони потрібні
- Які є OpenID SDK та чи варто їх використовувати?
http://uamobile.org/uk/topics/openid-and-oauth2-rear-medium-well-done
Google Wear OS watch faces and applications development - UA Mobile 2019UA Mobile
Google Wear OS, formerly Android Wear, is the platform for wearable devices, watches primarily. In this talk, I would like to present what kind of applications may be developed for this platform, how it differs from regular Android development, what are the limitations, pitfalls and caveats.
In the deck I plan to cover the next topics:
- Kinds of applications available
- API available on the watch itself
- API for communication with a connected phone
- Watch face development specifics
http://uamobile.org/uk/topics/google-wear-os-watch-faces-and-applications-development
Історія декількох проектів та що в них пішло не так - UA Mobile 2019UA Mobile
У середовищі розробників існує думка про те, що сучасні проекти, зокрема - Android проекти, - всього лише пазл з бібліотек та невеликої кількості бізнес-логіки. В рамках моєї презентації ми розглянемо кілька проектів, на прикладі яких я покажу деякі проблеми та приховану вартість використання деяких бібліотек, про яку мало хто замислюється.
В якості бонуса ми подивимося на деякі приклади очевидного (і не дуже) поганого коду та поганої архітектури.
Під час презентації ми розглядаємо як деякі відомі бібліотеки (RxAndroid, Dagger, Android Architecture Components) використовуються в занадто широкому сенсі або на занадто ранній стадії, і як це заважає проекту, викликаючи вельми неочевидні проблеми як для розробника, так і для кінцевого користувача.
http://uamobile.org/uk/topics/istoriya-dekilkoh-proektiv-ta-shcho-v-nyh-pishlo-ne-tak
Managing State in Reactive applications - UA Mobile 2019UA Mobile
Reactive programming becoming very popular these days and many people already adopted or started to adopt it in their projects. This is indeed a great tool but in the wrong hands, it quickly can get out of hands. Polluting the codebase with spaghettis of reactive operators where it can be hard to reason about and debug.
In this talk, I will share our experience with reactive programming at Babylon Health. And show our approach on how we manage the state in our ViewModels in a unidirectional way.
http://uamobile.org/uk/topics/managing-state-reactive-applications
Ідіоматична ін'єкція залежностей на Kotlin без фреймворків - UA Mobile2019UA Mobile
Всі сучасні популярні DI-фрейморки для Java використовують обробку анотацій під час компіляції та/або під час виконання програми. Вони однаково добре працюють і для Kotlin, але мають свої недоліки, бо генерують забагато коду та/або використовують рефлексію, що негативно позначається на часі компіляції додатку, його розмірі та швидкодії. Крім того, зазвичай їх конфігурація є нетривіальною для великого проекту. Kotlin пішов кращим шляхом...
В рамках доповіді буде продемонстровано як можна легко та ідіоматично організувати DI у своєму коді без допомоги сторонніх фреймворків. Натомість, в режимі програмування наживо ми разом створимо свій фреймворк без жодної анотації, де використаємо виключно стандартні можливості мови Kotlin.
http://uamobile.org/uk/topics/idiomatichna-iniekciya-zalezhnostey-na-kotlin-bez-freymvorkiv
Актуальні практики дизайну мобільних додатків - UA Mobile 2019UA Mobile
Вже десять років ми активно працюємо над створенням мобільних додатків. Користувачі стають все більш вибагливими, темпи розробки зростають, і дизайн не стоїть на місці. Ми розкажемо, що насьогодні вважається якісним дизайном, які дизайн-практики використовуються для забезпечення якості дизайну, як передати наробки дизайнерів команді розробників. Окрім цього розкажемо, де шукати натхнення і заряджати ним колег.
В рамках доповіді ми розповімо про дизайн мислення, креативні воркшопи, юзабіліті тестування, дизайн-систему і базовану на ній SDK, як подружити дизайн та аджайл.
http://uamobile.org/uk/topics/aktualni-praktyky-dyzaynu-mobilnyh-dodatkiv
До чого прикладати Docker в Android? - UA Mobile 2019UA Mobile
Docker - популярне слово в світі backend-у, а чим він може стати в пригоді в Android розробці? Виявляється може. Коли проект тривалий і досить серйозний, то справа доходить до написання тестів на декількох рівнях(unit, integration, UI automation), а це в свою чергу вимагає налаштування pipeline-у на CI, який би правильно проганяв ці тести на кожен коміт. Наступні питання виникають: як зробити щоб різні види тестів ранились паралельно, як ранити паралельно на кількох девайсах, на кількох типах backend-у, і при цьому щоб одні тести не "заважали іншим". Тоді на допомогу і приходить Docker - пісочниця яка дозволяє ізолювати середовище і думати про масштабування. В багатьох випадках можуть допомогти devops піхотинці, але не завжди вони виділені на проект чи можуть зрозуміти що ви від них хочете.
http://uamobile.org/uk/topics/do-chogo-prykladaty-docker-v-android
Building your Flutter apps using Redux - UA Mobile 2019UA Mobile
Обрати архітектуру для розробки не просто. Серед безлічі можливих архітектурних рішень для Flutter у фаворити вибились BLoC і Redux. BLoC ― нове рішення від компанії Google, яке лише починає набувати популярності. Redux ― незмінний улюбленець ком'юніті. І, звісно, мій. Саме про нього і поговоримо.
Під час доповіді ми візьмемо готовий UI шар і реалізуємо всі необхідні Redux компоненти: Store, State і Reducer Actions. А також специфічні для Flutter елементи ― StoreProvider і StoreConnector.
http://uamobile.org/uk/topics/building-your-flutter-apps-using-redux
Optional. Tips and Tricks - UA Mobile 2019UA Mobile
Optional є одним з фундаментальних типів у Swift. На жаль, незважаючи на його поширеність, чимало розробників не звертають уваги на можливості, приховані у цьому типі, або використовують його недоречно. Все це призводить до порушень основних принципів програмування, а також нехтує деякими потужними можливостями, доступними у Swift. Крім того, цей тип дозволяє розглянути важливі концепти, які зроблять рутинну роботу з Optional і схожими типами, ефективнішою та зручнішою.
Під час доповіді ми відповімо на питання чому та як слід оминати optional binding. Розглянемо приклад з код-рев'ю і зробимо рефакторинг у фунціональному стилі щоб побачити недоліки та переваги такого підходу у Swift. Це надасть нам змогу дослідити як Optional впливає на DI та обробку помилок і які є альтернативи до стандартних технік, доступних у Swift.
http://uamobile.org/uk/topics/optional-tips-and-tricks
Designing iOS+Android project without using multiplatform frameworks - UA Mob...UA Mobile
Using React Native, Flutter, Hybrid Web, Unity, Kotlin Multiplatform could be an interesting strategy, but what if we want to stay within traditional native development on both platforms?
A syntax of Swift and Kotlin looks pretty similar, especially if you are cooking it with RX. So, what if we will implement a new feature on one platform and then, kinda, copy-paste the code to another one, with minimum modification? How good it will work for us? How should we deal with platform-specific features? Will this strategy make a project too complex?
This speech will show the way, how to design your project in order to minimize the headache of implementing the same feature for both mobile platforms. Also, we will talk about gains and losses during implementation on a real project with this design idea.
http://uamobile.org/uk/topics/designing-iosandroid-project-without-using-multiplatform-frameworks
Бібліотеки та Інструменти на сторожі коду - UA Mobile 2019UA Mobile
В наш час мало просто писати код, його треба писати красиво і "правильно". Так як ці поняття вельми різняться від людини до людини, то в якийсь момент команди приходять до того, щоб формалізувати красивість і правильність. Деякі команди, втомившись лаятись в pull-request'ах через некрасиво оформлений код, йдуть далі та налаштовують автоматичні перевірки. Хтось навіть довіряє інстументам настільки, що дозволяє змінювати і виправляти код.
У цій доповіді я розповім про бібліотеки та інструменти, метою яких є робота з кодом. Розглянемо освновні відмінності бібліотек та області їх застосування. Після доповіді ви нарешті будете відрізняти SourceKit від SourceKitten, libSwiftSyntax від Swift Syntax.
http://uamobile.org/uk/topics/b%D1%96bl%D1%96oteki-ta-%D1%96nstrumenti-na-storozh%D1%96-kodu
Flutter: No more boring apps! - UA Mobile 2019UA Mobile
Одвічний вибір: швидко, дешево або красиво. До недавнього часу при розробці мобільних додатків можна було отримати два з трьох. Найчастіше в жертву приносили UX/UI, причому ситуація була особливо плачевною в категорії додатків для бізнесу. Користувачам пропонували щось, що в кращому випадку не порушувало HIG платформи, а часто так взагалі було калькою web версії. Але ситуація змінюється з приходом Flutter!
У цій доповіді ми поговоримо про те, як писати надійні, красиві додатки, на ультра швидкості та без особливих витрат.
http://uamobile.org/uk/topics/flutter-no-more-boring-apps
Долаючи прірву між дизайнерами та розробниками - UA Mobile 2019UA Mobile
Хороший дизайнер на вагу золота. Він підготує екрани, визначиться з кольорами та шрифтами, пропрацює додаток так, щоб він відповідав усім вимогам цільової платформи. Але буває, що клієнтські правки в готовий дизайн (або навіть готовий додаток) створюють дивовижні можливості для вправ з рефакторінгу для розробників, наприклад:
- зміни шрифт у всьому додатку на мій улюблений
- а можна список показати у вигляді сітки?
- хочу щоб AppBar скролився разом з контентом.
- ця картинка повинна вилітати за межі екрану, змінюючи колір, прокручуючись навколо своєї осі, повільно розчиняючись "у тумані".
- і т.д.
Якщо вас дратують подібні ситуації, то швидше за все ваш інструмент недостатньо хороший. ;)
У цій доповіді ми візьмемо кілька екранів з Mobile UI Inspiration розсилок з найсміливішими дизайнерськими фантазіями і реалізуємо їх на Flutter. Обережно, буде багато коду!
Multiplatform shared codebase with Kotlin/Native - UA Mobile 2019UA Mobile
If you want to share the code between Android and iOS but you don't feel like doing C++/JNI, React Native, Flutter, you must try Kotlin/Native! In this presentation we will see how Kotlin/Native is different and in some aspects superior, and how easy it becomes to develop, debug and maintain a common codebase with JetBrains tools and without sacrificing runtime performance.
Sceneform SDK на практиці - UA Mobile 2019UA Mobile
Тема нативних движків, що спрощують роботу з 3D графікою для Android, є головним болем багатьох розробників. У той час як для iOS існує SceneKit, розробники під Android були змушені або йти в крос-платформені рішення (Unity3d, LibGDX і т.п.) або використовувати самописні/опенсорсні рішення з обмеженим функціоналом. Поява Sceneform SDK вирішує не тільки цю проблему але й інкапсулює в собі роботу з ArCore SDK, відкриваючи для розробників можливість нативної реалізації AR рішень, не вдаючись до стороннього SDK.
В рамках доповіді будуть розглянуті практичні можливості та обмеження Sceneform SDK стосовно проектів з доповненою реальністю (AR). Так само будуть розглянуті такі теми як SLAM, ArCore SDK, розпізнавання та трекінг маркерів на основі зображень, Cloud Anchors та існуючі альтернативи на ринку.
3. HOW MANY ARCHITECTURES DO YOU KNOW?
● MVC
● HMVC (Hierarchical model–view–controller)
● MVA (MODEL–VIEW–ADAPTER)
● MVP
● MVVM
● MVI
4.
5.
6.
7.
8.
9. They all give us the ability to decouple
development process into smaller pieces
which can be distributed between team
members
10. They all lack integration with Android lifecycle system
11. How it works ?
● Lifecycle components
● LiveData<T>
● ViewModel
12. How it works ?
Lifecycle components
interface LifeCycle (Observer pattern)
+ addObserver()
+ removeObserver()
+ getCurrentState()
interface LifecycleObserver
interface LifecycleOwner
+ getLifecycle()
class LifecycleRegistry : LifeCycle
+ Does all the magic required to handle this
14. How it works ?
val lifecycleOwner = object : LifecycleOwner {
val lifecycleRegistry = LifecycleRegistry(this)
override fun getLifecycle() = lifecycleRegistry
}
15. How it works ?
val lifecycleOwner = object : LifecycleOwner {
val lifecycleRegistry = LifecycleRegistry(this)
override fun getLifecycle() = lifecycleRegistry
}
lifecycleOwner.lifecycle.addObserver(
object : LifecycleObserver {
@OnLifecycleEvent(Event.ON_ANY)
fun onAny(source: LifecycleOwner, event: Event) {
// Handle incoming events
}
}
)
16. How it works ?
val lifecycleOwner = object : LifecycleOwner {
val lifecycleRegistry = LifecycleRegistry(this)
override fun getLifecycle() = lifecycleRegistry
}
lifecycleOwner.lifecycle.addObserver(
object : LifecycleObserver {
@OnLifecycleEvent(Event.ON_ANY)
fun onAny(source: LifecycleOwner, event: Event) {
// Handle incoming events
}
}
)
lifecycleOwner.lifecycleRegistry.handleLifecycleEvent(Event.ON_RESUME)
17. How it works ?
val lifecycleOwner = object : LifecycleOwner {
val lifecycleRegistry = LifecycleRegistry(this)
override fun getLifecycle() = lifecycleRegistry
}
lifecycleOwner.lifecycle.addObserver(
object : LifecycleObserver {
@OnLifecycleEvent(Event.ON_ANY)
fun onAny(source: LifecycleOwner, event: Event) {
// Handle incoming events
}
}
)
lifecycleOwner.lifecycleRegistry.handleLifecycleEvent(Event.ON_RESUME)
18. How it works ?
LiveData<T>
class LiveData<T> (Observer pattern) on steroids (Lifecycle aware)
● Handles Observer state for us (via listening to LifecycleOwner)
liveData.observe(LifecycleOwner(), Observer {})
- Ensures Observer is not called when related LifecycleOwner is at least in
STARTED state
- Remove Observer if when related LifecycleOwner reaches DESTROYED
state
- Ensures that Observer receives last value when it is active again
(LifecycleOwner is back in STARTED state)
19. How it works ?
LiveData<T>
class LiveData<T> (Observer pattern) on steroids (Lifecycle aware)
● Handles threading for us
20. How it works ?
ViewModel
public abstract class ViewModel {
protected void onCleared() {}
}
That’s all :)
22. Single emitted events through LiveData
- Show one time message (toast, snackbar,
dialog)
- Send one time actions to the view (close
activity, navigation events for fragments)
- Open other activities (by intent)
- Any type of activity that should be triggered
once and not re-triggered after rotation
23. Show me the code
data class Event<out T>(val content: T) {
private var consumed = false
fun consume(consumer: (T) -> Unit) {
if (not(consumed)) {
consumer(content)
}
consumed = true
}
fun not(condition: Boolean) = !condition
}
24. Show me the code TODO: Remove
data class Event<out T>(val content: T) {
private var consumed = false
fun consume(consumer: (T) -> Unit) {
if (not(consumed)) {
consumer(content)
}
consumed = true
}
fun not(condition: Boolean) = !condition
}
25. Show me the code TODO: Remove
data class Event<out T>(val content: T) {
private var consumed = false
fun consume(consumer: (T) -> Unit) {
if (not(consumed)) {
consumer(content)
}
consumed = true
}
fun not(condition: Boolean) = !condition
}
26. Show me the code TODO: Remove
data class Event<out T>(val content: T) {
private var consumed = false
fun consume(consumer: (T) -> Unit) {
if (not(consumed)) {
consumer(content)
}
consumed = true
}
fun not(condition: Boolean) = !condition
}
27. Usage (from ViewModel)
class MainViewModelExample : ViewModel() {
val events = MutableLiveData<Event<ViewModelEvent>>()
fun sendEvent() {
events.value = Event(ViewModelEvent.ShowToast("Hello"))
}
open class ViewModelEvent {
data class ShowToast(val message: String) : ViewModelEvent()
}
}
28. Usage (from ViewModel)
class MainViewModelExample : ViewModel() {
val events = MutableLiveData<Event<ViewModelEvent>>()
fun sendEvent() {
events.value = Event(ViewModelEvent.ShowToast("Hello"))
}
open class ViewModelEvent {
data class ShowToast(val message: String) : ViewModelEvent()
}
}
29. Usage (from ViewModel)
class MainViewModelExample : ViewModel() {
val events = MutableLiveData<Event<ViewModelEvent>>()
fun sendEvent() {
events.value = Event(ViewModelEvent.ShowToast("Hello"))
}
open class ViewModelEvent {
data class ShowToast(val message: String) : ViewModelEvent()
}
}
30. Usage (from ViewModel)
class MainViewModelExample : ViewModel() {
val events = MutableLiveData<Event<ViewModelEvent>>()
fun sendEvent() {
events.value = Event(ViewModelEvent.ShowToast("Hello"))
}
open class ViewModelEvent {
data class ShowToast(val message: String) : ViewModelEvent()
}
}
31. Usage (from View)
override fun onCreate(savedInstanceState: Bundle?) {
super.onCreate(savedInstanceState)
setContentView(R.layout.activity_main)
val model = ViewModelProviders.of(this)
.get(MainViewModelExample::class.java)
observeEvents(model.events) {
when (it) {
is ViewModelEvent.ShowToast -> showToast(it.message)
}
}
32. Sharing data between fragments (or views)
Imagine we have to fragments that need to
communicate somehow?
33. Sharing data between fragments (or views)
class SpeakersFragment : Fragment() {
override fun onActivityCreated(savedInstanceState: Bundle?) {
super.onActivityCreated(savedInstanceState)
val model = ViewModelProviders.of(requireActivity())
.get(SharedViewModel::class.java)
// For example, on button click
model.onSpeakerSelected(speaker)
}
}
34. Sharing data between fragments (or views)
class SpeakerDetailsFragment : Fragment() {
override fun onActivityCreated(savedInstanceState: Bundle?) {
super.onActivityCreated(savedInstanceState)
// Get the same instance of ViewModel as in SpeakersFragment
val model = ViewModelProviders.of(requireActivity())
.get(SharedViewModel::class.java)
observe(model.selectedSpeaker) {
// Render speaker details on screen
}
}
}
35. Sharing data between fragments (or views)
class SharedViewModel : ViewModel() {
val selectedSpeaker = MutableLiveData<Speaker>()
fun onSpeakerSelected(speaker: Speaker) {
selectedSpeaker.value = speaker
}
}
36. Be careful with fragments (as usual)
class AnotherUserFragment : Fragment() {
override fun onCreate(savedInstanceState: Bundle?) {
super.onCreate(savedInstanceState)
val model = ..
model.users.observe(this, Observer {
// Handle users
// This can be triggered multiple times during the switch of
fragments in activity
})
}
}
37. Be careful with fragments (as usual)
class AnotherUserFragment : Fragment() {
override fun onCreate(savedInstanceState: Bundle?) {
super.onCreate(savedInstanceState)
val model = ..
model.users.observe(viewLifecycleOwner, Observer {
// Handle users
})
}
}
38. Using ViewModels in Views
class SpeakerFragment : Fragment() {
@Inject
lateinit var viewModelFactory: ViewModelProvider.Factory
override fun onActivityCreated(savedInstanceState: Bundle?) {
super.onActivityCreated(savedInstanceState)
val model = viewModel<SpeakerViewModel>(viewModelFactory) {
observe(speakers, ::handlerSpeakers)
observeEvents(events, ::handleEvent)
}
}
}
- Android-CleanArchitecture-Kotlin with Dagger way
39. Using ViewModels in Views
class SpeakerFragment : Fragment() {
private val model: SpeakerViewModel by sharedViewModel()
override fun onActivityCreated(savedInstanceState: Bundle?) {
super.onActivityCreated(savedInstanceState)
observe(model.speakers, ::handlerSpeakers)
observeEvents(model.events, ::handleEvent)
}
}
- With Koin DI framework
40. Rx Support in ViewModels
class SpeakerViewModel(private val useCase: FetchSpeakerUseCase)
:ViewModel() {
private val compositeDisposable = CompositeDisposable()
fun loadSpeaker() {
compositeDisposable.add(
useCase.call("speaker_id").subscribe {
// Handle result
}
)
}
override fun onCleared() {
compositeDisposable.clear()
}
}
Problem
41. Rx Support in ViewModels
abstract class BaseViewModel : ViewModel() {
private val compositeDisposable = CompositeDisposable()
fun addDisposable(block: () -> Disposable) {
compositeDisposable.add(block())
}
public override fun onCleared() {
compositeDisposable.clear()
}
}
How we can fix this?
42. Rx Support in ViewModels
class SpeakerViewModel(private val useCase: FetchSpeakerUseCase) :
BaseViewModel() {
fun loadSpeaker() {
addDisposable {
useCase.call("speaker_id").subscribe {
// Handle result
}
}
}
}
51. class SharedViewModelTest {
@get:Rule val rule = InstantTaskExecutorRule()
val viewModel = SharedViewModel()
@Test fun `test view model send correct speaker`() {
}
}
Testing ViewModels
Sample test
52. Testing ViewModels
Sample test
class SharedViewModelTest {
@get:Rule val rule = InstantTaskExecutorRule()
val viewModel = SharedViewModel()
@Test fun `test view model send correct data`() {
val speaker = Speaker("Andriy")
val speakerObserver = viewModel.selectedSpeaker.testObserver()
}
}
53. Testing ViewModels
Sample test
class SharedViewModelTest {
@get:Rule val rule = InstantTaskExecutorRule()
val viewModel = SharedViewModel()
@Test fun `test view model send correct data`() {
val speaker = Speaker("Andriy")
val speakerObserver = viewModel.selectedSpeaker.testObserver()
viewModel.onSpeakerSelected(speaker)
}
}
54. Testing ViewModels
Sample test
class SharedViewModelTest {
@get:Rule val rule = InstantTaskExecutorRule()
val viewModel = SharedViewModel()
@Test fun `test view model send correct data`() {
val speaker = Speaker("Andriy")
val speakerObserver = viewModel.selectedSpeaker.testObserver()
viewModel.onSpeakerSelected(speaker)
speakerObserver.observedValues.shouldContainSame(speaker)
}
}
55. Testing ViewModels
Sample test
class SharedViewModelTest {
@get:Rule val rule = InstantTaskExecutorRule()
val viewModel = SharedViewModel()
@Test fun `test view model send correct data`() {
val speaker = Speaker("Andriy")
val speakerEventsObserver = viewModel.speakerEvents.testObserver()
viewModel.onSpeakerSelected(speaker)
speakerEventsObserver.observedValues.shouldContainSame(
Event(ViewModelEvent.OpenSpeakerUrl("https://andriy))
)
}
}
56. Testing ViewModels
Let’s add Kotlin magic
class TestObserver<T> : Observer<T> {
val observedValues = mutableListOf<T>()
fun <Event> shouldContainEvents(vararg events: Event) {
val wrapped = events.map { Event(it) }
observedValues.shouldContainSame(wrapped)
}
}
57. Testing ViewModels
Let’s add Kotlin magic
class TestObserver<T> : Observer<T> {
val observedValues = mutableListOf<T>()
fun <Event> shouldContainEvents(vararg events: Event) {
val wrapped = events.map { Event(it) }
observedValues.shouldContainSame(wrapped)
}
fun <T> shouldContainValues(vararg values: T) {
observedValues.shouldContainSame(values.asList())
}
}
58. Testing ViewModels
Sample test
class SharedViewModelTest {
@get:Rule val rule = InstantTaskExecutorRule()
val viewModel = SharedViewModel()
@Test fun `test view model send correct data`() {
val speaker = Speaker("Andriy")
val speakerEventsObserver = viewModel.speakerEvents.testObserver()
viewModel.onSpeakerSelected(speaker)
speakerEventsObserver.shouldContainEvents(
ViewModelEvent.OpenSpeakerUrl("https://andriy")
)
}
}
59. Testing ViewModels
Sample test
class SharedViewModelTest {
@get:Rule val rule = InstantTaskExecutorRule()
val useCase = mockk<FetchSpeakerUseCase>()
val viewModel = SharedViewModel(useCase)
@Test fun `test view model send correct data`() {
val speakerName = "Andriy"
val speakerObserver = viewModel.speaker.testObserver()
every { useCase.call(speakerName) }
.returns(Speaker("Andriy"))
viewModel.onSpeakerSelected(speakerName)
speakerObserver.shouldContainValues(Speaker("Andriy"))
}
}