The document discusses threading in Android applications. It begins by explaining that the main or UI thread is responsible for drawing the user interface and handling input/output events. Any blocking operations on this thread can cause the application to become unresponsive. The document then discusses various approaches for offloading work from the main thread including using AsyncTask, HandlerThread, IntentService, and ThreadPoolExecutor. It provides examples and best practices for implementing each approach to avoid blocking the main thread and ensure responsive user experiences.
droidcon Transylvania - Kotlin CoroutinesArthur Nagy
We face challenges with threading on a daily basis. There are too many ways to do it, too many options. Do I use an AsyncTaks, a Runnable or RxJava, what do I do? All these available APIs lead to an almost inevitable callback hell.
This talk will introduce Kotlin Coroutines as an alternative solution to this problem. We’re going to explore simple ways to perform long-running tasks and computation heavy operations in an asynchronous way, without freezing or crashing your app, while keeping the code clean and readable at the same time.
This document contains a collection of code snippets and questions related to Android development puzzles and concepts. It discusses topics like the Android application lifecycle when finishing an activity, how fragment and activity handle returning results from started activities, and default behavior of progress bars and Toasts. The snippets are accompanied by multiple choice questions testing understanding of how the code would execute or appear.
The document describes an upcoming event for the Dutch Android User Group (Dutchaug) that will feature Android code puzzles and tips/tricks. It provides details about the event such as date, location, speakers, and organizer information. It also includes sample code puzzles and their solutions to demonstrate the type of content that will be covered.
This document provides an overview of Groovy and Grails, including:
- What Groovy and Grails are and their benefits and risks
- Examples demonstrating how to write Groovy code that is similar to Java code
- Features of Groovy like closures, meta programming, and dynamic typing
- How Grails provides generators, predefined application layout, GORM, and other features out of the box
- Examples of implementing domain models, views, controllers, and tag libraries in Grails
The document covers converting Java code to Groovy, Groovy features like closures and the meta object protocol (MOP), and how Grails generates scaffolding and uses conventions to simplify web application development.
Modern Code Reviews in Open-Source Projects: Which Problems Do They Fix?Moritz Beller
The document discusses how modern code reviews in open-source projects help fix problems. It analyzes data from over 2,800 code changes and 970 code review tasks across multiple projects. The analysis finds that 78-90% of changes are motivated by self-improvement rather than reviews, and most changes fix documentation, interfaces, or logic issues. Continuous integration is now more prevalent and includes static and dynamic analysis checks. Over half of projects use static analysis tools, but fewer use multiple tools or enforce fixes.
This document summarizes a presentation given at the 2014 Winter Workshop. Ryan Dahl, developer of the V8 JavaScript engine, discussed his concept that I/O needs to be handled differently in software. Specifically, he advocated using multiple threads and context switching to allow concurrent execution stacks and improve performance compared to traditional single-threaded approaches. The document provides examples of how callbacks and asynchronous programming can address these issues.
Git talk from Open 2011 conference in IsraelReuven Lerner
The document discusses version control systems and Git. It describes some key benefits of Git such as distributed version control which allows everyone to have the full codebase and commit history, easy branching and merging, and the ability to work offline. The document provides examples of basic Git commands like initializing a repository, adding files, and committing changes. It also highlights features like local repositories for fast operations, tagging releases, and tools for debugging like git blame.
droidcon Transylvania - Kotlin CoroutinesArthur Nagy
We face challenges with threading on a daily basis. There are too many ways to do it, too many options. Do I use an AsyncTaks, a Runnable or RxJava, what do I do? All these available APIs lead to an almost inevitable callback hell.
This talk will introduce Kotlin Coroutines as an alternative solution to this problem. We’re going to explore simple ways to perform long-running tasks and computation heavy operations in an asynchronous way, without freezing or crashing your app, while keeping the code clean and readable at the same time.
This document contains a collection of code snippets and questions related to Android development puzzles and concepts. It discusses topics like the Android application lifecycle when finishing an activity, how fragment and activity handle returning results from started activities, and default behavior of progress bars and Toasts. The snippets are accompanied by multiple choice questions testing understanding of how the code would execute or appear.
The document describes an upcoming event for the Dutch Android User Group (Dutchaug) that will feature Android code puzzles and tips/tricks. It provides details about the event such as date, location, speakers, and organizer information. It also includes sample code puzzles and their solutions to demonstrate the type of content that will be covered.
This document provides an overview of Groovy and Grails, including:
- What Groovy and Grails are and their benefits and risks
- Examples demonstrating how to write Groovy code that is similar to Java code
- Features of Groovy like closures, meta programming, and dynamic typing
- How Grails provides generators, predefined application layout, GORM, and other features out of the box
- Examples of implementing domain models, views, controllers, and tag libraries in Grails
The document covers converting Java code to Groovy, Groovy features like closures and the meta object protocol (MOP), and how Grails generates scaffolding and uses conventions to simplify web application development.
Modern Code Reviews in Open-Source Projects: Which Problems Do They Fix?Moritz Beller
The document discusses how modern code reviews in open-source projects help fix problems. It analyzes data from over 2,800 code changes and 970 code review tasks across multiple projects. The analysis finds that 78-90% of changes are motivated by self-improvement rather than reviews, and most changes fix documentation, interfaces, or logic issues. Continuous integration is now more prevalent and includes static and dynamic analysis checks. Over half of projects use static analysis tools, but fewer use multiple tools or enforce fixes.
This document summarizes a presentation given at the 2014 Winter Workshop. Ryan Dahl, developer of the V8 JavaScript engine, discussed his concept that I/O needs to be handled differently in software. Specifically, he advocated using multiple threads and context switching to allow concurrent execution stacks and improve performance compared to traditional single-threaded approaches. The document provides examples of how callbacks and asynchronous programming can address these issues.
Git talk from Open 2011 conference in IsraelReuven Lerner
The document discusses version control systems and Git. It describes some key benefits of Git such as distributed version control which allows everyone to have the full codebase and commit history, easy branching and merging, and the ability to work offline. The document provides examples of basic Git commands like initializing a repository, adding files, and committing changes. It also highlights features like local repositories for fast operations, tagging releases, and tools for debugging like git blame.
Node.js is a JavaScript runtime built on Chrome's V8 JavaScript engine. It uses an event-driven, non-blocking I/O model that makes it lightweight and efficient, especially for real-time web applications with many concurrent connections. The document discusses why Node.js uses an asynchronous and non-blocking model, why JavaScript was chosen as the language, and why the V8 engine is fast. It also explains why Node.js is threadless and memory efficient. Finally, it notes that the Node.js community is very active and creative.
This document provides an overview of Groovy and Grails. It begins with introductions from the presenter and asks who is familiar with Groovy and Grails. It then outlines some of the key features of Groovy, such as its Java-like syntax, dynamic typing, closures, and meta-programming capabilities. Several examples are provided that demonstrate converting Java code to Groovy. The document also discusses how Groovy can be used to build domain-specific languages, with examples using the AntBuilder and MarkupBuilder. It briefly mentions additional Groovy features and provides positive information about its adoption and support.
So what to use when doing job outside main thread? Plain old Java thread? AsyncTask? Loader? Maybe something catchy, like RoboSpice or even rxAndroid?
Let’s dive deeply into nearly all possible ways of implementing async operations on Android. Find pros and cons, share our experience with all attitudes.
The document discusses best practices for memory management in Android applications to avoid memory leaks and improve performance. It provides 3 key points:
1. Be aware of common memory issues like frequent garbage collection, memory leaks from non-static inner classes or long-lived references to activities.
2. Learn techniques for detecting memory problems like using LeakCanary, tracking allocations or dumping the Java heap.
3. Apply practices like reusing objects, avoiding non-static inner classes, and cleaning up references in lifecycle methods to optimize memory usage and prevent leaks.
The Ring programming language version 1.7 book - Part 75 of 196Mahmoud Samir Fayed
The Objects Library provides an object-oriented way to manage GUI windows and objects in RingQt applications. It allows creating multiple window controllers and views from the same classes. The library handles connecting events to controller methods and provides easy access to parent/caller windows from child windows. Developers can use the library with the MVC pattern by creating controller and view classes for each window type. Key functions include Open_Window() to create windows, Last_Window() to access the last window, and Method() to link view events to controller methods. The library aims to simplify RingQt application development by handling window and object management.
Hacking pokemon go [droidcon tel aviv 2016]Guy Lis
The document discusses various techniques for hacking mobile apps, using Pokemon Go as an example. It covers tamper checks, debugging checks, certificate pinning, root detection, and manipulating the zygote process to avoid detection. Specific hacking techniques demonstrated include decompiling apps with apktool, using Xposed modules like JustTrustMe to bypass certificate pinning, and suhide to hide the root status from apps.
"Java memory model for practitioners" at JavaLand 2017 by Vadym Kazulkin/Rodi...Vadym Kazulkin
The document discusses the Java Memory Model and provides examples of how memory is ordered in Java. It covers topics like hardware memory models, happens-before ordering, and using tools like JcStress to test for reordering issues. It also answers a quiz question about possible values of x that could be seen when y=1 is printed, given some sample multithreaded code.
연구자 및 교육자를 위한 계산 및 분석 플랫폼 설계 - PyCon KR 2015Jeongkyu Shin
This document discusses various Python and web development topics. It covers Python programming best practices and libraries like asyncio and NumPy. It also discusses front-end frameworks like Polymer and Electron. Additional sections provide overviews of containerization with Docker, message queues like ZeroMQ, log aggregation with Logstash, and cloud hosting options.
The document discusses the benefits of using Google Web Toolkit (GWT) for building AJAX applications. It summarizes key features of GWT like cross-compiling Java to JavaScript, deferred binding, compiler optimizations, and UI improvements in GWT 2.x like CSS resources, image inlining, and UiBinder. It encourages adopting GWT for its speed advantages like file caching and reduced payload sizes.
The Ring programming language version 1.8 book - Part 77 of 202Mahmoud Samir Fayed
The Objects Library provides an object-oriented way to manage GUI windows and objects in RingQt applications. It uses classes to represent windows and controllers, and handles connecting events to controller methods. Some key features include opening windows with Open_Window(), creating view and controller classes that inherit from base classes, getting the last opened window with Last_Window(), and setting the parent object with SetParentObject() when opening sub-windows. The library aims to support the MVC pattern and make it easier to work with multiple related windows in RingQt apps.
This document discusses unit testing Android applications using Robolectric. It introduces Robolectric as a tool that allows loading and testing Android classes in pure Java projects. It then discusses various testing techniques using Robolectric including mocking Android classes and context, using spies, and reducing the use of shadows by leveraging value qualifiers. The document emphasizes removing shadows as much as possible to get closer to real code.
Groovy and Grails in Action - Devoxx 2008 - University - Guillaume LaforgeGuillaume Laforge
The document is a presentation about Groovy and Grails. It discusses the history and goals of Groovy, a dynamic language for the JVM. It covers Groovy syntax and features like closures, builders for XML, Swing and Ant. The presentation also discusses how Groovy enables the creation of internal Domain Specific Languages through its meta-object protocol and dynamic nature.
Diving Deep with the Flex Component Life CycleEffective
The document discusses the Flex component lifecycle, which describes how Flex framework interacts with and instantiates components through a series of method calls. It covers the three main phases of the lifecycle: Birth (construction, configuration, attachment, initialization), Life (invalidation, validation, interaction), and Death (detachment, garbage collection). The document provides details on what occurs during each phase, such as properties being assigned during configuration and components being added to the display list during attachment. It emphasizes that components should not do much work during construction and should delay real work until later phases like validation.
This document summarizes upcoming improvements and new features in web browsers, including Firefox 3.1, Safari 4, Internet Explorer 8, Opera 10, and Google Chrome. Many of the browsers are focusing on better JavaScript performance through new engines like TraceMonkey and V8. New features include process per tab, postMessage for cross-domain communication, HTML5 drag and drop, and the Canvas element for offloading rendering to the client. Overall the browsers are aiming to improve speed, compatibility, and the user experience through these new features and technologies.
Slides for JJUG(Japan Java User Group) 2009 Fall BOF.
Talking about groovy history, new features in Groovy 1.6,1.7.
Especially focused on AST Transformations.
Fast as C: How to Write Really Terrible JavaCharles Nutter
For years we’ve been told that the JVM’s amazing optimizers can take your running code and make it “fast” or “as fast as C++” or “as fast as C”…or sometimes “faster than C”. And yet we don’t often see this happen in practice, due in large part to (good and bad) development patterns that have taken hold in the Java world.
In this talk, we’ll explore the main reasons why Java code rarely runs as fast as C or C++ and how you can write really bad Java code that the JVM will do a better job of optimizing. We’ll take some popular microbenchmarks and burn them to the ground, monitoring JIT logs and assembly dumps along the way.
The document discusses various technologies and libraries used in Android development including XML, JSON, XSLT, and sun.misc packages. It notes issues with some of these in older Android versions and potential workarounds or alternatives. Specific topics covered include XML parsing, JSON parsing inaccuracies, XSLT support, and sun.misc class availability on Android.
Async task, threads, pools, and executors oh my!Stacy Devino
http://360andev.com/sessions/100-async-task-threads-pools-and-executors/
Frome 360 AnDev conference
There are many ways to use Threads and in the multithreaded world in which we live, it can be confusing when, where, and how to use these functions correctly. Still, that assumes you know what they all mean and how to manipulate them. Novices and Experts welcome as there are many schools of thought, but we will explore them all together.
Don’t worry, we have you covered.
Animated Version : but.ly/asyncThread
The document discusses Loaders and Adapters in Android. It begins with an introduction to Loaders, explaining that they allow loading data asynchronously while coordinating with the Activity lifecycle. It covers how Loaders work, including the Loader, LoaderCallbacks and LoaderManager classes. It then provides an example of creating a simple Loader. The document next discusses preparing an Activity to use a Loader. It moves on to discussing the CursorLoader for querying ContentProviders. The second part of the document covers Adapters, their role in bridging data and views. It mentions common Adapter implementations like ArrayAdapter and CursorAdapter.
The document discusses Android Loaders, which provide a way for Activities and Fragments to asynchronously load data from a data source and deliver it back without having to manage threads or handle configuration changes. Loaders allow data to persist across configuration changes like orientation changes. The document covers the history of loading data in Android including threads and AsyncTask, introduces Loaders and the LoaderManager API, discusses implementing basic Loaders including CursorLoaders, and covers common mistakes to avoid.
Node.js is a JavaScript runtime built on Chrome's V8 JavaScript engine. It uses an event-driven, non-blocking I/O model that makes it lightweight and efficient, especially for real-time web applications with many concurrent connections. The document discusses why Node.js uses an asynchronous and non-blocking model, why JavaScript was chosen as the language, and why the V8 engine is fast. It also explains why Node.js is threadless and memory efficient. Finally, it notes that the Node.js community is very active and creative.
This document provides an overview of Groovy and Grails. It begins with introductions from the presenter and asks who is familiar with Groovy and Grails. It then outlines some of the key features of Groovy, such as its Java-like syntax, dynamic typing, closures, and meta-programming capabilities. Several examples are provided that demonstrate converting Java code to Groovy. The document also discusses how Groovy can be used to build domain-specific languages, with examples using the AntBuilder and MarkupBuilder. It briefly mentions additional Groovy features and provides positive information about its adoption and support.
So what to use when doing job outside main thread? Plain old Java thread? AsyncTask? Loader? Maybe something catchy, like RoboSpice or even rxAndroid?
Let’s dive deeply into nearly all possible ways of implementing async operations on Android. Find pros and cons, share our experience with all attitudes.
The document discusses best practices for memory management in Android applications to avoid memory leaks and improve performance. It provides 3 key points:
1. Be aware of common memory issues like frequent garbage collection, memory leaks from non-static inner classes or long-lived references to activities.
2. Learn techniques for detecting memory problems like using LeakCanary, tracking allocations or dumping the Java heap.
3. Apply practices like reusing objects, avoiding non-static inner classes, and cleaning up references in lifecycle methods to optimize memory usage and prevent leaks.
The Ring programming language version 1.7 book - Part 75 of 196Mahmoud Samir Fayed
The Objects Library provides an object-oriented way to manage GUI windows and objects in RingQt applications. It allows creating multiple window controllers and views from the same classes. The library handles connecting events to controller methods and provides easy access to parent/caller windows from child windows. Developers can use the library with the MVC pattern by creating controller and view classes for each window type. Key functions include Open_Window() to create windows, Last_Window() to access the last window, and Method() to link view events to controller methods. The library aims to simplify RingQt application development by handling window and object management.
Hacking pokemon go [droidcon tel aviv 2016]Guy Lis
The document discusses various techniques for hacking mobile apps, using Pokemon Go as an example. It covers tamper checks, debugging checks, certificate pinning, root detection, and manipulating the zygote process to avoid detection. Specific hacking techniques demonstrated include decompiling apps with apktool, using Xposed modules like JustTrustMe to bypass certificate pinning, and suhide to hide the root status from apps.
"Java memory model for practitioners" at JavaLand 2017 by Vadym Kazulkin/Rodi...Vadym Kazulkin
The document discusses the Java Memory Model and provides examples of how memory is ordered in Java. It covers topics like hardware memory models, happens-before ordering, and using tools like JcStress to test for reordering issues. It also answers a quiz question about possible values of x that could be seen when y=1 is printed, given some sample multithreaded code.
연구자 및 교육자를 위한 계산 및 분석 플랫폼 설계 - PyCon KR 2015Jeongkyu Shin
This document discusses various Python and web development topics. It covers Python programming best practices and libraries like asyncio and NumPy. It also discusses front-end frameworks like Polymer and Electron. Additional sections provide overviews of containerization with Docker, message queues like ZeroMQ, log aggregation with Logstash, and cloud hosting options.
The document discusses the benefits of using Google Web Toolkit (GWT) for building AJAX applications. It summarizes key features of GWT like cross-compiling Java to JavaScript, deferred binding, compiler optimizations, and UI improvements in GWT 2.x like CSS resources, image inlining, and UiBinder. It encourages adopting GWT for its speed advantages like file caching and reduced payload sizes.
The Ring programming language version 1.8 book - Part 77 of 202Mahmoud Samir Fayed
The Objects Library provides an object-oriented way to manage GUI windows and objects in RingQt applications. It uses classes to represent windows and controllers, and handles connecting events to controller methods. Some key features include opening windows with Open_Window(), creating view and controller classes that inherit from base classes, getting the last opened window with Last_Window(), and setting the parent object with SetParentObject() when opening sub-windows. The library aims to support the MVC pattern and make it easier to work with multiple related windows in RingQt apps.
This document discusses unit testing Android applications using Robolectric. It introduces Robolectric as a tool that allows loading and testing Android classes in pure Java projects. It then discusses various testing techniques using Robolectric including mocking Android classes and context, using spies, and reducing the use of shadows by leveraging value qualifiers. The document emphasizes removing shadows as much as possible to get closer to real code.
Groovy and Grails in Action - Devoxx 2008 - University - Guillaume LaforgeGuillaume Laforge
The document is a presentation about Groovy and Grails. It discusses the history and goals of Groovy, a dynamic language for the JVM. It covers Groovy syntax and features like closures, builders for XML, Swing and Ant. The presentation also discusses how Groovy enables the creation of internal Domain Specific Languages through its meta-object protocol and dynamic nature.
Diving Deep with the Flex Component Life CycleEffective
The document discusses the Flex component lifecycle, which describes how Flex framework interacts with and instantiates components through a series of method calls. It covers the three main phases of the lifecycle: Birth (construction, configuration, attachment, initialization), Life (invalidation, validation, interaction), and Death (detachment, garbage collection). The document provides details on what occurs during each phase, such as properties being assigned during configuration and components being added to the display list during attachment. It emphasizes that components should not do much work during construction and should delay real work until later phases like validation.
This document summarizes upcoming improvements and new features in web browsers, including Firefox 3.1, Safari 4, Internet Explorer 8, Opera 10, and Google Chrome. Many of the browsers are focusing on better JavaScript performance through new engines like TraceMonkey and V8. New features include process per tab, postMessage for cross-domain communication, HTML5 drag and drop, and the Canvas element for offloading rendering to the client. Overall the browsers are aiming to improve speed, compatibility, and the user experience through these new features and technologies.
Slides for JJUG(Japan Java User Group) 2009 Fall BOF.
Talking about groovy history, new features in Groovy 1.6,1.7.
Especially focused on AST Transformations.
Fast as C: How to Write Really Terrible JavaCharles Nutter
For years we’ve been told that the JVM’s amazing optimizers can take your running code and make it “fast” or “as fast as C++” or “as fast as C”…or sometimes “faster than C”. And yet we don’t often see this happen in practice, due in large part to (good and bad) development patterns that have taken hold in the Java world.
In this talk, we’ll explore the main reasons why Java code rarely runs as fast as C or C++ and how you can write really bad Java code that the JVM will do a better job of optimizing. We’ll take some popular microbenchmarks and burn them to the ground, monitoring JIT logs and assembly dumps along the way.
The document discusses various technologies and libraries used in Android development including XML, JSON, XSLT, and sun.misc packages. It notes issues with some of these in older Android versions and potential workarounds or alternatives. Specific topics covered include XML parsing, JSON parsing inaccuracies, XSLT support, and sun.misc class availability on Android.
Async task, threads, pools, and executors oh my!Stacy Devino
http://360andev.com/sessions/100-async-task-threads-pools-and-executors/
Frome 360 AnDev conference
There are many ways to use Threads and in the multithreaded world in which we live, it can be confusing when, where, and how to use these functions correctly. Still, that assumes you know what they all mean and how to manipulate them. Novices and Experts welcome as there are many schools of thought, but we will explore them all together.
Don’t worry, we have you covered.
Animated Version : but.ly/asyncThread
The document discusses Loaders and Adapters in Android. It begins with an introduction to Loaders, explaining that they allow loading data asynchronously while coordinating with the Activity lifecycle. It covers how Loaders work, including the Loader, LoaderCallbacks and LoaderManager classes. It then provides an example of creating a simple Loader. The document next discusses preparing an Activity to use a Loader. It moves on to discussing the CursorLoader for querying ContentProviders. The second part of the document covers Adapters, their role in bridging data and views. It mentions common Adapter implementations like ArrayAdapter and CursorAdapter.
The document discusses Android Loaders, which provide a way for Activities and Fragments to asynchronously load data from a data source and deliver it back without having to manage threads or handle configuration changes. Loaders allow data to persist across configuration changes like orientation changes. The document covers the history of loading data in Android including threads and AsyncTask, introduces Loaders and the LoaderManager API, discusses implementing basic Loaders including CursorLoaders, and covers common mistakes to avoid.
In this presentation, I'm talking about a powerful tool for asynchronous loading which is provided by Android framework - loaders. Why guys from Android team added this tool and how we can customise it? We'll try to find answers for these questions.
Kotlin coroutine - the next step for RxJava developer?Artur Latoszewski
Kotlin is a language that is rapidly gaining popularity, among others thanks to cooperation with Java. On the other hand, RxJava has brought us many solutions to problems related to asynchronous code. If everything is so cool, do we need anything else in the Kotlin world? Is Kotlin Coroutine a competition for RxJava?
Deep dive - Concourse CI/CD and PipelinesSyed Imam
A deep dive into how Nine Publishing (formerly Fairfax media) continuously deliver and integrate new features and bug fixes into the microservices platform.
Automation Abstractions: Page Objects and BeyondTechWell
When you start writing automation for your projects, you quickly realize that you need to organize and design the code. You will write far more than “test” code; you also will write abstraction code because you want to make tests easier to read and maintain. But how do you design all this code? How do you organize and structure it? Should you use a domain specific language? Should you go keyword driven or use Gherkin? Should you use page objects with POJO or Factories? Do you create DOM level abstractions? Where do domain models fit in? Alan Richardson provides an overview of options available to you when modeling abstraction layers. Based on his experience with many approaches on real-world commercial projects, Alan helps you understand how to think about the modeling of abstraction layers. Illustrated with a number of code examples, Alan shows you a variety of approaches and discusses the pros and cons associated with each.
Object-Oriented Programming has well established design principles, such as SOLID. For many developers architecture and functional programming are at odds with each other: they don’t know how their existing tricks of the trade convert into functional design. This problem becomes worse as hybrid languages such as Scala, Java 8 and Ruby become common. I will talk about how functional programming helps you implement the SOLID principles, and how a functional mindset can actually help you achieve the holy grail of OO, encapsulation.
This document provides an agenda and overview for a two-day Drools & jBPM workshop in October in London. Day 1 will cover the tooling technology stack including GWT, Errai, Uberfire and related modules. It will also include demos of the Drools workbench. Day 2 will cover the KIE platform introduction including KIE projects and jars, and will focus on jBPM tooling including creating and deploying KIE projects, executing business processes, and REST APIs. The document notes that the tooling shown is from a snapshot version and may have some issues on Windows.
The document discusses improving craftsmanship in coding. It recommends practices like pair programming, code reviews, and following best practices. It also stresses the importance of creating a positive work environment through communication, remote work options, and social events. Finally, it provides tips for polishing an app, listening to feedback, and gracefully handling failures. The speaker emphasizes optimizing for quality over features to achieve the final steps of awesomeness.
The document discusses Android threading and how to handle long running tasks to avoid blocking the UI thread. It covers the main UI thread, how to run tasks on a background thread using Thread and Runnable, and how to update the UI from the background thread using runOnUiThread(), post(), postDelayed() and AsyncTask. AsyncTask is recommended as it handles threading for you by running background tasks on a worker thread and calling publishProgress() to update the UI on the main thread.
JVM Mechanics: When Does the JVM JIT & Deoptimize?Doug Hawkins
HotSpot promises to do the "right" thing for us by identifying our hot code and compiling "just-in-time", but how does HotSpot make those decisions?
This presentation aims to detail how HotSpot makes those decisions and how it corrects its mistakes through a series of demos that you run yourself.
Derrière ce titre putaclic se cache une réalité pour une partie de notre industrie.
Les boucles for/while sont des structures itératives proposant le plus bas niveau d'abstraction. Les langages modernes proposent encore de nos jours ces structures car elles ont leur utilité dans quelques cas exceptionnels.
Ces 10 dernières années, de nouvelles structures d'itérations sont apparues, proposant un plus haut niveau d'abstraction : donc une meilleure productivité, moins de ligne de code, donc moins de bug potentiels (que nous décrirons).
Nous partirons d'exemples de code simple et montrerons leur équivalent via ces nouvelles structures puis observerons les avantages (et inconvénients ?). Les exemples seront en JavaScript mais bien entendu applicable dans d'autres langages (Java, C#, Python, Ruby, C++, Scala, Go, Rust, ...).
Beyond Parallelize and Collect by Holden KarauSpark Summit
This document discusses testing Spark programs. It recommends using parallelize and collect for unit testing Spark code on small datasets that fit in memory. For larger datasets that do not fit in memory, it suggests using distributed set operations or RDD comparisons. The document also discusses testing streaming applications using a manual clock and test input streams. It provides examples of testing DataFrames and Datasets using equality checks. Finally, it recommends packages like spark-testing-base and sscheck for Spark testing and mentions options beyond local mode for testing.
UberFire is a web framework for building extensible workbenches and console applications that provides an Eclipse-like workbench experience for the web. It allows users to easily build rich web apps by providing a strong ecosystem of pluggable components and infrastructure. UberFire's goal is to provide a customizable workbench experience on the web for building maintainable apps. It uses techniques like hierarchical composition, menus, and life-cycle management to achieve this.
Releasing a great app is more than having a unique idea. It takes teamwork, collaboration and the will to be the best. At Novoda we make awesomeness happen. This talk is about our process from coding dojos to group design and iterative sprint planning with our customers. We'll describe some of our best practices as well as some of the components that can make a good app great.
This includes:
- Day-to-day processes: pairing tennis, gif code reviews and toggling hidden features.
- Work Environment: hack & tells, continuous communication & kicking ass at Tekken.
- Releasing the app: polishing & quantifying can get you top of the class and not listening to Google can get you expelled.
Finishing with some bonus Android coding tips and tricks and crazy AOSP anti-patterns.
Apache Airflow in the Cloud: Programmatically orchestrating workloads with Py...Kaxil Naik
Apache Airflow allows users to programmatically author, schedule, and monitor workflows or directed acyclic graphs (DAGs) using Python. It is an open-source workflow management platform developed by Airbnb that is used to orchestrate data pipelines. The document provides an overview of Airflow including what it is, its architecture, and concepts like DAGs, tasks, and operators. It also includes instructions on setting up Airflow and running tutorials on basic and dynamic workflows.
This document provides an overview of the Noir web framework for Clojure. It discusses how Noir uses a functional programming approach, encourages modularity, and is built on other components like Hiccup, Ring, and Compojure. It provides examples of how to set up a basic Noir project using Leiningen and demonstrates creating HTML representations and basic todo list applications in Noir.
The document discusses MotionLayout, a library that allows for animations and transitions between layouts in Android using ConstraintLayout. Key components of MotionLayout include MotionScene, ConstraintSet, and Transition. ConstraintSet defines start and end states, Transition defines the animation between them, and MotionScene ties it all together. Custom attributes can also be animated between states.
The document discusses MotionLayout in ConstraintLayout 2.0, which allows defining animations through ConstraintSets and transitions between them. It provides an example of a basic animation created by switching between start and end ConstraintSets defined in a MotionScene file. The animation can be triggered by a button click and handles moving a view from the left to the right of its parent layout over 1000 milliseconds.
The document discusses features from Google I/O and Android Q, including:
- Kotlin and in-app updates
- Changes in Android Q like the new navigation system, scoped storage, location permissions, settings panel actions, and dark mode
- Implementing dark theme support using DayNight and setting different themes for light and dark modes
This document summarizes a presentation on new features in Google I/O and Android Q. It discusses Kotlin, in-app updates, the new navigation system in Android Q including gestures, scoped storage, location changes, dark mode, and Jetpack improvements for security and compose. The navigation system in Android Q uses gestures for navigation rather than buttons. Developers need to account for the safe zone and can exclude areas from gestures. In-app updates allow flexible or immediate updates within an app.
The document discusses Clean Architecture and provides an example of implementing it using a Movie Night app. It describes separating the app into Presentation, Data, and Domain layers with specific responsibilities. The Domain layer contains entities, use cases, and interfaces. The Data layer encapsulates data sources and mappers. The Presentation layer connects everything using ViewModels, LiveData, and observing lifecycle changes. It demonstrates how data flows from the Data layer through UseCases to the Presentation layer and updates the UI.
This document provides information about an Android development community and courses. It includes details about course topics like fundamentals, UI/UX, and advanced topics. It lists mentors and their backgrounds. Event details are provided for courses in Moscow and a mentors program. Links are included to sign up for courses and view the community on Facebook.
The document discusses Retrofit, a type-safe HTTP client for Android. It describes how to initialize Retrofit by defining interfaces for APIs, creating a Retrofit instance, and making network calls. It also covers using interceptors to log requests/responses and add authentication headers to requests. Custom interceptors allow controlling the behavior of authentication based on internal request headers.
The document discusses threads and handlers in Android. It contains the following key points:
1. Threads allow for concurrent execution while the main thread is responsible for UI updates. Additional threads can be used for network requests and background tasks.
2. Handlers allow threads to communicate by posting messages and runnables to a message queue. This avoids direct method calls between threads.
3. The main thread has a looper by default while custom threads require adding a looper. Handlers are used to post tasks from a thread's looper queue back to the main thread for UI updates.
This document provides wifi login credentials for Samsung-Next-Guest with the password NEXT@tlv4ever. It then introduces the largest Android community in Israel and lists its staff, activities, and locations. It promotes an IDC entrepreneurship program and provides details on its structure, mentors, advisory board, and past alumni. Finally, it advertises upcoming Android advanced courses on UI, GPU, animations, clean architecture, CPU, memory, and threads.
All the support you need. Support libs in AndroidVitali Pekelis
The support library provides support for older Android versions by backporting new features and components. It includes libraries for app compatibility, fragments, cardview, recyclerview and more. The support library works by including shims that check the Android version and use the native implementation where available, or a support version as needed. It is important to use consistent support library versions and follow best practices around configuration, versioning and compatibility. The support library continues to be updated regularly with new features, bug fixes and improvements to support developers.
This document provides best practices for developing SDKs. It discusses defining the SDK's purpose and services, planning the public API with an easy to use builder pattern and exceptions, planning the internal architecture with minimal dependencies and permissions, writing code with unique prefixes and lifecycle considerations, including sample apps and documentation, packaging as an AAR file, and tools for testing like Battery Historian and Stetho.
The document provides an overview of dependency injection and how it can be implemented using Dagger2 in Android. It discusses dependency injection principles like constructor injection and how modules, components, and clients work together in Dagger2. Key points covered include defining module classes to provide dependencies, component classes to assemble modules and inject clients, and using dependency injection annotations like @Inject in client classes. The document emphasizes best practices like separating dependencies into multiple modules and avoiding direct instantiation in clients.
This document discusses an upcoming hackathon and provides an agenda for a session on design patterns. The session will cover topics like code smells, different categories of design patterns (creational, structural, behavioral), and examples from Android like the Observer pattern implemented in ViewTreeObserver and builder patterns like AlertDialog.Builder and NotificationCompat.Builder. The goals are to learn about and inspire the use of design patterns to improve code readability, writability, and communication.
The document discusses advanced Android threading concepts including:
1. The main thread is responsible for UI rendering and user interactions. Blocking it can cause app jank and ANRs.
2. Additional threads can be created using Thread or Runnable classes and started to offload work.
3. The Handler, Looper, and MessageQueue classes provide an asynchronous messaging system for communication between threads without blocking. A Looper dispatches messages that are sent via a Handler.
This document discusses best practices for designing mobile user experiences that transition between iOS and Android platforms. It emphasizes that iOS and Android have different design philosophies and patterns that must be understood. Specifically, it notes that iOS focuses on simplicity, clarity and depth while Android follows Material Design principles of bold graphics and intentional motion. Directly porting an iOS design to Android is discouraged as the two platforms have different navigation, buttons, notifications and other interface conventions. The document provides an overview of major Android design components and patterns to consider when adapting a mobile experience for both platforms.
Loaders are objects that abstract data retrieval and observation to simplify handling the activity lifecycle and data changes. CursorLoaders make it easy to access data from a content provider using a few simple steps. Loaders are initialized with a unique ID and callbacks handle the loading process, caching data between configuration changes. This prevents needing to reload data when a device rotates.
This lesson covers providing data correctly in Android applications using content providers and loaders. It discusses using SQLite databases to store structured data and querying the data using SQL statements like SELECT, UPDATE, INSERT, and DELETE. The document provides examples of creating a database table and performing CRUD operations on it. It also mentions challenges like avoiding SQL injection and handling database upgrades.
This document discusses the process of rendering views and pixels on the screen from a high level object to pixels. It covers the key steps of measure, layout, and draw and explains important concepts like double buffering, vsync, and avoiding overdraw. Key topics include how the GPU helps with rasterization, using viewtreeobserver for size changes, different root view types, and using constraint layout for a more optimized layout. It emphasizes best practices like minimizing unnecessary layout requests and using tools like hierarchy viewer and GPU profiling.
This document discusses building clean and flexible Android architecture using principles like separation of concerns, single responsibility, and dependency injection. It recommends patterns like MVVM and VIPER to separate an app's business logic from its UI framework. The key aspects are interfaces for Views, Presenters, Interactors and Repositories. Sample code shows how to implement these patterns using interfaces, dependency injection and testing. The goal is architecture that is easy to iterate on, collaborate with and test independently of Android frameworks and libraries.
This document summarizes an Android design workshop held by Britt Barak and Figure 8. The workshop covered topics like color, imagery, meaningful motion, and the Android design vision. Attendees learned about using color palettes and themes, different types of images like bitmaps and vectors, animation principles, and how to design intuitive and delightful experiences for Android users. The workshop provided practical tips and examples to help developers and designers create high-quality Android apps adhering to Material Design standards.
13. What’s On The Main Thread?
Main Thread (UI Thread)
Process
System Event Input Event Service Application UI Drawing
14. What’s On The Main Thread?
Main Thread (UI Thread)
Process
System Event UI Drawing UI Drawing UI Drawing UI Drawing
16ms 16ms 16ms
Animation
15. What’s On The Main Thread?
Main Thread (UI Thread)
Process
System
Event
UI
Drawing
Input Event
16ms 16ms 16ms
UI
Drawing
UI
Drawing
16ms 16ms
16. What’s On The Main Thread?
Main Thread (UI Thread)
Process
System
Event
UI
Drawing
Input Event
16ms 16ms 16ms
UI
Drawing
UI
Drawing
16ms 16msDropped Frame
25. Example
thread = new CustomThread();
//OR
thread = new Thread (new CustomRunnable());
thread.start();
26. Example
public class CustomThread extends Thread {
@Override
public void run() {
doWorkInBackground();
}
}
public class CustomRunnable implements Runnable {
@Override
public void run() {
doWorkInBackground();
}
}
30. How to offload task
●AsyncTask
○ Helps get work on/off the UI thread
●HandlerThread
○ Dedicated thread for API callbacks
●IntentService
○ Helps get intents off the UI thread
●ThreadPool
31. How to offload task
●AsyncTask
○ Helps get work on/off the UI thread
●HandlerThread
○ Dedicated thread for API callbacks
●IntentService
○ Helps get intents off the UI thread
●ThreadPool
38. This Would Also Work
DownloadFilesTask task = new DownloadFilesTask(URL1, URL2, URL3);
task.execute();
public class DownloadFilesTask extends AsyncTask<Void, Integer, Long> {
private URL[] urls;
public DownloadFilesTask(URL... urls) {
this.urls = urls;
}
…
}
44. Example
protected Long doInBackground(URL... urls) {
int count = urls.length;
long totalSize = 0;
for (int i = 0; i < count; i++) {
totalSize += Downloader.downloadFile(urls[i]);
publishProgress((int) ((i / (float) count) * 100));
// Escape early if cancel() is called
if (isCancelled()) break;
}
return totalSize;
}
@Override
protected void onCancelled(Long result) {
showDialog("Downloaded was cancelled after " + result + " bytes");
}
60. Loader Pattern : Loader
● Abstract class that load data asynchronously,
and monitors its data source.
Loader
Callbacks
Manager
Loader
61. Loader Pattern : Loader
● Abstract class that load data asynchronously,
and monitors its data source.
● Loader that uses AsyncTask
Loader
Async Task
Loader
Callbacks
Manager
Loader
62. Loader Pattern : Loader
● Abstract class that load data asynchronously,
and monitors its data source.
● Loader that uses AsyncTask
● AsyncTaskLoader that queries data from a
ContentProvider and returns a Cursor.
Loader
Async Task
Loader
Cursor Loader
Callbacks
Manager
Loader
66. How Does It Work?
Activity
onCreate()
Loader
Manager
initLoader()
67. How Does It Work?
Activity
onCreate()
Loader
Manager
initLoader()
Loader
Callbacks A
onCreate
Loader()
68. How Does It Work?
Loader
loadIn
Background()
Activity
onCreate()
Loader
Manager
initLoader()
Loader
Callbacks A
onCreate
Loader()
69. How Does It Work?
Loader
loadIn
Background()
Activity
onCreate()
Loader
Manager
initLoader()
Loader
Callbacks A
onCreate() initLoader()
onCreate
Loader()
70. How Does It Work?
Loader
loadIn
Background()
Activity
onCreate()
Loader
Manager
initLoader()
Loader
Callbacks A
onCreate() initLoader()
onCreate
Loader()
71. How Does It Work?
Loader
loadIn
Background()
Activity
onCreate()
onCreate()
Loader
Manager
initLoader()
initLoader()
Loader
Callbacks A
onCreate
Loader()
Loader
Callbacks B
onLoad
Finishes()
87. DemoLoader.java
@Override
public void deliverResult(Long data) {
if (isReset()) {
// The Loader has been reset; ignore the result and invalidate the data.
releaseResources(data);
return;
}
// Hold a reference to the old data so it doesn't get garbage collected.
// We must protect it until the new data has been delivered.
Long oldData = mData;
mData = data;
if (isStarted()) {
// If the Loader is in a started state, deliver the results to the client.
super.deliverResult(data);
}
// Invalidate the old data as we don't need it any more.
if (oldData != null && oldData != data) {
releaseResources(oldData);
}
}
110. By The Way...
Camera.class is deprecated on API 21
Use CameraManager.openCamera(String cameraId,
CameraDevice.StateCallback callback,
Handler handler)
111. Example
HandlerThread handlerThread = new HandlerThread(TAG);
handlerThread.start();
Handler handler = new Handler(handlerThread.getLooper()) {
@Override
public void handleMessage(Message msg) {
Camera.open();
//.....
}
};
112. Don’t forget to quit!
handlerThread.quit()
●when you are done
● Or on activities onDestroy().
123. Service Performance
●Services cost time and memory.
○ Creating, scheduling, running, and even destroying services
●Run on the UI thread
124. Make Sure You Need A Service
●Listen and respond to events
○ BroadcastReceiver (even on background)
●Poll a server for data
○ FCM / GCM
●Work detached from UI
○ Use other primitive (saves scheduling)
150. How many threads should can you create?
- Software
- Unlimited
- CPU
- Limited
- Then, prioritize & schedule
151. How many threads should can you create?
●Cores available :
Runtime.getRuntime().availableProcessors();
●Depends on system load
●<= total #cores
152. Thread Priority
- CPU can only handle few at a time
- Decides by priority
- Default : as spawning thread
- Same priority = Same chance for resources
168. 3. Start task
public class PhotoManager {
...
static public PhotoTask startDownload(PhotoView imageView, boolean cacheFlag) {
sInstance.mDownloadThreadPool.
execute(downloadTask.getDownloadRunnable());
}
169. TIP: Pre Start Threads
Threads start on execute().
When constructing the pool with a non-empty queue,
use: prestartCoreThread() or prestartAllCoreThreads()
182. How to offload task
●AsyncTask
○ Helps get work on/off the UI thread
●HandlerThread
○ Dedicated thread for API callbacks
●IntentService
○ Helps get intents off the UI thread
●ThreadPool
199. Avoid non-static inner classes
private static class CountDownHandler extends Handler {
private final WeakReference<DialogCountdown> mDialogCountdownWeakReference;
public CountDownHandler(DialogCountdown dialogCountdown) {
super();
mDialogCountdownWeakReference = new WeakReference<>(dialogCountdown);
}
public void handleMessage(Message msg) {
if(mDialogCountdownWeakReference.get()!=null) {
mDialogCountdownWeakReference.get().onCountDown();
}
}
200. 3. Don’t Cling
●Separate lifecycle from activity’s!
●When back to UI thread, View can be:
○ Removed
○ Distroyed
○ Change properties
●But task still runs and call callbacks
213. What Did We Have Today?
●AsyncTask
○ Helps get work on/off the UI thread
●Loader
○ Handle config. changes during background work
●HandlerThread
○ Dedicated thread for API callbacks
●IntentService
214. What Did We Have Today?
● Services
● Threads priority
●Memory leaks
●Back to UI thread