The document discusses Android architecture and architecture components. It recommends separating an app into modular components with clear responsibilities, such as activities, fragments, services, content providers and broadcast receivers. It also recommends the ViewModel component to survive configuration changes, LiveData for observable data, Room for local database access, repositories as a single source of truth, and testing each component individually. The Architecture Components provide common building blocks for app architecture including activities, fragments, ViewModel, LiveData and Room. The recommended architecture is a starting point but each app may have different needs.
Cauê Ferreira, Android Developer do Moip Pagamentos, sala sobre Android Clean Architecture no Android DevConference 2016.
Saiba mais em http://androidconference2016.imasters.com.br/
Robert Knight, Software Engineer at Mendeley
Rob will explore how to take advantage of React's use of JavaScript/JSX and the virtual UI to catch regressions earlier and make writing and debugging tests for React components easier and faster.
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
JS Conf 2018 AU Node.js applications diagnostics under the hoodNikolay Matvienko
Based on my experience in diagnosing and troubleshooting high load e-commerce Node.js app in production, I’ve identified three stages in the Node.js diagnostic history. I’d like to briefly tell this path and show where we are now and tell in details "How to debug and tracing Node.js apps on different levels, and how to track performance problems and memory leaks inside Node.js apps in 2018":
Production troubleshooting: I show and explain the strategy of creation and debugging core dump using llnode, node-report and X-Transaction-ID in our company with real-life examples.
Memory leaks: I show how to identify memory leaks, memory holders using V8 GC tracing, llnode debugging + gencore tool with real-life examples.
Performance: I show how to use 0x flame graph to find performance bottlenecks, how identify Event Loop lags, GC slow work and what can give Async Hooks for that with real-life examples.
Cauê Ferreira, Android Developer do Moip Pagamentos, sala sobre Android Clean Architecture no Android DevConference 2016.
Saiba mais em http://androidconference2016.imasters.com.br/
Robert Knight, Software Engineer at Mendeley
Rob will explore how to take advantage of React's use of JavaScript/JSX and the virtual UI to catch regressions earlier and make writing and debugging tests for React components easier and faster.
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
JS Conf 2018 AU Node.js applications diagnostics under the hoodNikolay Matvienko
Based on my experience in diagnosing and troubleshooting high load e-commerce Node.js app in production, I’ve identified three stages in the Node.js diagnostic history. I’d like to briefly tell this path and show where we are now and tell in details "How to debug and tracing Node.js apps on different levels, and how to track performance problems and memory leaks inside Node.js apps in 2018":
Production troubleshooting: I show and explain the strategy of creation and debugging core dump using llnode, node-report and X-Transaction-ID in our company with real-life examples.
Memory leaks: I show how to identify memory leaks, memory holders using V8 GC tracing, llnode debugging + gencore tool with real-life examples.
Performance: I show how to use 0x flame graph to find performance bottlenecks, how identify Event Loop lags, GC slow work and what can give Async Hooks for that with real-life examples.
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.
Testing Android apps based on Dagger and RxJavaFabio Collini
In this talk, you will learn:
how to take advantage of Mockito and other libraries to write good JVM and Espresso tests
how to use DaggerMock (an open source library available on github https://github.com/fabioCollini/DaggerMock) to avoid boilerplate code in tests
how to test asynchronous RxJava code using a JVM test
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 we’ll see 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.
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.
Though component and custom element patterns have become the standard for web application architecture, communicating from one solution to another remains fogged by guesswork and opinion.
How should you write a web component that needs to be compatible with Ember and other frameworks? Where are the tradeoffs between purity of design and ergonomics? In a talk touching on libraries and standards, come learn how to write component code useful across many environments.
After you’ve done all the UI optimizations recommended by UX designers, how do you make your interface even more engaging? That’s where the Samsung Mobile SDK can help. Part 1 of Advancing Your UI introduces you to three new technologies -- Look, Motion, and Gesture – that allow you to create an interface that engages your audience in ways you have not yet explored.
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.
Slides for our (John Rodriguez and myself) talk at Droidcon SF: http://sf.droidcon.com/schedule
For the past 3 years, Square Register Android has leveraged Dagger † to wire up Java objects. However, the app scope hierarchy and complexity increased and we started having bugs and crashes related to scoping errors. This talk will show how to structure an app around Dagger2 ‡ and present a strategy for incrementally migrating from Dagger1 to Dagger2.
Comment développer une application mobile en 8 semaines - Meetup PAUG 24-01-2023Nicolas HAAN
À l'automne dernier, nous avons eu la chance de développer une nouvelle app pour un de nos clients en partant de zéro.
L'objectif ? Créer une application minimale à mettre entre les mains de dizaines de beta testeurs, en 8 semaines et avec 2 développeurs. Partant d'une feuille blanche, nous avons pu mettre en œuvre les dernières avancées de la stack Android sans être contraints par l'existant.
Développeurs débutants comme expérimentés, vous repartirez de ce talk avec nos apprentissages clés sur l'architecture ainsi que sur les bibliothèques et astuces pour faciliter la maintenance et la stabilité de l'application. En bonus, nous répondrons à la question : "Une app full-compose, est-ce que c'est cool ?"
React Native for multi-platform mobile applicationsMatteo Manchi
Since its 2013 release, React has brought a new way to design UI components in the world wide web. The same foundamentals have been taken to another important environment in our contemporary world: the mobile application.
This month we'll see the philosophy behind React Native - learn once, write anywhere - and how this new framework helps new developers to build native apps using React.
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.
Testing Android apps based on Dagger and RxJavaFabio Collini
In this talk, you will learn:
how to take advantage of Mockito and other libraries to write good JVM and Espresso tests
how to use DaggerMock (an open source library available on github https://github.com/fabioCollini/DaggerMock) to avoid boilerplate code in tests
how to test asynchronous RxJava code using a JVM test
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 we’ll see 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.
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.
Though component and custom element patterns have become the standard for web application architecture, communicating from one solution to another remains fogged by guesswork and opinion.
How should you write a web component that needs to be compatible with Ember and other frameworks? Where are the tradeoffs between purity of design and ergonomics? In a talk touching on libraries and standards, come learn how to write component code useful across many environments.
After you’ve done all the UI optimizations recommended by UX designers, how do you make your interface even more engaging? That’s where the Samsung Mobile SDK can help. Part 1 of Advancing Your UI introduces you to three new technologies -- Look, Motion, and Gesture – that allow you to create an interface that engages your audience in ways you have not yet explored.
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.
Slides for our (John Rodriguez and myself) talk at Droidcon SF: http://sf.droidcon.com/schedule
For the past 3 years, Square Register Android has leveraged Dagger † to wire up Java objects. However, the app scope hierarchy and complexity increased and we started having bugs and crashes related to scoping errors. This talk will show how to structure an app around Dagger2 ‡ and present a strategy for incrementally migrating from Dagger1 to Dagger2.
Comment développer une application mobile en 8 semaines - Meetup PAUG 24-01-2023Nicolas HAAN
À l'automne dernier, nous avons eu la chance de développer une nouvelle app pour un de nos clients en partant de zéro.
L'objectif ? Créer une application minimale à mettre entre les mains de dizaines de beta testeurs, en 8 semaines et avec 2 développeurs. Partant d'une feuille blanche, nous avons pu mettre en œuvre les dernières avancées de la stack Android sans être contraints par l'existant.
Développeurs débutants comme expérimentés, vous repartirez de ce talk avec nos apprentissages clés sur l'architecture ainsi que sur les bibliothèques et astuces pour faciliter la maintenance et la stabilité de l'application. En bonus, nous répondrons à la question : "Une app full-compose, est-ce que c'est cool ?"
React Native for multi-platform mobile applicationsMatteo Manchi
Since its 2013 release, React has brought a new way to design UI components in the world wide web. The same foundamentals have been taken to another important environment in our contemporary world: the mobile application.
This month we'll see the philosophy behind React Native - learn once, write anywhere - and how this new framework helps new developers to build native apps using React.
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.
Through this presentation you will gain a good understanding of how the clean architecture pattern is implemented at Taxibeat. What issues the Android Taxibeat team has faced so far and what solutions we came up with. Of course, the benefits of clean architecture will also be discussed along with the way we managed to build two fast paced iterative apps that share functionality.
Home Improvement: Architecture & KotlinJorge Ortiz
Two of the most relevant news from the recent Google IO were the Guide to App Architecture and the adoption of Kotlin as a first-class language. Both have a very positive impact in our applications.
In my talk I introduced and advanced architecture inspired in the Clean Architecture of Uncle Bob and I showed the impact of these two elements.
First I mentioned the components provided for integration with the lifecycle and how that saves a lot of effort to preserve view models or presenters. I briefly covered the methods that we had available until know focusing on the use of a fragment with no view that had the retained instance property set to true.
Then I covered some real scenarios explaining the improvements that Kotlin provide us with. Some examples:
- Conciseness of data classes (and limitations)
- Property observation
- Use of extensions in presentation logic
- Sealed classes for results (as an either-like type)
This is a "Code or it didn't happen" (TM) talk. ;-)
The world of open source libraries and tools is vast for Android developers. Writing apps using solely Android SDK is impractical. Libraries can help you in many ways. They can speed up your development, save you creating boilerplate code and dealing with platform fragmentation, simplify your code and make it more readable and maintainable. In the talk I’m showing how several truly useful libraries can help a developer.
Presented at MobCon Europe 2017.
CQRS and Event Sourcing are popular architectural patterns that allow you to build effective event-driven micro-services.
The basic idea of these patterns is to record each event that changes the state of the domain model into the event-storage.
This approach allows you to reduce service latency for any data scale, as well as be able to restore the system without losing any data.
Similar to Architecture components, Константин Марс, TeamLead, Senior Developer, DataArt (20)
Designer in you, Irina Shapoval, Lead Designer, DataArtAlina Vilk
Ирина Шаповал (Design Lead, DataArt) делилась опытом с начинающими коллегами как понять и разобраться, что дизайн – это ваше, объяснила разницу между UI,UX, графическим дизайном. Говорила про практикантские позиции в DataArt и требования к ним.
.NET framework vs .net core 3.1 commons & differencesAlina Vilk
Рассказывал о “.NET Framework vs .NET Core 3.1: commons & differences”. Докладчик вместе с участниками разобрали полезные фичи .NET Core 3.1 по сравнению с предыдущими версиями платформы; Сравнили проекты на .NET Framework и .NET Core; Обсудили вопросы миграции существующих проектов с .NET Framework на .NET Сore 3.1.;Рассмотрели особенности сборки и автоматизированного тестирования приложений на .NET Core 3.1.;также уделили внимание особенностям развертывания веб-приложений на ASP.NET Core под Linux и в Docker.
Expression trees in c#, Алексей Голубь (Svitla Systems)Alina Vilk
рассказывал про это понятие и способы генерации деревьев выражений, о превращении пользовательской грамматики непосредственно в исполняемый код; поделился информацией о написании быстрых универсальных операторов и компиляции сборок во время выполнения
обсуждали истинные причины перехода разработчиков в менеджмент, плюсы и минусы такого решения, что ждать и к чему быть готовым после такого шага. Дмитрий Федотов (PM, DataArt) поделился несколькими реальными кейсами из своей практики.
Игорь Литвиненко (Senior iOS- и Android-разработчик,DataArt)Alina Vilk
говорил про IOS, поделился, как работает АР, что нового привнесла Apple, разобрал алгоритм перехода от локации пользователя к виртуальным координатам, и как его добавить в приложение дополненной реальности.
Алексей Рыбаков (Senior Engineer,Technical Evangelist DataArt ) Alina Vilk
Алексей Рыбаков (Senior Engineer,Technical Evangelist DataArt ) рассказывал о современном состоянии VR/AR-индустрии, о принципах и особенностях мобильного VR. Участники встречи коснулись средств разработки и запустили парочку примеров на Google DayDream. Во второй части доклада обсудили Samsung Gear VR, Google Cardboard и Google Daydream, в чем их сходства и различия с точки зрения программиста. Рассмотрели SDK/Tool, которые можно с ними использовать.
Встреча Google Post IO ( Владимир Иванов, Катерина Заворотченко и Сергей Комлач)Alina Vilk
Украина на Google I/O.
эмоции и впечатления с крупнейшего ежегодного события для всех Google Developerов, презентации с подробностями и фотоотчетами, и девайсы (новый Chromebook, колонку Google Home и Google Pixel).
поделился опытом дизайн-исследований в корпоративной среде. Рассказал о категориях, методах исследований и вопросах, которые решаюся благодаря дизайн-исследованиям. В конце доклада затронул тему кросскультурного исследования. На последок предоставил список книг, где можно найти ответ на вопросы касающиеся исследований.
Normal Labour/ Stages of Labour/ Mechanism of LabourWasim Ak
Normal labor is also termed spontaneous labor, defined as the natural physiological process through which the fetus, placenta, and membranes are expelled from the uterus through the birth canal at term (37 to 42 weeks
June 3, 2024 Anti-Semitism Letter Sent to MIT President Kornbluth and MIT Cor...Levi Shapiro
Letter from the Congress of the United States regarding Anti-Semitism sent June 3rd to MIT President Sally Kornbluth, MIT Corp Chair, Mark Gorenberg
Dear Dr. Kornbluth and Mr. Gorenberg,
The US House of Representatives is deeply concerned by ongoing and pervasive acts of antisemitic
harassment and intimidation at the Massachusetts Institute of Technology (MIT). Failing to act decisively to ensure a safe learning environment for all students would be a grave dereliction of your responsibilities as President of MIT and Chair of the MIT Corporation.
This Congress will not stand idly by and allow an environment hostile to Jewish students to persist. The House believes that your institution is in violation of Title VI of the Civil Rights Act, and the inability or
unwillingness to rectify this violation through action requires accountability.
Postsecondary education is a unique opportunity for students to learn and have their ideas and beliefs challenged. However, universities receiving hundreds of millions of federal funds annually have denied
students that opportunity and have been hijacked to become venues for the promotion of terrorism, antisemitic harassment and intimidation, unlawful encampments, and in some cases, assaults and riots.
The House of Representatives will not countenance the use of federal funds to indoctrinate students into hateful, antisemitic, anti-American supporters of terrorism. Investigations into campus antisemitism by the Committee on Education and the Workforce and the Committee on Ways and Means have been expanded into a Congress-wide probe across all relevant jurisdictions to address this national crisis. The undersigned Committees will conduct oversight into the use of federal funds at MIT and its learning environment under authorities granted to each Committee.
• The Committee on Education and the Workforce has been investigating your institution since December 7, 2023. The Committee has broad jurisdiction over postsecondary education, including its compliance with Title VI of the Civil Rights Act, campus safety concerns over disruptions to the learning environment, and the awarding of federal student aid under the Higher Education Act.
• The Committee on Oversight and Accountability is investigating the sources of funding and other support flowing to groups espousing pro-Hamas propaganda and engaged in antisemitic harassment and intimidation of students. The Committee on Oversight and Accountability is the principal oversight committee of the US House of Representatives and has broad authority to investigate “any matter” at “any time” under House Rule X.
• The Committee on Ways and Means has been investigating several universities since November 15, 2023, when the Committee held a hearing entitled From Ivory Towers to Dark Corners: Investigating the Nexus Between Antisemitism, Tax-Exempt Universities, and Terror Financing. The Committee followed the hearing with letters to those institutions on January 10, 202
Synthetic Fiber Construction in lab .pptxPavel ( NSTU)
Synthetic fiber production is a fascinating and complex field that blends chemistry, engineering, and environmental science. By understanding these aspects, students can gain a comprehensive view of synthetic fiber production, its impact on society and the environment, and the potential for future innovations. Synthetic fibers play a crucial role in modern society, impacting various aspects of daily life, industry, and the environment. ynthetic fibers are integral to modern life, offering a range of benefits from cost-effectiveness and versatility to innovative applications and performance characteristics. While they pose environmental challenges, ongoing research and development aim to create more sustainable and eco-friendly alternatives. Understanding the importance of synthetic fibers helps in appreciating their role in the economy, industry, and daily life, while also emphasizing the need for sustainable practices and innovation.
A Strategic Approach: GenAI in EducationPeter Windle
Artificial Intelligence (AI) technologies such as Generative AI, Image Generators and Large Language Models have had a dramatic impact on teaching, learning and assessment over the past 18 months. The most immediate threat AI posed was to Academic Integrity with Higher Education Institutes (HEIs) focusing their efforts on combating the use of GenAI in assessment. Guidelines were developed for staff and students, policies put in place too. Innovative educators have forged paths in the use of Generative AI for teaching, learning and assessments leading to pockets of transformation springing up across HEIs, often with little or no top-down guidance, support or direction.
This Gasta posits a strategic approach to integrating AI into HEIs to prepare staff, students and the curriculum for an evolving world and workplace. We will highlight the advantages of working with these technologies beyond the realm of teaching, learning and assessment by considering prompt engineering skills, industry impact, curriculum changes, and the need for staff upskilling. In contrast, not engaging strategically with Generative AI poses risks, including falling behind peers, missed opportunities and failing to ensure our graduates remain employable. The rapid evolution of AI technologies necessitates a proactive and strategic approach if we are to remain relevant.
The French Revolution, which began in 1789, was a period of radical social and political upheaval in France. It marked the decline of absolute monarchies, the rise of secular and democratic republics, and the eventual rise of Napoleon Bonaparte. This revolutionary period is crucial in understanding the transition from feudalism to modernity in Europe.
For more information, visit-www.vavaclasses.com
Francesca Gottschalk - How can education support child empowerment.pptxEduSkills OECD
Francesca Gottschalk from the OECD’s Centre for Educational Research and Innovation presents at the Ask an Expert Webinar: How can education support child empowerment?
Read| The latest issue of The Challenger is here! We are thrilled to announce that our school paper has qualified for the NATIONAL SCHOOLS PRESS CONFERENCE (NSPC) 2024. Thank you for your unwavering support and trust. Dive into the stories that made us stand out!
Acetabularia Information For Class 9 .docxvaibhavrinwa19
Acetabularia acetabulum is a single-celled green alga that in its vegetative state is morphologically differentiated into a basal rhizoid and an axially elongated stalk, which bears whorls of branching hairs. The single diploid nucleus resides in the rhizoid.
Embracing GenAI - A Strategic ImperativePeter Windle
Artificial Intelligence (AI) technologies such as Generative AI, Image Generators and Large Language Models have had a dramatic impact on teaching, learning and assessment over the past 18 months. The most immediate threat AI posed was to Academic Integrity with Higher Education Institutes (HEIs) focusing their efforts on combating the use of GenAI in assessment. Guidelines were developed for staff and students, policies put in place too. Innovative educators have forged paths in the use of Generative AI for teaching, learning and assessments leading to pockets of transformation springing up across HEIs, often with little or no top-down guidance, support or direction.
This Gasta posits a strategic approach to integrating AI into HEIs to prepare staff, students and the curriculum for an evolving world and workplace. We will highlight the advantages of working with these technologies beyond the realm of teaching, learning and assessment by considering prompt engineering skills, industry impact, curriculum changes, and the need for staff upskilling. In contrast, not engaging strategically with Generative AI poses risks, including falling behind peers, missed opportunities and failing to ensure our graduates remain employable. The rapid evolution of AI technologies necessitates a proactive and strategic approach if we are to remain relevant.
3. #gdg_kharkiv_center
But… There are Everyday Problems to Solve
App-hopping
OS may kill app at random time
App components lifecycle is not under control
Components should not depend on each other
Can’t rely on data, stored in components
5. #gdg_kharkiv_center
Common Principles for staying in the mind :)
-Separation of concerns
-Provide solid user experience
-Keep UI lean and simple
-Keep UI free of app logic
-Drive UI from model
-Use persistent model
-Assign clear responsibilities for each model class
12. #gdg_kharkiv_center
Be together. not the same
“It is impossible to have one way of writing apps that will be the best for every
scenario. That being said, this recommended architecture should be a good
starting point for most use cases. If you already have a good way of writing
Android apps, you don't need to change.”
Quote from Guide to App Architecture
14. #gdg_kharkiv_center
Views = UI Controllers = LifecycleOwners
Purpose: Display data and pass on UI events
Neither contain the UI data, nor directly manipulate
data
Examples: Activity, Fragment
23. #gdg_kharkiv_center
public class DetailActivityViewModel extends ViewModel {
private MutableLiveData<WeatherEntry> mWeather;
public DetailActivityViewModel() {}
public MutableLiveData<WeatherEntry> getWeather() {
return mWeather;
}
public void setWeather(WeatherEntry weatherEntry) {
mWeather.postValue(weatherEntry);
}
}
Live Data
LiveData
24. #gdg_kharkiv_center
public class DetailActivity extends LifecycleActivity {
DetailActivityViewModel viewModel;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
...
viewModel = ViewModelProviders.of(this).get(DetailActivityViewModel.class);
viewModel.getWeather().observe(this, weatherEntry -> {
if(weatherEntry!=null) { bindWeatherToUI(weatherEntry); }
});
}
Live Data observing
Observe
35. #gdg_kharkiv_center
//Room constructor
public WeatherEntry(int id, int weatherIconId, Date date, ...) {
//Json constructor - ignored by Room
@Ignore
public WeatherEntry(int weatherIconId, Date date,
// (!) Only one constructor should be exposed to Room
...
@Entity constructors
56. #gdg_kharkiv_center
September - October updates
October 5, 2017 - Beta 2
- improved LiveDataReactiveStreams,
- FullLifecycleObserver for Java 8,
- Handling @Query methods with @NonNull annotations,
- Still requires proguard settings to keep android.arch.lifecycle.GeneratedAdapter
1.0.0 Alpha 9-1
- Support Library 26.1.0, AppCompatActivity and Support Fragment now implement the
LifecycleOwner interface
- LifecycleActivity & LifecycleFragment are now deprecated
- New Library: Paging
58. #gdg_kharkiv_center
Paging Library - Annotations on DAO
@Query("select * from users WHERE age > :age order by name DESC, id ASC")
TiledDataSource<User> usersOlderThan(int age);
@Query("SELECT * from users order WHERE age > :age order by name DESC, id ASC")
public abstract LivePagedListProvider<Integer, User> usersOlderThan(int age);
63. #gdg_kharkiv_center
What to read :)
Guide to App Architecture https://developer.android.com/topic/libraries/architecture/guide.html
Architecture Components
https://developer.android.com/topic/libraries/architecture/index.html
I/O ‘17 Architecture Components Introduction - https://youtu.be/FrteWKKVyzI
Solving the Lifecycle Problem - https://youtu.be/bEKNi1JOrNs
Persistence and Offline - https://youtu.be/MfHsPGQ6bgE
Architecture Components on GDD Europe - https://youtu.be/Ts-uxYiBEQ8
GDD Europe CodeLabs g.co/codelabs/gdd17
Google Github samples https://github.com/googlesamples/android-architecture-components
64. #gdg_kharkiv_center
Alternatives to consider
Moxy https://github.com/Arello-Mobile/Moxy
Mosby https://github.com/sockeqwe/mosby
Android MVP Helper https://github.com/Ufkoku/AndroidMVPHelper
Clean Architecture https://github.com/android10/Android-CleanArchitecture
Reark https://github.com/reark/reark
MVP + Dagger2 + Rx https://android.jlelse.eu/mvp-dagger-2-rx-clean-modern-android-app-
code-74f63c9a6f2f
Architecture the Lost Years by Uncle Bob https://youtu.be/WpkDN78P884