This document discusses various techniques for optimizing RecyclerView performance in Android applications. It begins by describing common ways to measure UI performance such as frames per second (FPS), GPU rendering profiling, and aggregating frame stats. The document then provides tips for optimizing RecyclerView cells hierarchies, minimizing work done in onBindViewHolder(), correctly scaling images, handling nested RecyclerViews, only updating affected items, using item caches, stable IDs, prefetching, and DiffUtil.
Template forms allow creating forms directly in the template using directives like ngModel. Reactive forms use FormBuilder to build forms programmatically and attach validators and value changes. Both approaches allow collecting and validating user input, and associating forms with models. Forms are a key part of many applications for user input and data collection.
This document provides a summary of Han Janghyun's background and experience. It includes:
1. Han Janghyun previously worked as a senior developer at Samsung SDS and has experience implementing TV platform JavaScript applications and retail solution servers and frontends.
2. He now works as a freelance developer and operates the blog han41858.tistory.com. He is also writing a translation of the book Angular 2.
3. Han Janghyun is also involved in operating GDG Korea Web Tech.
Slides from my Lonestar Ruby Conf 2011 presentation.
*** Video of presentation: http://confreaks.com/videos/2531-lsrc2011-testing-javascript-with-jasmine ***
Agenda:
- Briefly cover why you should unit test
- Discuss what Jasmine is and isn't
- Show syntax with comparisons to RSpec
- Jasmine with:
- Vanilla JavaScript
- Jasmine with jQuery
- Jasmine with Ruby (not Rails)
- Jasmine with Rails
- Evergreen
- capybara-webkit
- Where does CoffeeScript, node.js, etc. fit in?
- Other helpful libraries/Wrap-up
This document discusses test-driven development with JavaFX. It covers testing JavaFX applications at the unit, integration, and system levels. It also discusses continuous integration/continuous delivery and different tools that can be used for testing JavaFX applications, including TestFX, MarvinFX, JemmyFX, and Automaton. TestFX is highlighted as the recommended tool, with details provided on how to interact with JavaFX applications using its fluent API. The document also discusses using the view object pattern to write more readable tests and testing JavaFX applications that use DataFX or Afterburner.fx frameworks. It provides an example of using CDI to inject mocks when testing.
s React.js a library or a framework? In any case, it is a new way of working that represents a revolution in the way of building web projects. It has very particular characteristics that allow us, for instance, to render React code from the server side, or to include React components from Twig tags. During this talk we will present React.js, we will explore how to take advantage of it from PHP projects and we will give answers to practical problems such as universal (isomorphical) rendering and the generation of React.js forms from Symfony forms without duplication of efforts.
Advanced Jasmine - Front-End JavaScript Unit TestingLars Thorup
This document discusses advanced techniques for front-end JavaScript unit testing using Jasmine, including mocking methods, constructors, timers, and AJX requests to test code in isolation without dependencies and speed up tests. It also covers spying on events, simulating CSS transitions, using custom matchers, structuring test code, and browser-specific testing. The presenter is Lars Thorup, a software developer and coach who founded ZeaLake and teaches agile and automated testing.
Template forms allow creating forms directly in the template using directives like ngModel. Reactive forms use FormBuilder to build forms programmatically and attach validators and value changes. Both approaches allow collecting and validating user input, and associating forms with models. Forms are a key part of many applications for user input and data collection.
This document provides a summary of Han Janghyun's background and experience. It includes:
1. Han Janghyun previously worked as a senior developer at Samsung SDS and has experience implementing TV platform JavaScript applications and retail solution servers and frontends.
2. He now works as a freelance developer and operates the blog han41858.tistory.com. He is also writing a translation of the book Angular 2.
3. Han Janghyun is also involved in operating GDG Korea Web Tech.
Slides from my Lonestar Ruby Conf 2011 presentation.
*** Video of presentation: http://confreaks.com/videos/2531-lsrc2011-testing-javascript-with-jasmine ***
Agenda:
- Briefly cover why you should unit test
- Discuss what Jasmine is and isn't
- Show syntax with comparisons to RSpec
- Jasmine with:
- Vanilla JavaScript
- Jasmine with jQuery
- Jasmine with Ruby (not Rails)
- Jasmine with Rails
- Evergreen
- capybara-webkit
- Where does CoffeeScript, node.js, etc. fit in?
- Other helpful libraries/Wrap-up
This document discusses test-driven development with JavaFX. It covers testing JavaFX applications at the unit, integration, and system levels. It also discusses continuous integration/continuous delivery and different tools that can be used for testing JavaFX applications, including TestFX, MarvinFX, JemmyFX, and Automaton. TestFX is highlighted as the recommended tool, with details provided on how to interact with JavaFX applications using its fluent API. The document also discusses using the view object pattern to write more readable tests and testing JavaFX applications that use DataFX or Afterburner.fx frameworks. It provides an example of using CDI to inject mocks when testing.
s React.js a library or a framework? In any case, it is a new way of working that represents a revolution in the way of building web projects. It has very particular characteristics that allow us, for instance, to render React code from the server side, or to include React components from Twig tags. During this talk we will present React.js, we will explore how to take advantage of it from PHP projects and we will give answers to practical problems such as universal (isomorphical) rendering and the generation of React.js forms from Symfony forms without duplication of efforts.
Advanced Jasmine - Front-End JavaScript Unit TestingLars Thorup
This document discusses advanced techniques for front-end JavaScript unit testing using Jasmine, including mocking methods, constructors, timers, and AJX requests to test code in isolation without dependencies and speed up tests. It also covers spying on events, simulating CSS transitions, using custom matchers, structuring test code, and browser-specific testing. The presenter is Lars Thorup, a software developer and coach who founded ZeaLake and teaches agile and automated testing.
AngularJS Unit Testing w/Karma and Jasminefoxp2code
This document provides instructions for setting up Angular unit testing with Karma and Jasmine. It discusses initializing Karma and Jasmine via NPM, configuring Karma, adding Angular and Angular mocks via Bower, writing describe and it blocks for tests, and using matchers and mocks like $httpBackend. The live coding section at the end indicates the document will demonstrate these concepts in real tests.
Jasmine is a BDD framework for testing JavaScript code. It does not depend on other frameworks and does not require a DOM. Jasmine uses specs, expectations, suites, and matchers to define tests and make assertions. It also supports features for testing asynchronous code and spying on functions. Jasmine provides tools like spies, stubs, fakes, and mocks to help test code behavior.
Building scalable applications with angular jsAndrew Alpert
This document discusses best practices for organizing AngularJS applications. It recommends organizing files by feature rather than type, with each feature having related HTML, CSS, tests, etc. It also recommends structuring modules to mirror the URL structure and listing submodules as dependencies. The document discusses using services for reusable logic rather than large controllers. It emphasizes writing tests, managing technical debt, following code style guides, and using task runners like Grunt or Gulp to automate tasks.
React table tutorial use filter (part 2)Katy Slemon
In this React Table tutorial, we will learn how to implement useFilter in our react-table example. Further, we will explore how useFilter works in React Table.
The document discusses building native components and modules for React Native applications. It provides guidance on creating native modules and components for both iOS and Android platforms. For native modules, it describes how to expose methods and properties to JavaScript. For native components, it explains how to create custom native views and expose their properties and events to React components.
Unit Testing Express and Koa Middleware in ES2015Morris Singer
Even for JavaScript software developers well-versed in Agile practices, using test-driven development in the development of Node.js-based webservers can be challenging. In this presentation, I identify solutions to some of the most significant challenges to using TDD to build middleware stacks, with a focus on Express and Koa.
Unit testing JavaScript code with Jasmine allows developers to test functionality in isolation through matchers, spies, and asynchronous handling. Key benefits include cheaper QA, better documentation, improved code quality, and easier debugging. While some are deterred by complex asynchronous code or small projects, unit testing pays off through early bug detection and confidence that features work as intended.
"Full Stack frameworks or a story about how to reconcile Front (good) and Bac...Fwdays
Probably every backend developer had to face the frontend. I am sure that this interaction did not always end without mental trauma. However, today, thanks to Full Stack frameworks, we can forget about this headache, because we have the opportunity to describe and generate a frontend on the PHP side.
Even for JavaScript software developers well-versed in Agile practices, using test-driven development in Node.js and Express can be challenging. In this presentation, I identify solutions to some of the most significant challenges to using TDD with Express, including mocking data in MongoDB / Mongoose, using promises to control asynchronous testing in Mocha with Chai, and separating concerns to write robust and enduring test suites.
This document discusses testing AngularJS applications. It introduces popular testing frameworks like Jasmine and Karma that can be used to write unit tests and automate testing. Jasmine is typically used for testing AngularJS code and examples are given of writing tests with Jasmine. Karma is presented as a tool to automate testing by running tests in browsers. Protractor is introduced for end-to-end testing of front-end DOM elements. The document argues that front-end testing will become more important and integrated into development as tools continue to improve.
Implement react pagination with react hooks and react paginateKaty Slemon
ReactJS Pagination using React Hooks. Learn about how to implement pagination with React hooks and React paginate to manage and display the vast data conveniently.
Test-Driven Development of AngularJS ApplicationsFITC
The document discusses test driven development for AngularJS applications. It outlines problems with traditional front-end development approaches like jQuery manipulation and lack of structure/modularity. The solution presented uses Node.js, NPM, Bower, Grunt, Jasmine and other tools to automate tasks, add structure and enable testing. Features of an example task tracking app are developed using a test-first approach with end-to-end and unit tests. The app is built incrementally by splitting development into small features and writing tests for each.
This document discusses AngularJS unit testing. It covers why unit testing is important, setting up a basic testing environment with tools like Karma and Jasmine, writing different types of tests for controllers, components, directives, services and filters, mocking and stubbing, best practices, and resources for further reading on AngularJS testing.
[Srijan Wednesday Webinars] Ruling Drupal 8 with #d8rulesSrijan Technologies
Speaker: Josef Dabernig a.k.a Dasjo
This webinar takes a look at how to automate some powerful backend capabilities for your Drupal site, using the Drupal 8 Rules. Take a look at how D8 Rules can change the way we build sites. Also, learn how you can contribute to getting Rules closer to a stable release.
This presentation is prepared for SVCC 2014 on Javascript Testing with Jasmine. It basically goes through basic Jasmine feature and provide tips for developers when they decide to start testing.
This document provides an overview of the JavaFX community and ecosystem, including key people, blogs, books, tutorials, projects, frameworks, libraries, and more. It encourages joining the JavaFX community and contributing to open source projects to help grow skills. The presentation highlights over 30 frameworks and 45 libraries that have been developed for JavaFX.
These are the slides for the talk given at https://www.meetup.com/South-Florida-Software-Testing/events/233980212
Short summary:
KISS (Keep It Simple Stupid) techniques and practices in Web UI Automation on topics:
- selenium webdriver vs wrappers
- XPath vs CSS Selectors + Selene
- End to End vs Atomic tests
- Pretty vs Simple reports
- BDD vs XUnit style of tests
- PageObject vs PageModules (OOP vs Procedural/Modular programming)
This document discusses test-driven development with Jasmine and Karma. It justifies TDD for JavaScript, provides an overview of TDD and its benefits. It then explains the basics of Jasmine including suites, specifications, matchers and spies. Finally it covers configuring Karma and using tools like PhantomJS for running tests and karma-coverage for generating code coverage reports.
CakePHP is a nice way of using MVC architecture in you PHP environment. Looking through this presentation you'll get introduced to MVC and get some start up code examples for you to explore.
This document discusses various techniques for working with multimedia in Android applications, including detecting device capabilities, loading images from local storage and remote URLs, playing audio files from assets and raw resources, and improving performance through caching and asynchronous loading. It provides code examples for checking if a device has a front-facing camera, loading images while avoiding out of memory errors, playing audio files from assets, and using an AsyncTask to load images asynchronously to avoid blocking the UI. It also discusses potential memory leak issues and strategies for building an image cache.
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.
AngularJS Unit Testing w/Karma and Jasminefoxp2code
This document provides instructions for setting up Angular unit testing with Karma and Jasmine. It discusses initializing Karma and Jasmine via NPM, configuring Karma, adding Angular and Angular mocks via Bower, writing describe and it blocks for tests, and using matchers and mocks like $httpBackend. The live coding section at the end indicates the document will demonstrate these concepts in real tests.
Jasmine is a BDD framework for testing JavaScript code. It does not depend on other frameworks and does not require a DOM. Jasmine uses specs, expectations, suites, and matchers to define tests and make assertions. It also supports features for testing asynchronous code and spying on functions. Jasmine provides tools like spies, stubs, fakes, and mocks to help test code behavior.
Building scalable applications with angular jsAndrew Alpert
This document discusses best practices for organizing AngularJS applications. It recommends organizing files by feature rather than type, with each feature having related HTML, CSS, tests, etc. It also recommends structuring modules to mirror the URL structure and listing submodules as dependencies. The document discusses using services for reusable logic rather than large controllers. It emphasizes writing tests, managing technical debt, following code style guides, and using task runners like Grunt or Gulp to automate tasks.
React table tutorial use filter (part 2)Katy Slemon
In this React Table tutorial, we will learn how to implement useFilter in our react-table example. Further, we will explore how useFilter works in React Table.
The document discusses building native components and modules for React Native applications. It provides guidance on creating native modules and components for both iOS and Android platforms. For native modules, it describes how to expose methods and properties to JavaScript. For native components, it explains how to create custom native views and expose their properties and events to React components.
Unit Testing Express and Koa Middleware in ES2015Morris Singer
Even for JavaScript software developers well-versed in Agile practices, using test-driven development in the development of Node.js-based webservers can be challenging. In this presentation, I identify solutions to some of the most significant challenges to using TDD to build middleware stacks, with a focus on Express and Koa.
Unit testing JavaScript code with Jasmine allows developers to test functionality in isolation through matchers, spies, and asynchronous handling. Key benefits include cheaper QA, better documentation, improved code quality, and easier debugging. While some are deterred by complex asynchronous code or small projects, unit testing pays off through early bug detection and confidence that features work as intended.
"Full Stack frameworks or a story about how to reconcile Front (good) and Bac...Fwdays
Probably every backend developer had to face the frontend. I am sure that this interaction did not always end without mental trauma. However, today, thanks to Full Stack frameworks, we can forget about this headache, because we have the opportunity to describe and generate a frontend on the PHP side.
Even for JavaScript software developers well-versed in Agile practices, using test-driven development in Node.js and Express can be challenging. In this presentation, I identify solutions to some of the most significant challenges to using TDD with Express, including mocking data in MongoDB / Mongoose, using promises to control asynchronous testing in Mocha with Chai, and separating concerns to write robust and enduring test suites.
This document discusses testing AngularJS applications. It introduces popular testing frameworks like Jasmine and Karma that can be used to write unit tests and automate testing. Jasmine is typically used for testing AngularJS code and examples are given of writing tests with Jasmine. Karma is presented as a tool to automate testing by running tests in browsers. Protractor is introduced for end-to-end testing of front-end DOM elements. The document argues that front-end testing will become more important and integrated into development as tools continue to improve.
Implement react pagination with react hooks and react paginateKaty Slemon
ReactJS Pagination using React Hooks. Learn about how to implement pagination with React hooks and React paginate to manage and display the vast data conveniently.
Test-Driven Development of AngularJS ApplicationsFITC
The document discusses test driven development for AngularJS applications. It outlines problems with traditional front-end development approaches like jQuery manipulation and lack of structure/modularity. The solution presented uses Node.js, NPM, Bower, Grunt, Jasmine and other tools to automate tasks, add structure and enable testing. Features of an example task tracking app are developed using a test-first approach with end-to-end and unit tests. The app is built incrementally by splitting development into small features and writing tests for each.
This document discusses AngularJS unit testing. It covers why unit testing is important, setting up a basic testing environment with tools like Karma and Jasmine, writing different types of tests for controllers, components, directives, services and filters, mocking and stubbing, best practices, and resources for further reading on AngularJS testing.
[Srijan Wednesday Webinars] Ruling Drupal 8 with #d8rulesSrijan Technologies
Speaker: Josef Dabernig a.k.a Dasjo
This webinar takes a look at how to automate some powerful backend capabilities for your Drupal site, using the Drupal 8 Rules. Take a look at how D8 Rules can change the way we build sites. Also, learn how you can contribute to getting Rules closer to a stable release.
This presentation is prepared for SVCC 2014 on Javascript Testing with Jasmine. It basically goes through basic Jasmine feature and provide tips for developers when they decide to start testing.
This document provides an overview of the JavaFX community and ecosystem, including key people, blogs, books, tutorials, projects, frameworks, libraries, and more. It encourages joining the JavaFX community and contributing to open source projects to help grow skills. The presentation highlights over 30 frameworks and 45 libraries that have been developed for JavaFX.
These are the slides for the talk given at https://www.meetup.com/South-Florida-Software-Testing/events/233980212
Short summary:
KISS (Keep It Simple Stupid) techniques and practices in Web UI Automation on topics:
- selenium webdriver vs wrappers
- XPath vs CSS Selectors + Selene
- End to End vs Atomic tests
- Pretty vs Simple reports
- BDD vs XUnit style of tests
- PageObject vs PageModules (OOP vs Procedural/Modular programming)
This document discusses test-driven development with Jasmine and Karma. It justifies TDD for JavaScript, provides an overview of TDD and its benefits. It then explains the basics of Jasmine including suites, specifications, matchers and spies. Finally it covers configuring Karma and using tools like PhantomJS for running tests and karma-coverage for generating code coverage reports.
CakePHP is a nice way of using MVC architecture in you PHP environment. Looking through this presentation you'll get introduced to MVC and get some start up code examples for you to explore.
This document discusses various techniques for working with multimedia in Android applications, including detecting device capabilities, loading images from local storage and remote URLs, playing audio files from assets and raw resources, and improving performance through caching and asynchronous loading. It provides code examples for checking if a device has a front-facing camera, loading images while avoiding out of memory errors, playing audio files from assets, and using an AsyncTask to load images asynchronously to avoid blocking the UI. It also discusses potential memory leak issues and strategies for building an image cache.
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.
This document provides an overview of key Android development concepts and techniques. It discusses fragments, the support library, dependency injection, image caching, threading and AsyncTask, notifications, supporting multiple screens, and optimizing ListView performance. The document also recommends several popular Android libraries and open source apps that demonstrate best practices.
DroidParts is a library that helps handle common tasks in Android development such as:
- SQL operations, JSON serialization/deserialization, HTTP interactions, loading and caching images, background processing, logging, and dependency injection.
It provides solutions for these tasks through modular "parts" including an ORM, JSON serializer, REST client, image fetcher, logger, and more. The library aims to provide a simple yet flexible API and avoid reimplementing core Java and OO principles.
This document provides an overview of best practices for Android development. It discusses topics such as UI design, including layouts and styles; using the action bar for search and progress indicators; accessibility; network connections; asynchronous tasks and services; fragments and navigation patterns; geolocation and performance; dependency injection; and recommended tools and libraries. The document provides code snippets and links to the Android developer documentation for further information on these topics.
This document provides information on using the Google App Engine Datastore and ORM tools to manage data in a cloud environment. It describes the key concepts of entities, properties, queries and transactions using both the low-level Datastore API and higher-level ORM such as DataNucleus. Code examples are given for common operations like entity creation, retrieval, updating and deletion in both APIs.
The document discusses using annotations in Java, providing examples of annotations for servlets, EJBs, web services, CDI, and using frameworks like JUnit, Spring, Javassist, and ASM. It presents code samples to define servlets, session beans, RESTful and SOAP web services, and component injection using annotations instead of XML configurations. The document also demonstrates how to programmatically read annotation values and metadata using reflection, Javassist, and ASM.
This document discusses refactoring code to improve its design without changing external behavior. It notes that refactoring involves making small, incremental changes rather than large "big bang" refactorings. Code smells that may indicate a need for refactoring include duplication, long methods, complex conditional logic, speculative code, and overuse of comments. Techniques discussed include extracting methods, removing duplication, using meaningful names, removing temporary variables, and applying polymorphism. The document emphasizes that refactoring is an investment that makes future changes easier and helps avoid bugs, and encourages learning from other programming communities.
Developer Student Clubs NUK - Flutter for BeginnersJiaxuan Lin
This document provides an introduction and overview of Flutter for beginners. It covers topics like building native mobile apps across platforms using Flutter and Dart, the basic project structure in Flutter, common widgets like Scaffold, AppBar and Container, basic layouts using Row and Column, fetching and displaying data from APIs, and navigating between screens using the Navigator. The document aims to get beginners started with building their first Flutter app and provides additional resources for learning more about Flutter development.
The document discusses different strategies for testing persistence in PHP applications, including unit testing with mocks and dependencies, integration testing using DbUnit to insert test data and assert expected results, and techniques for setting up common initial states across tests. It also covers the benefits and downsides of different types of tests, such as layer crossing tests that test interactions across layers but may be more brittle, versus end-to-end black box tests that test through the public API but are harder to debug.
Esta charla comprende las lecciones aprendidas convirtiendo la app de Android de Teambox (una app repleta de deuda técnica y con un alto nivel de acoplamiento entre clases), en la versión actual de Redbooth, que intenta cumplir la arquitectura Hexagonal y los principios SOLID. Durante la exposición explicaremos como fuimos desenredando el código paso a paso; como aplicamos por partes los conceptos de la arquitectura hexagonal; como dejamos de lado componentes del framework de Android que dificultaban el mantenimiento de la app; y que errores cometimos, como los solucionamos y como se podrían haber evitado.
Nous entendons aujourd’hui parler de Deep Learning un peu partout : reconnaissance d’images, de sons, génération de textes, etc. Suite aux récentes annonces sur Android Neural Network API et TensorFlowLite et à la release du framework CoreML d’Apple, tout nous pousse vers le “on-device intelligence”.
Bien que les techniques et frameworks soient en train de se démocratiser, il reste difficile d’en voir les applications concrètes en entreprise, et encore moins sur des applications mobiles. Nous avons donc décidé de construire un Proof Of Concept pour relever les défis du domaine.
A travers une application mobile à but éducatif, utilisant du Deep Learning pour de la reconnaissance d’objets, nous aborderons les impacts de ce type de modèles sur les smartphones, l’architecture pour l’entraînement et le déploiement de modèles sur un service Cloud, ainsi que la construction de l’application mobile avec les dernières nouveautés annoncées.
PyCon India 2010 Building Scalable apps using appenginePranav Prakash
This document discusses building scalable apps using Google App Engine. It introduces Google App Engine and shows a simple "Hello World" app written in Python. It describes how App Engine uses the Datastore for scalable data storage and modeling data with entities and properties. It also covers caching with Memcache and techniques for scaling apps, including using entity groups, batches, sharding, and caching.
In 2008 Android app code had a lot of boilerplate, and was very error prone.
More code.. more bugs!
Now it doesn't have to be... but that is an option that each developer needs to take!
This document discusses architecture components for building modern Android applications. It covers common app architecture problems and principles like separation of concerns. It introduces key Architecture Components like Activities, Fragments, Services, ContentProviders, ViewModels and LiveData. It also discusses architectural patterns like MVC, MVP, MVVM and recommendations like clean architecture. The document emphasizes principles like modularity, separation of concerns, and testability. It provides an overview of alternatives like Room, Paging Library, and recommendations for legacy apps.
This document discusses architecture components for building modern Android applications. It covers common app architecture problems and principles like separation of concerns. It introduces key Architecture Components like Activities, Fragments, Services, ContentProviders, ViewModels and LiveData. It also discusses architectural patterns like MVC, MVP, MVVM and recommendations like clean architecture. The document emphasizes principles like modularity, separation of concerns, and testability. It provides an overview of alternatives like Room, Paging Library, and recommendations for legacy apps.
Struts 2 is an MVC framework that is the successor to Struts and WebWork 2, providing a simple architecture based around interceptors, actions, and results with conventions over configuration and support for technologies like Spring, Velocity, and Ajax. It aims to bring the best of Struts 1 and WebWork 2 together while being easier to test and use through defaults and annotations. The framework can integrate with many open source libraries and supports features like localization, type conversion, and configuration through XML files and annotations.
Лаконічні та елегантні автоматизовані тести? Безболісний (майже) тестовий стек для UI веб-додатків? Більше часу, щоб випити кави/пограти у Cuphead/ подивитись у порожнечу?
Ми поговоримо про Lombok, Vavr, Owner, чому вам варто використовувати готові рішення та як зробити тести більш лаконічними та читабельними. Вам знадобиться Vaper та/або гіроборд.
A GWT Application with MVP Pattern Deploying to CloudFoundry using Spring Roo Ali Parmaksiz
This document summarizes a presentation about developing a MVP application using GWT, Spring Roo, and deploying it to CloudFoundry. The presentation covers MVP pattern in GWT, using activities and places for navigation, using Spring Roo for rapid development, and deploying the application to CloudFoundry. It provides code examples for implementing MVP using views, presenters, activities and places. It also outlines the steps to deploy an application to CloudFoundry including installing the vmc CLI and pushing the application.
The document discusses different approaches to integrating Struts 2 and Spring frameworks by separating application layers.
It presents three cases: 1) Using a simple POJO as the action; 2) Extending ActionSupport to decouple the action from business services; 3) Using business services and data transfer objects to further separate layers.
The key point is that the business layer should not be tied to any web framework like Struts or Spring MVC. Integration can be achieved by configuring business services for use by actions, while keeping each layer independent through separation of concerns.
The document discusses Uber's APIs and how they can be used to build experiences that enhance transportation. It notes that Uber has facilitated over 2 billion trips across more than 470 cities. Developers can integrate their apps with Uber's APIs to authenticate users, request rides, access ride details and context through the trip to improve users' experiences. The document provides examples of how ride context could be used to suggest local guides, play media based on trip duration, and control smart home devices like heating when approaching home.
This document discusses building and shipping software using GitHub. It provides key facts about GitHub such as being founded in 2008, having over 15 million registered users and 36 million repositories. It also shares principles from "The Zen of GitHub" including that responsive is better than fast, practicality beats purity, and favor focus over features. The document advocates for empowering businesses to build great software through culture, tools, process and a DevOps approach.
This document introduces .NET Core and its advantages over the .NET Framework. It discusses how .NET Core is cross-platform, uses the .NET Standard library, and can create self-contained applications. It also highlights how .NET Core applications are smaller, faster, and container-friendly. The document demonstrates how to use the dotnet CLI and publish .NET Core applications to reduce their deployment size. Overall, it promotes adopting .NET Core for its performance, portability, and familiar .NET APIs.
René Gröschke gave a talk on the latest features and future direction of Gradle. Some of the key points included:
- Gradle is moving to a Kotlin-based DSL for improved performance, tooling support, and bringing application patterns to builds.
- Performance improvements include a dedicated performance team that has improved Android Gradle Plugin build times significantly.
- Composite builds allow including external projects to debug dependencies or test plugins against real projects.
- Build cache and distributed build cache are incubating features to cache and share build results for faster rebuilds.
- Gradle build scans provide insights into builds to debug issues, optimize performance, and compare builds
The document discusses containerizing ASP.NET Core applications with Kubernetes. It begins with an overview of .NET Core and containers, and how they have converged. It then discusses Kubernetes and how it can help manage containers at scale. It covers Kubernetes building blocks like deployments, pods, labels, services, and replica sets. It provides examples of deploying containers with Kubernetes, including demonstrations of creating deployments, services, scaling applications, and rolling updates.
3. How to measure UI performance?
● FPS
https://github.com/friendlyrobotnyc/TinyDancer
● Profile GPU rendering
https://developer.android.com/studio/profile/dev-options-rendering.html
● Aggregate frame stats
https://developer.android.com/training/testing/performance.html
● Many others...
@a_tolstykh
4. How to measure UI performance?
● FPS
https://github.com/friendlyrobotnyc/TinyDancer
● Profile GPU rendering
https://developer.android.com/studio/profile/dev-options-rendering.html
● Aggregate frame stats
https://developer.android.com/training/testing/performance.html
● Many others...
@a_tolstykh
5. Sample App - Travel With Us
City guides
Base city info
Data is loaded from server
@a_tolstykh
RecyclerView!
6. Optimize Cells hierarchies
Avoid deep hierarchy
Save level with <merge> when <include>
Layout matters!
@a_tolstykhhttps://developer.android.com/topic/performance/rendering/optimizing-view-hierarchies.html
android.support.constraint.ConstraintLayout
com.google.android.flexbox.FlexboxLayout
8. Correct images scale
Make sure their size and compression are optimal.
Scaling images may also affect the performance.
Do not reinvent the wheel.
@a_tolstykh
Picasso, ImageLoader, Fresco, Glide.
Picasso v/s Imageloader v/s Fresco vs Glide [closed]
http://stackoverflow.com/q/29363321/2308720
9. Nested RecyclerView
Override the LinearLayoutManager#getInitialPrefetchItemCount()
@a_tolstykh
public int getInitialPrefetchItemCount ()
Defines how many inner items should be prefetched when this LayoutManager's
RecyclerView is nested inside another RecyclerView
Binding the inner RecyclerView doesn’t allocate any children.
The prefetching system has to know how many.
10. Update only the affected items
adapter.notifyItemRemoved(position);
adapter.notifyItemChanged(position);
adapter.notifyItemInserted(position);
* only if you know position of updated item
@a_tolstykh
12. Remove an item with swipe:
SimpleCallback touchCallback
= new SimpleCallback(0, ItemTouchHelper.LEFT | ItemTouchHelper.RIGHT) {
// ...
@Override
public void onSwiped(ViewHolder viewHolder, int swipeDir) {
adapter.remove(viewHolder.getAdapterPosition());
adapter.notifyItemRemoved(viewHolder.getAdapterPosition());
}
};
@a_tolstykh
13. Items cache
recyclerView.setItemViewCacheSize (int size);
Documentation:
“Set the number of offscreen views
to retain before adding them
to the potentially shared recycled view pool.”
@a_tolstykh
static final int DEFAULT_CACHE_SIZE = 2; // supportVersion = 25.3.0
14. Stable ids - adapter.setHasStableIds()
adapter.setHasStableIds(true);
// YourAdapter.java
@Override
public long getItemId(int position) {
return items.get(position).hashcode(); //id()
}
@a_tolstykh
Only if item in the data set can be represented with a unique identifier
Avoid unnecessary bindViewHolder() calls if view exists in RecyclerView’s cache
15. Prefetch
Use latest version of support library to use native prefetch optimizations
supportVersion >= 25.1.0
// (enabled by default)
RecyclerView Prefetch by Chet Haase
https://medium.com/google-developers/c2f269075710
*Lollipop and newer
@a_tolstykh
16. Advanced prefetch
Override the LinearLayoutManager#getExtraLayoutSpace(RecyclerView.State s)
@a_tolstykh
protected int getExtraLayoutSpace (RecyclerView.State state)
Returns the amount of extra space that should be laid out by LayoutManager.
By default, LinearLayoutManager lays out 1 extra page of items while smooth
scrolling and 0 otherwise. You can override this method to implement your custom
layout pre-cache logic.
17. Advanced prefetch
@a_tolstykh
public class PreCachingLayoutManager extends LinearLayoutManager {
// ....
public void setExtraLayoutSpace(int extraLayoutSpace) {
this.extraLayoutSpace = extraLayoutSpace;
}
@Override
protected int getExtraLayoutSpace(RecyclerView.State state) {
return extraLayoutSpace > 0 ? extraLayoutSpace : DEFAULT_EXTRA_SPACE;
}
}
18. BUT...
Expensive if done while the user may change scrolling direction.
Laying out invisible elements generally comes with significant performance cost.
Useless without increasing cache size (setItemViewCacheSize).
@a_tolstykh
BUT it improves USER EXPERIENCE!
Need to find balance.
Maybe 1 extra screen is The Balance?
19. Even more advanced prefetch...
Prefetch images! (on wi-fi only)
@a_tolstykh
Picasso.with(context).load(url).fetch();
Glide.with(context).load(url).downloadOnly(width, height);
21. @a_tolstykh
public class CitiesAdapter extends RecyclerView.Adapter<CityViewHolder> {
public void updateData(List<City> cities) {
if (onWifi()) prefetch(cities);
// TODO update adapter data
}
private void prefetch(List<City> cities) {
for (City city : cities) {
PreFetcher prefetcher = city.getPrefetcher();
if (prefetcher != null) {
prefetcher.prefetch(mContext);
}
}
}
}
22. @a_tolstykh
public class ImagePrefetcher implements PreFetcher {
private final Image[] mImages;
public ImagePrefetcher(Image... images) {
this.mImages = images;
}
@Override
public void prefetch(Context context) {
for (Image image : mImages) {
Picasso.with(context).load(image.url()).fetch();
}
}
}
23. @a_tolstykh
public class TweetPrefetcher implements PreFetcher {
private final List<String> mIds;
@Override
public void prefetch(Context context) {
TwitterHelper.loadTweets(mIds, new Callback<List<Tweet>>() {
@Override
public void success(Result<List<Tweet>> result) {
for (Tweet tweet : result.data) {
TwitterHelper.preFetchTweetImage(tweet);
}
}
});
}
}
24. Displayed data pre-calculations
Displayed items are POJOs.
Pre-format date, time, other strings during data parsing.
Pre-calculate immutable values during data parsing.
@a_tolstykh
Profit:
+ Minor performance optimisations.
+ Formatting is done in BG thread.
+ Formatting is done in single place.
27. android.support.v7.util.DiffUtil
Documentation:
“DiffUtil is a utility class that can calculate the difference between two
lists and output a list of update operations that converts the first list
into the second one.
@a_tolstykh
It can be used to calculate updates for a RecyclerView Adapter.”
DiffUtil.Callback cb = new YourDiffCallback(oldList, newList);
DiffUtil.DiffResult diffResult = DiffUtil.calculateDiff(cb);
diffResult.dispatchUpdatesTo(adapter);
28. DiffUtil.Callback
public class DiffCallback extends DiffUtil.Callback {
public DiffCallback(@NonNull List<City> newList, @NonNull List<City> oldList) {...}
public int getOldListSize() {...}
public int getNewListSize() {...}
public boolean areItemsTheSame(int oldItemPosition, int newItemPosition) {...}
public boolean areContentsTheSame(int oldItemPosition, int newItemPosition) {...}
@Nullable
public Object getChangePayload(int oldItemPosition, int newItemPosition) {...}
}
@a_tolstykh
29. DiffUtil.Callback
public boolean areItemsTheSame(int oldItemPosition, int newItemPosition)
When areItemsTheSame(int, int) returns true for two items and areContentsTheSame(int,
int) returns false for them, DiffUtil calls this method to get a payload about the change.
public boolean areContentsTheSame(int oldItemPosition, int newItemPosition)
Checks whether two items have the same data.You can change its behavior depending on
your UI. This method is called by DiffUtil only if areItemsTheSame returns true.
@a_tolstykh
30. DiffUtil.Callback
@Override public int getOldListSize() {
return oldCities.size();
}
@Override public int getNewListSize() {
return newCities.size();
}
@Override public boolean areItemsTheSame(int oldPosition, int newPosition) {
return oldCities.get(oldPosition).id() == newCities.get(newPosition).id();
}
@Override public boolean areContentsTheSame(int oldPosition, int newPosition) {
return oldCities.get(oldPosition).equals(newCities.get(newPosition));
}
@a_tolstykh
32. DiffUtil.Callback
public Object getChangePayload(int oldItemPosition, int newItemPosition)
When areItemsTheSame(int, int) returns true for two items and areContentsTheSame(int,
int) returns false for them, DiffUtil calls this method to get a payload about the change.
@a_tolstykh
For example, if you are using DiffUtil with RecyclerView, you can return
the particular field that changed in the item and your ItemAnimator can
use that information to run the correct animation.
34. public void onBindViewHolder(CityViewHolder holder, int index, List<Object> p) {
if (p.isEmpty()) {
onBindViewHolder(holder, index);
return;
}
Bundle payload = (Bundle) p.get(0);
for (String key : payload.keySet()) {
if (key.equals(CitiesDiffCallback.KEY_NUMBER_OF_REVIEWS)) {
holder.animateReviews(payload.getString(key));
} else if (key.equals(CitiesDiffCallback.KEY_RATING_FORMATTED)) {
holder.animateRating(payload.getString(key));
}
}
}
@a_tolstykh
35. Use any animation you want!
● android.widget.TextSwitcher
● com.hanks.htextview.HTextView
● custom...
@a_tolstykh
DiffUtil animated values change
36. DiffUtil - average runtimes
● 100 items and 10 modifications: avg: 0.39 ms, median: 0.35 ms
● 100 items and 100 modifications: 3.82 ms, median: 3.75 ms
● 100 items and 100 modifications without moves: 2.09 ms, median: 2.06 ms
● 1000 items and 50 modifications: avg: 4.67 ms, median: 4.59 ms
● 1000 items and 50 modifications without moves: avg: 3.59 ms, median: 3.50 ms
● 1000 items and 200 modifications: 27.07 ms, median: 26.92 ms
● 1000 items and 200 modifications without moves: 13.54 ms, median: 13.36 ms
tests are run on Nexus 5X with M
@a_tolstykh
39. Android TextView with rich support
of compound drawables.
This is a tiny library which empowers
TextView's compound drawables with:
● size specifying
● vector support
● tinting
@a_tolstykhhttps://github.com/a-tolstykh/textview-rich-drawable
TextViewRichDrawable