This document discusses creating custom views in Android. It covers default views provided by Android, reasons for creating custom views, the responsibilities of views, and how to create custom views by extending the View class and implementing key methods like onDraw(), onMeasure(), and onLayout(). It also discusses compound views, view lifecycles, defining custom attributes, and using custom views in layout files.
ConstraintLayout is a new layout supported by Google that allows creating complex layouts with flat view hierarchies using constraints. It measures and positions views during the measure-layout-draw cycle. ConstraintLayout solves performance issues of other layouts like nested weighted LinearLayouts and RelativeLayouts. It uses anchors and constraints to position views, and has tools in the visual editor to design and infer constraints. ConstraintLayout aims to create efficient UIs with scalability and flatten view hierarchies for animations.
Journey of an event, the android touch - Marco Cova, FacebookDroidConTLV
This document summarizes the journey of a touch event in an Android application. It begins at the Activity level and travels through various views and view groups as it is dispatched and handled. Key methods involved include dispatchTouchEvent(), onInterceptTouchEvent(), and onTouchEvent(). It also provides an overview of touch event types like ACTION_DOWN and ACTION_MOVE as well as techniques for handling multi-touch events and touch delegates.
This document outlines an introduction to the Android window system presented by Chia-I Wu. It covers the basic building blocks of SurfaceManager, WindowManager, and ActivityManager. It discusses concepts under the hood like process view, zygote, and binder. It also provides guidance on development tools and code areas relevant to understanding the window system.
Acrhitecture deisign pattern_MVC_MVP_MVVMDong-Ho Lee
Look over MVC, MVP, MVVM pattern in android.
and introduce android data binding library.
You can follow this with simple project.
https://github.com/withleedh/patternChat
References
https://realm.io/kr/news/eric-maxwell-mvc-mvp-and-mvvm-on-android/
This document discusses implementing Android design principles in custom views. It begins by outlining principles like "Never lose my stuff" and "Only show what I need when I need it". It then provides examples of implementing these in custom views, such as using a NavigationDrawer or animations. It discusses different types of custom views like compound views that extend existing views. The document also covers performance optimization techniques for custom views like using Canvas versus extending a ViewGroup. Finally, it suggests ideas for implementing the principle of giving "tricks that work everywhere", such as touch gestures.
1. Understanding Android Events
2. Event Listeners and Callback Methods
2.1 onClick()
2.2 onLongClick()
2.3 onFocusChange()
2.4 onKey()
2.5 onTouch()
2.6 Using a separate Listener class
2.7 Using a Named Inner Class for Event Handling
2.8 Handling Events by Having Main Activity Implement Listener Interface
2.9 Handling Events by Specifying the Event Handler Method in main.xml
2.10 Handling Events by Specifying the Event Handler Method in main.xml(cont.)
3. Exercise 5
Android graphic system (SurfaceFlinger) : Design Pattern's perspectiveBin Chen
SurfaceFlinger is a vital system service in Android system, responsible for the composting all the application and system layer and displaying them. In this slide,we looked in detail how surfaceFlinger was designed from Design Pattern's perspective.
The document provides an overview of the Android graphics subsystem and related components:
- It describes the main components of the graphics subsystem including SurfaceFlinger, Window Manager, and Activity Manager.
- It discusses graphics concepts such as surfaces, layers, and composition.
- It provides details on the use of OpenGL and hardware acceleration in Android.
- It summarizes the roles of various graphics libraries and interfaces like Skia, PixelFlinger, and Gralloc.
Android Data Binding in action using MVVM pattern - droidconUKFabio Collini
The document discusses Android Data Binding and the Model-View-ViewModel (MVVM) pattern. It covers the basics of data binding, using custom attributes with data binding, creating reusable UI components with data binding, implementing two-way data binding, and using data binding with RxJava and the MVVM pattern. The speaker presents code examples for setting up data binding in layout XML files and Java code, and binding data to views while ensuring automatic updates when the data changes.
Data Binding in Action using MVVM patternFabio Collini
The Data Binding framework was one of Google’s announcements at I/O 2015, it’s a big change in the code organization of an Android app. Some developers are sceptical about this framework but, if used in the “right way”, it’s very powerful and it allows to remove a lot of redundant boilerplate code from activities and fragments.
In this talk we’ll start from the Data Binding basic concepts and then we’ll see how to use it to improve the architecture of a typical Android application applying the Model View ViewModel pattern. Using this pattern you need to write less code to create an app that can be easily tested using JVM and instrumentation tests.
React document in traditional Chinese. Download the latest version from https://github.com/shinokada/js-framwork-docs/tree/main/pdf
Acrhitecture deisign pattern_MVC_MVP_MVVMDong-Ho Lee
Look over MVC, MVP, MVVM pattern in android.
and introduce android data binding library.
You can follow this with simple project.
https://github.com/withleedh/patternChat
References
https://realm.io/kr/news/eric-maxwell-mvc-mvp-and-mvvm-on-android/
This document discusses implementing Android design principles in custom views. It begins by outlining principles like "Never lose my stuff" and "Only show what I need when I need it". It then provides examples of implementing these in custom views, such as using a NavigationDrawer or animations. It discusses different types of custom views like compound views that extend existing views. The document also covers performance optimization techniques for custom views like using Canvas versus extending a ViewGroup. Finally, it suggests ideas for implementing the principle of giving "tricks that work everywhere", such as touch gestures.
1. Understanding Android Events
2. Event Listeners and Callback Methods
2.1 onClick()
2.2 onLongClick()
2.3 onFocusChange()
2.4 onKey()
2.5 onTouch()
2.6 Using a separate Listener class
2.7 Using a Named Inner Class for Event Handling
2.8 Handling Events by Having Main Activity Implement Listener Interface
2.9 Handling Events by Specifying the Event Handler Method in main.xml
2.10 Handling Events by Specifying the Event Handler Method in main.xml(cont.)
3. Exercise 5
Android graphic system (SurfaceFlinger) : Design Pattern's perspectiveBin Chen
SurfaceFlinger is a vital system service in Android system, responsible for the composting all the application and system layer and displaying them. In this slide,we looked in detail how surfaceFlinger was designed from Design Pattern's perspective.
The document provides an overview of the Android graphics subsystem and related components:
- It describes the main components of the graphics subsystem including SurfaceFlinger, Window Manager, and Activity Manager.
- It discusses graphics concepts such as surfaces, layers, and composition.
- It provides details on the use of OpenGL and hardware acceleration in Android.
- It summarizes the roles of various graphics libraries and interfaces like Skia, PixelFlinger, and Gralloc.
Android Data Binding in action using MVVM pattern - droidconUKFabio Collini
The document discusses Android Data Binding and the Model-View-ViewModel (MVVM) pattern. It covers the basics of data binding, using custom attributes with data binding, creating reusable UI components with data binding, implementing two-way data binding, and using data binding with RxJava and the MVVM pattern. The speaker presents code examples for setting up data binding in layout XML files and Java code, and binding data to views while ensuring automatic updates when the data changes.
Data Binding in Action using MVVM patternFabio Collini
The Data Binding framework was one of Google’s announcements at I/O 2015, it’s a big change in the code organization of an Android app. Some developers are sceptical about this framework but, if used in the “right way”, it’s very powerful and it allows to remove a lot of redundant boilerplate code from activities and fragments.
In this talk we’ll start from the Data Binding basic concepts and then we’ll see how to use it to improve the architecture of a typical Android application applying the Model View ViewModel pattern. Using this pattern you need to write less code to create an app that can be easily tested using JVM and instrumentation tests.
React document in traditional Chinese. Download the latest version from https://github.com/shinokada/js-framwork-docs/tree/main/pdf
When I learn more about Android's graphics system, and do more work about how to use CPU/GPU in more parallelized way to improve the graphics performance in Android,
I start to think that there are actually some big design mistakes in Android graphics system, especially the rendering architecture in the client side.Some mistakes have been solved after 3.x, especially above 4.1, but others can never be solved due to the compatible reason.
As developers, we need to know how the Android graphics system work, how to utilize the new features Android 3.x and 4.x provided, and how to do the optimization and overcome the shortage of Android.
Build local web server in 5 minutes with mongooserogeryi
Mongoose is a small and lightweight web server that can be built and running in just 5 minutes, supporting Windows, MacOS and Linux. It includes features like CGI, SSL, SSI and supports HTTP requests like GET, POST, HEAD, PUT and DELETE. The entire Mongoose source code is under 40kb and is written in C. It can be downloaded from the project's Google Code page at http://code.google.com/p/mongoose.
4. View This class represents the basic building block for user interface components. A View occupies a rectangular area on the screen and is responsible for drawing and event handling. View is the base class for widgets, which are used to create interactive UI components (buttons, text fields, etc.).
11. android.view.Window Abstract base class for a top-level window look and behavior policy. It provides standard UI policies such as a background, title area, default key processing, etc. 它是通常意义上我们理解的应用层面窗口, TopLevelWindow or WindowPolicy 可能是一个更合适的名字
17. ViewRootImpl The top of a view hierarchy, implementing the needed protocol between View and the WindowManager This is for the most part an internal implementation detail WindowManagerImpl
19. Cont. IWindow API back to a client window that the Window Manager uses to inform it of interesting things happening. 回调接口用于接收 WMS 关于窗口的消息 —— 显示 / 隐藏,大小改变,焦点变化等等 除了注册窗口外, ViewRootImpl 还向 WMS (通过 InputQueue )注册了一个 InputHandler 用于接收输入事件 接收到的输入事件会先放在 UI 线程的消息循环中,然后通过 ViewRootImpl 进行分派,在它对应的 View Hierachy 上路由
26. Surface Handle onto a raw buffer that is being managed by the screen compositor. 每个 Window 都有一个 Surface ,由窗口在客户端的代理者 ViewRootImpl 所拥有 Surface 在 ViewRootImpl 第一次渲染 View Hierachy 时创建 ViewRootImpl.performTraversals ViewRootImpl.relayoutWindow IWindowSession.relayout
34. SurfaceView Provides a dedicated drawing surface embedded inside of a view hierarchy. You can control the format of this surface and, if you like, its size; the SurfaceView takes care of placing the surface at the correct location on the screen The surface is Z ordered so that it is behind the window holding its SurfaceView; the SurfaceView punches a hole in its window to allow its surface to be displayed.
36. GLSurfaceView An implementation of SurfaceView that uses the dedicated surface for displaying OpenGL rendering. A GLSurfaceView provides the following features: Manages a surface, which is a special piece of memory that can be composited into the Android view system. Manages an EGL display, which enables OpenGL to render into a surface. Accepts a user-provided Renderer object that does the actual rendering. Renders on a dedicated thread to decouple rendering performance from the UI thread. Supports both on-demand and continuous rendering. Optionally wraps, traces, and/or error-checks the renderer's OpenGL calls.