The document discusses Android layouts and describes how to define user interfaces with XML. Key points:
- Layouts define the visual structure of activities and widgets using XML or code. The document focuses on XML.
- XML follows the naming of View classes/methods. Attributes map to methods.
- Layout files contain a single root ViewGroup with child views/groups.
- Activities load layouts in onCreate() with setContentView(layout).
- Views support attributes like ID, width/height. Attributes configure views and describe layout.
The document discusses Android layouts and input controls. It covers defining layouts in XML with elements like ViewGroup and View. Layout files use attributes like ID, width, and height. Common layouts include LinearLayout and RelativeLayout. Activities load layouts in onCreate() with setContentView().
Spain's relief, rivers and protected environmentspapefons Fons
Spain has a very mountainous landscape with numerous mountain ranges that make travel difficult. It has three main watersheds that drain into the Atlantic Ocean, Cantabrian Sea, and Mediterranean Sea. Spain also hosts over half of Europe's biodiversity and has many protected natural areas, including 15 national parks, that help preserve the country's rich wildlife.
Möchten Sie das Geheimnis kennenlernen...
..Wie man..
die Wechselkurse vorhersagt, wie es die Profis tun?
>>> gehen Sie auf www.forexhero.eu und holen Sie sich die beliebteste Forex Lern-App; KOSTENLOS!
Ist Ihnen aufgefallen, wie kompliziert und langweilig die meisten Lehrbücher und Lehrmaterialien über Forex sind? Uns fiel dies vor einigen Jahren auf und wir begriffen, dass ein neuer und verbesserter Ansatz erforderlich ist. So erblickte "Forex Trading in 15 Minutes" das Licht der Welt. Wir haben die am besten funktionierenden Informationen und Strategien gesammelt und gefiltert, so dass Sie in Rekordzeit mit dem Forex-Trading starten können.
Das Buch enthält zahlreiche Illustrationen und Beispiele einfach anzuwendender Strategien. Es gibt keine anderen Bücher zu Forex, die so einfach zu lesen und zu verstehen sind, wie dieses (wenn Sie eines finden, lassen Sie es uns bitte wissen!). Wenn Sie sich also Monate des Lesens von langweiligen und aufgeblähten Unterlagen ersparen wollen, dann ist dieses Buch für Sie! Dieses Buch enthält alles, von den Forex Grundlagen für Anfänger bis hin zu effektiven Strategien und Tipps von Experten für die erfahreneren Trader (Händler).
Was Sie aus diesem Buch lernen werden:
- Wovon werden Wechselkurse beeinflusst
- Die beste Zeit zum Traden/Handeln
- Wie Hebel und Lots funktionieren
- Trading Beispiele erklärt
- Wie man Diagramme liest und mehrere Zeitrahmen benutzt
- Die effektivsten Strategien: Pinocchio, die Double-Red Strategie, Breakout Strategie, die 1-2-3 Strategie und mehr
- Top 10 Experten-Tipps für den Erfolg
- Wie man den richtigen Broker auswählt
Smart home technologies a simple way to make your home connected. Control with smart hub and sensor plugs from every room. Know more about smart homes technology, Contact us at 086 0788942.
This document describes the design of a 2-digit BCD display using 7447 decoder and 7490 counter ICs. It discusses the components needed, including the 7490 counter IC that generates BCD output, and the 7447 decoder IC that drives a 7-segment display. It also provides details on how a basic 0-9 counter and a 2-digit 00-99 counter are implemented using these ICs to display the count on 7-segment LED displays. Potential applications mentioned include digital clocks and timers.
El documento proporciona una breve historia del lenguaje de programación PHP desde su creación en 1994 hasta la actualidad. Detalla algunas de las características y mejoras clave introducidas en versiones posteriores como PHP 5 y PHP 7, así como soluciones populares en PHP para tareas comunes de desarrollo web como manejo de dependencias, bases de datos, internacionalización, marcos de trabajo y pruebas.
The document discusses Android layouts and input controls. It covers defining layouts in XML with elements like ViewGroup and View. Layout files use attributes like ID, width, and height. Common layouts include LinearLayout and RelativeLayout. Activities load layouts in onCreate() with setContentView().
Spain's relief, rivers and protected environmentspapefons Fons
Spain has a very mountainous landscape with numerous mountain ranges that make travel difficult. It has three main watersheds that drain into the Atlantic Ocean, Cantabrian Sea, and Mediterranean Sea. Spain also hosts over half of Europe's biodiversity and has many protected natural areas, including 15 national parks, that help preserve the country's rich wildlife.
Möchten Sie das Geheimnis kennenlernen...
..Wie man..
die Wechselkurse vorhersagt, wie es die Profis tun?
>>> gehen Sie auf www.forexhero.eu und holen Sie sich die beliebteste Forex Lern-App; KOSTENLOS!
Ist Ihnen aufgefallen, wie kompliziert und langweilig die meisten Lehrbücher und Lehrmaterialien über Forex sind? Uns fiel dies vor einigen Jahren auf und wir begriffen, dass ein neuer und verbesserter Ansatz erforderlich ist. So erblickte "Forex Trading in 15 Minutes" das Licht der Welt. Wir haben die am besten funktionierenden Informationen und Strategien gesammelt und gefiltert, so dass Sie in Rekordzeit mit dem Forex-Trading starten können.
Das Buch enthält zahlreiche Illustrationen und Beispiele einfach anzuwendender Strategien. Es gibt keine anderen Bücher zu Forex, die so einfach zu lesen und zu verstehen sind, wie dieses (wenn Sie eines finden, lassen Sie es uns bitte wissen!). Wenn Sie sich also Monate des Lesens von langweiligen und aufgeblähten Unterlagen ersparen wollen, dann ist dieses Buch für Sie! Dieses Buch enthält alles, von den Forex Grundlagen für Anfänger bis hin zu effektiven Strategien und Tipps von Experten für die erfahreneren Trader (Händler).
Was Sie aus diesem Buch lernen werden:
- Wovon werden Wechselkurse beeinflusst
- Die beste Zeit zum Traden/Handeln
- Wie Hebel und Lots funktionieren
- Trading Beispiele erklärt
- Wie man Diagramme liest und mehrere Zeitrahmen benutzt
- Die effektivsten Strategien: Pinocchio, die Double-Red Strategie, Breakout Strategie, die 1-2-3 Strategie und mehr
- Top 10 Experten-Tipps für den Erfolg
- Wie man den richtigen Broker auswählt
Smart home technologies a simple way to make your home connected. Control with smart hub and sensor plugs from every room. Know more about smart homes technology, Contact us at 086 0788942.
This document describes the design of a 2-digit BCD display using 7447 decoder and 7490 counter ICs. It discusses the components needed, including the 7490 counter IC that generates BCD output, and the 7447 decoder IC that drives a 7-segment display. It also provides details on how a basic 0-9 counter and a 2-digit 00-99 counter are implemented using these ICs to display the count on 7-segment LED displays. Potential applications mentioned include digital clocks and timers.
El documento proporciona una breve historia del lenguaje de programación PHP desde su creación en 1994 hasta la actualidad. Detalla algunas de las características y mejoras clave introducidas en versiones posteriores como PHP 5 y PHP 7, así como soluciones populares en PHP para tareas comunes de desarrollo web como manejo de dependencias, bases de datos, internacionalización, marcos de trabajo y pruebas.
UI layouts define the structure and organization of elements in an Android activity's user interface. There are two main options for declaring layouts: in XML files or programmatically in Java code. Common layout types include LinearLayout, RelativeLayout, TableLayout, and FrameLayout. Layout files use a tree structure with attributes like ID, width, height, and weight to position child views. This allows separation of UI design from activity code.
Ralph Schindler gives an overview of extending the Zend Framework tool Zend_Tool. He describes Zend_Tool's purpose for rapid application development of Zend Framework projects. The talk outlines Zend_Tool's architecture including the Zend_Tool_Framework component for dispatching tool requests and the Zend_Tool_Project component for exposing project-specific capabilities. Schindler discusses various extension points for Zend_Tool like implementing providers, metadata, and interactivity. He provides examples of extending Zend_Tool to load profiles, create resources, and regenerate code.
Ralph Schindler presents on extending the Zend Framework tool Zend_Tool. He begins with an introduction and overview of Zend_Tool. He then discusses the system architecture including the main components of Zend_Tool_Framework and Zend_Tool_Project. He outlines the various extension points and provides guidance on building a basic provider as a starting point for learning to extend Zend_Tool.
The document discusses Android application development. It covers setting up an Android development environment with Android Studio and the Android SDK. It provides an overview of the Android platform, including the Android runtime, anatomy of an Android app with components like activities, services, and content providers. It also discusses Android UI fundamentals, resources, building UIs with layouts and views, and concludes with a question and answer section.
Data Transfer between Activities & DatabasesMuhammad Sajid
The document discusses content providers in Android. It describes content providers as a central repository that stores application data and makes it available to other applications. Content providers can store data in SQLite databases, files, or over a network. The ContentResolver class is used to access data from content providers using content URIs. Content providers receive data requests from clients, perform actions like create, update, delete, retrieve, and return results.
The document provides an overview of Android user interface components. It discusses that an Activity contains screens composed of components or screen containers called View Groups or Layouts. Layouts define the arrangement of components. There are six main types of Layouts: LinearLayout, RelativeLayout, TableLayout, FrameLayout, AbsoluteLayout, and GridLayout. It also describes Views, ViewGroups, and how components are specified in XML layout files or programmatically.
Android Studio is the official IDE for Android development. It is based on IntelliJ IDEA and incorporates code editing, debugging and developer tools. The software was first released in 2013 and replaced Eclipse ADT as the primary IDE. Android Studio supports application development on Android through features like a Gradle-based build system, emulator, code templates and GitHub integration. It also includes tools to write code, test apps, compile APKs and submit apps to the Google Play Store. The manifest file declares app components, permissions, SDK version and other metadata to the OS and Play Store. Resources like images, strings and fonts are stored in directories under res.
The document discusses Android application architecture and covers key topics like:
- The AndroidManifest.xml file describes an app's components and required permissions.
- Resources like strings, colors and layouts are defined in res/ and referenced via R.java.
- Activities have lifecycles controlled by the OS via callback methods like onCreate() and onPause().
- Layouts define an activity's UI using XML views and view groups.
- The Context class provides access to system services and global app information.
The document discusses building a consistent user experience across Android devices by leveraging XML resources, styles, themes, and layouts that adapt to different screen sizes. It emphasizes using density-independent pixels (dp) and scale-independent pixels (sp), providing alternate resources for different configurations using qualifiers, and employing the Android support libraries to ensure backwards compatibility. The document also recommends evaluating open source libraries to implement Material Design components not fully supported by the official libraries and frameworks.
The document provides an overview of the Aura framework:
- Aura is Salesforce's framework for building UI components that are reusable, high performing, and support events. It allows for faster development through out-of-box components.
- Components are the building blocks of Aura apps and can encapsulate HTML, CSS, JavaScript and other code. They represent reusable sections of the UI.
- Aura uses an event-driven programming model where components can fire and handle events to respond to user interactions.
This document discusses using Vue.js for front-end development with Drupal 8. It begins with introductions and then discusses various ways to create REST APIs with Drupal 8 including using core REST resources, Views REST exports, and creating custom REST resources. It then covers Vue.js fundamentals like components, data binding, and routing. Examples are provided of setting up a Vue.js project that interacts with a Drupal REST API to display content. Useful links are also included at the end.
The document discusses user interface (UI) elements and controls in Android and iOS. It provides overviews of common UI elements like buttons, text fields, and layouts in both platforms. For Android specifically, it covers view objects, XML layouts, and getting input from controls. For iOS, it discusses the UIControl class, configuring controls, auto layout, and content for different controls like text fields and buttons.
En los últimos años vimos grandes cambios en Android.
Empezando por Android Studio, dejando de lado Eclipse e incorporando Gradle. Luego el lanzamiento de Android 5 Lollipop, presentando el concepto de Material Design y por último, la incorporación de Android Wear, Auto y TV.
Son muchos cambios en poco tiempo, es por eso que necesitamos mejorar el proceso de desarrollo, incorporando las últimas tecnologías pero sin descuidar la calidad del producto.
En esta charla veremos algunas buenas prácticas para asegurar una aplicación de gran calidad.
Ng Sydney Dynamic Templates Talk - 18 April 2018Roger Kermode
Walk through of two blog posts by Max Ng Wizard on how the various references are used in Angular to create dynamic components, plus some examples of where these techniques are applicable.
This document discusses building a mobile app using Xamarin Forms and integrating it with Firebase services. It covers setting up authentication with Twitter and Google using OAuth, storing user data in the Firebase Realtime Database, and considerations for cross-platform development. Code samples demonstrate initializing Firebase, handling login flows, and using custom page renderers. Challenges included ensuring compatibility between components and troubleshooting emulator issues. Resources are provided to get started with Xamarin, Firebase, and implementing social login.
.NET Fest 2019. Halil Ibrahim Kalkan. Implementing Domain Driven DesignNETFest
“Domain Driven Design is an approach to software development for complex needs by connecting the implementation to an evolving model.”
While there are many resources on the web about the DDD, they are generally theoretical rather than useful practical guides. One reason is that a DDD implementation quite varies depending on your domain and culture. However, it is still possible to provide some explicit rules those can help you while designing your code base.
This talk starts by introducing the DDD and providing a layering model based on the DDD and the Clean Architecture. It then introduces the core building of an application built on the DDD principles.
In the second part of the talk, it shows some strict coding rules for the core building blocks with real code examples and suggestions. These rules are essential to build a large scale application implements DDD patterns & practices.
While the solution structure and code samples are based on .NET and C#, the talk is useful for developers and architects working with any server side technology.
The document discusses the problems with tightly coupling application configuration to the deployment process in traditional Puppet-driven deployments. It proposes using inline templates to decouple configuration from Puppet masters and version control systems. This would allow configuration values to be provided securely at deployment time rather than being exposed. The benefits are said to include embracing CI/CD processes, reducing complexity, opportunities for error, and meeting security and policy requirements by separating sensitive values.
"Frontline Battles with DDoS: Best practices and Lessons Learned", Igor IvaniukFwdays
At this talk we will discuss DDoS protection tools and best practices, discuss network architectures and what AWS has to offer. Also, we will look into one of the largest DDoS attacks on Ukrainian infrastructure that happened in February 2022. We'll see, what techniques helped to keep the web resources available for Ukrainians and how AWS improved DDoS protection for all customers based on Ukraine experience
Fueling AI with Great Data with Airbyte WebinarZilliz
This talk will focus on how to collect data from a variety of sources, leveraging this data for RAG and other GenAI use cases, and finally charting your course to productionalization.
UI layouts define the structure and organization of elements in an Android activity's user interface. There are two main options for declaring layouts: in XML files or programmatically in Java code. Common layout types include LinearLayout, RelativeLayout, TableLayout, and FrameLayout. Layout files use a tree structure with attributes like ID, width, height, and weight to position child views. This allows separation of UI design from activity code.
Ralph Schindler gives an overview of extending the Zend Framework tool Zend_Tool. He describes Zend_Tool's purpose for rapid application development of Zend Framework projects. The talk outlines Zend_Tool's architecture including the Zend_Tool_Framework component for dispatching tool requests and the Zend_Tool_Project component for exposing project-specific capabilities. Schindler discusses various extension points for Zend_Tool like implementing providers, metadata, and interactivity. He provides examples of extending Zend_Tool to load profiles, create resources, and regenerate code.
Ralph Schindler presents on extending the Zend Framework tool Zend_Tool. He begins with an introduction and overview of Zend_Tool. He then discusses the system architecture including the main components of Zend_Tool_Framework and Zend_Tool_Project. He outlines the various extension points and provides guidance on building a basic provider as a starting point for learning to extend Zend_Tool.
The document discusses Android application development. It covers setting up an Android development environment with Android Studio and the Android SDK. It provides an overview of the Android platform, including the Android runtime, anatomy of an Android app with components like activities, services, and content providers. It also discusses Android UI fundamentals, resources, building UIs with layouts and views, and concludes with a question and answer section.
Data Transfer between Activities & DatabasesMuhammad Sajid
The document discusses content providers in Android. It describes content providers as a central repository that stores application data and makes it available to other applications. Content providers can store data in SQLite databases, files, or over a network. The ContentResolver class is used to access data from content providers using content URIs. Content providers receive data requests from clients, perform actions like create, update, delete, retrieve, and return results.
The document provides an overview of Android user interface components. It discusses that an Activity contains screens composed of components or screen containers called View Groups or Layouts. Layouts define the arrangement of components. There are six main types of Layouts: LinearLayout, RelativeLayout, TableLayout, FrameLayout, AbsoluteLayout, and GridLayout. It also describes Views, ViewGroups, and how components are specified in XML layout files or programmatically.
Android Studio is the official IDE for Android development. It is based on IntelliJ IDEA and incorporates code editing, debugging and developer tools. The software was first released in 2013 and replaced Eclipse ADT as the primary IDE. Android Studio supports application development on Android through features like a Gradle-based build system, emulator, code templates and GitHub integration. It also includes tools to write code, test apps, compile APKs and submit apps to the Google Play Store. The manifest file declares app components, permissions, SDK version and other metadata to the OS and Play Store. Resources like images, strings and fonts are stored in directories under res.
The document discusses Android application architecture and covers key topics like:
- The AndroidManifest.xml file describes an app's components and required permissions.
- Resources like strings, colors and layouts are defined in res/ and referenced via R.java.
- Activities have lifecycles controlled by the OS via callback methods like onCreate() and onPause().
- Layouts define an activity's UI using XML views and view groups.
- The Context class provides access to system services and global app information.
The document discusses building a consistent user experience across Android devices by leveraging XML resources, styles, themes, and layouts that adapt to different screen sizes. It emphasizes using density-independent pixels (dp) and scale-independent pixels (sp), providing alternate resources for different configurations using qualifiers, and employing the Android support libraries to ensure backwards compatibility. The document also recommends evaluating open source libraries to implement Material Design components not fully supported by the official libraries and frameworks.
The document provides an overview of the Aura framework:
- Aura is Salesforce's framework for building UI components that are reusable, high performing, and support events. It allows for faster development through out-of-box components.
- Components are the building blocks of Aura apps and can encapsulate HTML, CSS, JavaScript and other code. They represent reusable sections of the UI.
- Aura uses an event-driven programming model where components can fire and handle events to respond to user interactions.
This document discusses using Vue.js for front-end development with Drupal 8. It begins with introductions and then discusses various ways to create REST APIs with Drupal 8 including using core REST resources, Views REST exports, and creating custom REST resources. It then covers Vue.js fundamentals like components, data binding, and routing. Examples are provided of setting up a Vue.js project that interacts with a Drupal REST API to display content. Useful links are also included at the end.
The document discusses user interface (UI) elements and controls in Android and iOS. It provides overviews of common UI elements like buttons, text fields, and layouts in both platforms. For Android specifically, it covers view objects, XML layouts, and getting input from controls. For iOS, it discusses the UIControl class, configuring controls, auto layout, and content for different controls like text fields and buttons.
En los últimos años vimos grandes cambios en Android.
Empezando por Android Studio, dejando de lado Eclipse e incorporando Gradle. Luego el lanzamiento de Android 5 Lollipop, presentando el concepto de Material Design y por último, la incorporación de Android Wear, Auto y TV.
Son muchos cambios en poco tiempo, es por eso que necesitamos mejorar el proceso de desarrollo, incorporando las últimas tecnologías pero sin descuidar la calidad del producto.
En esta charla veremos algunas buenas prácticas para asegurar una aplicación de gran calidad.
Ng Sydney Dynamic Templates Talk - 18 April 2018Roger Kermode
Walk through of two blog posts by Max Ng Wizard on how the various references are used in Angular to create dynamic components, plus some examples of where these techniques are applicable.
This document discusses building a mobile app using Xamarin Forms and integrating it with Firebase services. It covers setting up authentication with Twitter and Google using OAuth, storing user data in the Firebase Realtime Database, and considerations for cross-platform development. Code samples demonstrate initializing Firebase, handling login flows, and using custom page renderers. Challenges included ensuring compatibility between components and troubleshooting emulator issues. Resources are provided to get started with Xamarin, Firebase, and implementing social login.
.NET Fest 2019. Halil Ibrahim Kalkan. Implementing Domain Driven DesignNETFest
“Domain Driven Design is an approach to software development for complex needs by connecting the implementation to an evolving model.”
While there are many resources on the web about the DDD, they are generally theoretical rather than useful practical guides. One reason is that a DDD implementation quite varies depending on your domain and culture. However, it is still possible to provide some explicit rules those can help you while designing your code base.
This talk starts by introducing the DDD and providing a layering model based on the DDD and the Clean Architecture. It then introduces the core building of an application built on the DDD principles.
In the second part of the talk, it shows some strict coding rules for the core building blocks with real code examples and suggestions. These rules are essential to build a large scale application implements DDD patterns & practices.
While the solution structure and code samples are based on .NET and C#, the talk is useful for developers and architects working with any server side technology.
The document discusses the problems with tightly coupling application configuration to the deployment process in traditional Puppet-driven deployments. It proposes using inline templates to decouple configuration from Puppet masters and version control systems. This would allow configuration values to be provided securely at deployment time rather than being exposed. The benefits are said to include embracing CI/CD processes, reducing complexity, opportunities for error, and meeting security and policy requirements by separating sensitive values.
"Frontline Battles with DDoS: Best practices and Lessons Learned", Igor IvaniukFwdays
At this talk we will discuss DDoS protection tools and best practices, discuss network architectures and what AWS has to offer. Also, we will look into one of the largest DDoS attacks on Ukrainian infrastructure that happened in February 2022. We'll see, what techniques helped to keep the web resources available for Ukrainians and how AWS improved DDoS protection for all customers based on Ukraine experience
Fueling AI with Great Data with Airbyte WebinarZilliz
This talk will focus on how to collect data from a variety of sources, leveraging this data for RAG and other GenAI use cases, and finally charting your course to productionalization.
For the full video of this presentation, please visit: https://www.edge-ai-vision.com/2024/06/temporal-event-neural-networks-a-more-efficient-alternative-to-the-transformer-a-presentation-from-brainchip/
Chris Jones, Director of Product Management at BrainChip , presents the “Temporal Event Neural Networks: A More Efficient Alternative to the Transformer” tutorial at the May 2024 Embedded Vision Summit.
The expansion of AI services necessitates enhanced computational capabilities on edge devices. Temporal Event Neural Networks (TENNs), developed by BrainChip, represent a novel and highly efficient state-space network. TENNs demonstrate exceptional proficiency in handling multi-dimensional streaming data, facilitating advancements in object detection, action recognition, speech enhancement and language model/sequence generation. Through the utilization of polynomial-based continuous convolutions, TENNs streamline models, expedite training processes and significantly diminish memory requirements, achieving notable reductions of up to 50x in parameters and 5,000x in energy consumption compared to prevailing methodologies like transformers.
Integration with BrainChip’s Akida neuromorphic hardware IP further enhances TENNs’ capabilities, enabling the realization of highly capable, portable and passively cooled edge devices. This presentation delves into the technical innovations underlying TENNs, presents real-world benchmarks, and elucidates how this cutting-edge approach is positioned to revolutionize edge AI across diverse applications.
Your One-Stop Shop for Python Success: Top 10 US Python Development Providersakankshawande
Simplify your search for a reliable Python development partner! This list presents the top 10 trusted US providers offering comprehensive Python development services, ensuring your project's success from conception to completion.
Main news related to the CCS TSI 2023 (2023/1695)Jakub Marek
An English 🇬🇧 translation of a presentation to the speech I gave about the main changes brought by CCS TSI 2023 at the biggest Czech conference on Communications and signalling systems on Railways, which was held in Clarion Hotel Olomouc from 7th to 9th November 2023 (konferenceszt.cz). Attended by around 500 participants and 200 on-line followers.
The original Czech 🇨🇿 version of the presentation can be found here: https://www.slideshare.net/slideshow/hlavni-novinky-souvisejici-s-ccs-tsi-2023-2023-1695/269688092 .
The videorecording (in Czech) from the presentation is available here: https://youtu.be/WzjJWm4IyPk?si=SImb06tuXGb30BEH .
Essentials of Automations: Exploring Attributes & Automation ParametersSafe Software
Building automations in FME Flow can save time, money, and help businesses scale by eliminating data silos and providing data to stakeholders in real-time. One essential component to orchestrating complex automations is the use of attributes & automation parameters (both formerly known as “keys”). In fact, it’s unlikely you’ll ever build an Automation without using these components, but what exactly are they?
Attributes & automation parameters enable the automation author to pass data values from one automation component to the next. During this webinar, our FME Flow Specialists will cover leveraging the three types of these output attributes & parameters in FME Flow: Event, Custom, and Automation. As a bonus, they’ll also be making use of the Split-Merge Block functionality.
You’ll leave this webinar with a better understanding of how to maximize the potential of automations by making use of attributes & automation parameters, with the ultimate goal of setting your enterprise integration workflows up on autopilot.
Monitoring and Managing Anomaly Detection on OpenShift.pdfTosin Akinosho
Monitoring and Managing Anomaly Detection on OpenShift
Overview
Dive into the world of anomaly detection on edge devices with our comprehensive hands-on tutorial. This SlideShare presentation will guide you through the entire process, from data collection and model training to edge deployment and real-time monitoring. Perfect for those looking to implement robust anomaly detection systems on resource-constrained IoT/edge devices.
Key Topics Covered
1. Introduction to Anomaly Detection
- Understand the fundamentals of anomaly detection and its importance in identifying unusual behavior or failures in systems.
2. Understanding Edge (IoT)
- Learn about edge computing and IoT, and how they enable real-time data processing and decision-making at the source.
3. What is ArgoCD?
- Discover ArgoCD, a declarative, GitOps continuous delivery tool for Kubernetes, and its role in deploying applications on edge devices.
4. Deployment Using ArgoCD for Edge Devices
- Step-by-step guide on deploying anomaly detection models on edge devices using ArgoCD.
5. Introduction to Apache Kafka and S3
- Explore Apache Kafka for real-time data streaming and Amazon S3 for scalable storage solutions.
6. Viewing Kafka Messages in the Data Lake
- Learn how to view and analyze Kafka messages stored in a data lake for better insights.
7. What is Prometheus?
- Get to know Prometheus, an open-source monitoring and alerting toolkit, and its application in monitoring edge devices.
8. Monitoring Application Metrics with Prometheus
- Detailed instructions on setting up Prometheus to monitor the performance and health of your anomaly detection system.
9. What is Camel K?
- Introduction to Camel K, a lightweight integration framework built on Apache Camel, designed for Kubernetes.
10. Configuring Camel K Integrations for Data Pipelines
- Learn how to configure Camel K for seamless data pipeline integrations in your anomaly detection workflow.
11. What is a Jupyter Notebook?
- Overview of Jupyter Notebooks, an open-source web application for creating and sharing documents with live code, equations, visualizations, and narrative text.
12. Jupyter Notebooks with Code Examples
- Hands-on examples and code snippets in Jupyter Notebooks to help you implement and test anomaly detection models.
Ivanti’s Patch Tuesday breakdown goes beyond patching your applications and brings you the intelligence and guidance needed to prioritize where to focus your attention first. Catch early analysis on our Ivanti blog, then join industry expert Chris Goettl for the Patch Tuesday Webinar Event. There we’ll do a deep dive into each of the bulletins and give guidance on the risks associated with the newly-identified vulnerabilities.
HCL Notes und Domino Lizenzkostenreduzierung in der Welt von DLAUpanagenda
Webinar Recording: https://www.panagenda.com/webinars/hcl-notes-und-domino-lizenzkostenreduzierung-in-der-welt-von-dlau/
DLAU und die Lizenzen nach dem CCB- und CCX-Modell sind für viele in der HCL-Community seit letztem Jahr ein heißes Thema. Als Notes- oder Domino-Kunde haben Sie vielleicht mit unerwartet hohen Benutzerzahlen und Lizenzgebühren zu kämpfen. Sie fragen sich vielleicht, wie diese neue Art der Lizenzierung funktioniert und welchen Nutzen sie Ihnen bringt. Vor allem wollen Sie sicherlich Ihr Budget einhalten und Kosten sparen, wo immer möglich. Das verstehen wir und wir möchten Ihnen dabei helfen!
Wir erklären Ihnen, wie Sie häufige Konfigurationsprobleme lösen können, die dazu führen können, dass mehr Benutzer gezählt werden als nötig, und wie Sie überflüssige oder ungenutzte Konten identifizieren und entfernen können, um Geld zu sparen. Es gibt auch einige Ansätze, die zu unnötigen Ausgaben führen können, z. B. wenn ein Personendokument anstelle eines Mail-Ins für geteilte Mailboxen verwendet wird. Wir zeigen Ihnen solche Fälle und deren Lösungen. Und natürlich erklären wir Ihnen das neue Lizenzmodell.
Nehmen Sie an diesem Webinar teil, bei dem HCL-Ambassador Marc Thomas und Gastredner Franz Walder Ihnen diese neue Welt näherbringen. Es vermittelt Ihnen die Tools und das Know-how, um den Überblick zu bewahren. Sie werden in der Lage sein, Ihre Kosten durch eine optimierte Domino-Konfiguration zu reduzieren und auch in Zukunft gering zu halten.
Diese Themen werden behandelt
- Reduzierung der Lizenzkosten durch Auffinden und Beheben von Fehlkonfigurationen und überflüssigen Konten
- Wie funktionieren CCB- und CCX-Lizenzen wirklich?
- Verstehen des DLAU-Tools und wie man es am besten nutzt
- Tipps für häufige Problembereiche, wie z. B. Team-Postfächer, Funktions-/Testbenutzer usw.
- Praxisbeispiele und Best Practices zum sofortigen Umsetzen
How to Interpret Trends in the Kalyan Rajdhani Mix Chart.pdfChart Kalyan
A Mix Chart displays historical data of numbers in a graphical or tabular form. The Kalyan Rajdhani Mix Chart specifically shows the results of a sequence of numbers over different periods.
Digital Banking in the Cloud: How Citizens Bank Unlocked Their MainframePrecisely
Inconsistent user experience and siloed data, high costs, and changing customer expectations – Citizens Bank was experiencing these challenges while it was attempting to deliver a superior digital banking experience for its clients. Its core banking applications run on the mainframe and Citizens was using legacy utilities to get the critical mainframe data to feed customer-facing channels, like call centers, web, and mobile. Ultimately, this led to higher operating costs (MIPS), delayed response times, and longer time to market.
Ever-changing customer expectations demand more modern digital experiences, and the bank needed to find a solution that could provide real-time data to its customer channels with low latency and operating costs. Join this session to learn how Citizens is leveraging Precisely to replicate mainframe data to its customer channels and deliver on their “modern digital bank” experiences.
Introduction of Cybersecurity with OSS at Code Europe 2024Hiroshi SHIBATA
I develop the Ruby programming language, RubyGems, and Bundler, which are package managers for Ruby. Today, I will introduce how to enhance the security of your application using open-source software (OSS) examples from Ruby and RubyGems.
The first topic is CVE (Common Vulnerabilities and Exposures). I have published CVEs many times. But what exactly is a CVE? I'll provide a basic understanding of CVEs and explain how to detect and handle vulnerabilities in OSS.
Next, let's discuss package managers. Package managers play a critical role in the OSS ecosystem. I'll explain how to manage library dependencies in your application.
I'll share insights into how the Ruby and RubyGems core team works to keep our ecosystem safe. By the end of this talk, you'll have a better understanding of how to safeguard your code.
HCL Notes and Domino License Cost Reduction in the World of DLAUpanagenda
Webinar Recording: https://www.panagenda.com/webinars/hcl-notes-and-domino-license-cost-reduction-in-the-world-of-dlau/
The introduction of DLAU and the CCB & CCX licensing model caused quite a stir in the HCL community. As a Notes and Domino customer, you may have faced challenges with unexpected user counts and license costs. You probably have questions on how this new licensing approach works and how to benefit from it. Most importantly, you likely have budget constraints and want to save money where possible. Don’t worry, we can help with all of this!
We’ll show you how to fix common misconfigurations that cause higher-than-expected user counts, and how to identify accounts which you can deactivate to save money. There are also frequent patterns that can cause unnecessary cost, like using a person document instead of a mail-in for shared mailboxes. We’ll provide examples and solutions for those as well. And naturally we’ll explain the new licensing model.
Join HCL Ambassador Marc Thomas in this webinar with a special guest appearance from Franz Walder. It will give you the tools and know-how to stay on top of what is going on with Domino licensing. You will be able lower your cost through an optimized configuration and keep it low going forward.
These topics will be covered
- Reducing license cost by finding and fixing misconfigurations and superfluous accounts
- How do CCB and CCX licenses really work?
- Understanding the DLAU tool and how to best utilize it
- Tips for common problem areas, like team mailboxes, functional/test users, etc
- Practical examples and best practices to implement right away
3. Content
• These are the sections in this unit:
• Introduction
• Layouts (Taken from Resources Section of
Tutorials)
• Layouts (Taken from Layouts Section of
Tutorials)
• Linear Layout
• Relative Layout
• List View
• Grid View
3Vibrant Technology & Computers
5. • As usual, the decision to present this material at
this point is based partially on background ideas
found in the book
• The contents of the overheads consist largely of
material taken from the online tutorials, with
occasional commentary by me
• The commentary will either be introduced as
commentary or appear in square brackets
• If not set off in this way, the content is taken from
the tutorials
5Vibrant Technology & Computers
6. • As mentioned before, what you’re getting is
an idiosyncratic path through some of the
various topics covered in the tutorials
• The goal is to cover enough of the items
involved in sufficient depth so that the
perceptive learner could pick up more when
needed
6Vibrant Technology & Computers
7. Layouts (Taken from Resources Section
of Tutorials)
7Vibrant Technology & Computers
8. • Layout Resource
• A layout resource defines the architecture for the UI in
an Activity or a component of a UI.
• file location:
• res/layout/filename.xml
• The filename will be used as the resource ID.
• compiled resource datatype:
• Resource pointer to a View (or subclass) resource.
• resource reference:
• In Java: R.layout.filename
• In XML: @[package:]layout/filename
8Vibrant Technology & Computers
9. • Note:
• The root element can be either a ViewGroup,
a View, or a <merge> element, but there must
be only one root element and it must contain
the xmlns:android attribute with the android
namespace as shown.
9Vibrant Technology & Computers
10. • elements:
• <ViewGroup>
• A container for other View elements.
• There are many different kinds of ViewGroup
objects and each one lets you specify the layout
of the child elements in different ways.
• Different kinds of ViewGroup objects include
LinearLayout, RelativeLayout, and FrameLayout.
• You should not assume that any derivation of
ViewGroup will accept nested Views.
10Vibrant Technology & Computers
11. • Some ViewGroups are implementations of the
AdapterView class, which determines its
children only from an Adapter.
• [This is not the same as an adapter class in the
Java API.
• It has more in common with the adapter
design pattern of CSCE 202.
• More information will be given later in this
unit.]
11Vibrant Technology & Computers
12. • attributes:
• android:id
• Resource ID.
• A unique resource name for the element,
which you can use to obtain a reference to the
ViewGroup from your application.
• See more about the value for android:id
below.
12Vibrant Technology & Computers
13. • android:layout_height
• Dimension or keyword. Required.
• The height for the group, as a dimension value
(or dimension resource) or a keyword
("fill_parent" or "wrap_content").
• See the valid values below.
13Vibrant Technology & Computers
14. • android:layout_width
• Dimension or keyword. Required.
• The width for the group, as a dimension value
(or dimension resource) or a keyword
("fill_parent" or "wrap_content").
• See the valid values below.
14Vibrant Technology & Computers
15. • More attributes are supported by the
ViewGroup base class, and many more are
supported by each implementation of
ViewGroup.
• For a reference of all available attributes, see
the corresponding reference documentation
for the ViewGroup class (for example, the
LinearLayout XML attributes).
15Vibrant Technology & Computers
16. • <View>
• An individual UI component, generally referred to as a
"widget".
• Different kinds of View objects include TextView, Button,
and CheckBox.
• attributes:
• android:id
• Resource ID.
• A unique resource name for the element, which you can
use to obtain a reference to the View from your application.
• See more about the value for android:id below.
16Vibrant Technology & Computers
17. • android:layout_height
• Dimension or keyword. Required.
• The height for the element, as a dimension
value (or dimension resource) or a keyword
("fill_parent" or "wrap_content").
• See the valid values below.
17Vibrant Technology & Computers
18. • android:layout_width
• Dimension or keyword. Required.
• The width for the element, as a dimension
value (or dimension resource) or a keyword
("fill_parent" or "wrap_content").
• See the valid values below.
18Vibrant Technology & Computers
19. • More attributes are supported by the View
base class, and many more are supported by
each implementation of View.
• Read Layouts for more information.
• For a reference of all available attributes, see
the corresponding reference documentation
(for example, the TextView XML attributes).
19Vibrant Technology & Computers
20. • <requestFocus>
• Any element representing a View object can
include this empty element, which gives its
parent initial focus on the screen.
• You can have only one of these elements per
file.
20Vibrant Technology & Computers
21. • <include>
• Includes a layout file into this layout.
• attributes:
• layout
• Layout resource. Required.
• Reference to a layout resource.
21Vibrant Technology & Computers
22. • android:id
• Resource ID.
• Overrides the ID given to the root view in the
included layout.
• android:layout_height
• Dimension or keyword.
• Overrides the height given to the root view in the
included layout.
• Only effective if android:layout_width is also
declared.
22Vibrant Technology & Computers
23. • android:layout_width
• Dimension or keyword.
• Overrides the width given to the root view in the
included layout.
• Only effective if android:layout_height is also
declared.
• You can include any other layout attributes in the
<include> that are supported by the root element
in the included layout and they will override
those defined in the root element.
23Vibrant Technology & Computers
24. • Caution:
• If you want to override layout attributes using
the <include> tag, you must override both
android:layout_height and
android:layout_width in order for other layout
attributes to take effect.
24Vibrant Technology & Computers
25. • Another way to include a layout is to use
ViewStub.
• It is a lightweight View that consumes no
layout space until you explicitly inflate it, at
which point, it includes a layout file defined by
its android:layout attribute.
• For more information about using ViewStub,
read Loading Views On Demand.
25Vibrant Technology & Computers
26. • <merge>
• An alternative root element that is not drawn in the
layout hierarchy.
• Using this as the root element is useful when you know
that this layout will be placed into a layout that already
contains the appropriate parent View to contain the
children of the <merge> element.
• This is particularly useful when you plan to include this
layout in another layout file using <include> and this
layout doesn't require a different ViewGroup container.
• For more information about merging layouts, read Re-
using Layouts with <include/>.
26Vibrant Technology & Computers
27. • Value for android:id
• For the ID value, you should usually use this
syntax form: "@+id/name".
• The plus symbol, +, indicates that this is a new
resource ID and the aapt tool will create a new
resource integer in the R.java class, if it
doesn't already exist. For example:
• <TextView android:id="@+id/nameTextbox"/>
27Vibrant Technology & Computers
28. • The nameTextbox name is now a resource ID
attached to this element.
• You can then refer to the TextView to which the
ID is associated in Java:
• findViewById(R.id.nameTextbox);
• This code returns the TextView object.
• However, if you have already defined an ID
resource (and it is not already used), then you
can apply that ID to a View element by excluding
the plus symbol in the android:id value.
28Vibrant Technology & Computers
29. • Value for android:layout_height and
android:layout_width:
• The height and width value can be expressed
using any of the dimension units supported by
Android (px, dp, sp, pt, in, mm) or with the
following keywords:
29Vibrant Technology & Computers
30. Value Description
match_parent
Sets the dimension to match that of the
parent element. Added in API Level 8 to
deprecate fill_parent.
fill_parent
Sets the dimension to match that of the
parent element.
wrap_content
Sets the dimension only to the size
required to fit the content of this
element.
30Vibrant Technology & Computers
31. • Custom View elements
• You can create your own custom View and
ViewGroup elements and apply them to your
layout the same as a standard layout element.
• You can also specify the attributes supported
in the XML element.
• To learn more, see the Custom Components
developer guide.
31Vibrant Technology & Computers
32. • example:
• XML file saved at res/layout/main_activity.xml: <?xml
version="1.0" encoding="utf-8"?>
<LinearLayout
xmlns:android="http://schemas.android.com/apk/res/androi
d"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:orientation="vertical" >
<TextView android:id="@+id/text"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Hello, I am a TextView" />
<Button android:id="@+id/button"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Hello, I am a Button" />
</LinearLayout>
32Vibrant Technology & Computers
33. • This application code will load the layout for an
Activity, in the onCreate() method:
• public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.main_activity);
}
• [Read it again for the second time…
• The point is that the onCreate() method starts with a
setContentView() call.
• This is what connects a Java app file to its layout file.]
33Vibrant Technology & Computers
34. 8.3 Layouts (Taken from Layouts
Section of Tutorials)
34Vibrant Technology & Computers
35. • Layouts
• A layout defines the visual structure for a user
interface, such as the UI for an activity or app
widget.
• You can declare a layout in two ways:
• [1] Declare UI elements in XML.
• Android provides a straightforward XML
vocabulary that corresponds to the View classes
and subclasses, such as those for widgets and
layouts.
35Vibrant Technology & Computers
36. • [2] Instantiate layout elements at runtime.
• Your application can create View and
ViewGroup objects (and manipulate their
properties) programmatically.
36Vibrant Technology & Computers
37. • The Android framework gives you the flexibility to
use either or both of these methods for declaring
and managing your application's UI.
• For example, you could declare your application's
default layouts in XML, including the screen
elements that will appear in them and their
properties.
• You could then add code in your application that
would modify the state of the screen objects,
including those declared in XML, at run time.
37Vibrant Technology & Computers
38. • The advantage to declaring your UI in XML is
that it enables you to better separate the
presentation of your application from the
code that controls its behavior.
• Your UI descriptions are external to your
application code, which means that you can
modify or adapt it without having to modify
your source code and recompile.
38Vibrant Technology & Computers
39. • For example, you can create XML layouts for
different screen orientations, different device
screen sizes, and different languages.
• Additionally, declaring the layout in XML
makes it easier to visualize the structure of
your UI, so it's easier to debug problems.
• As such, this document focuses on teaching
you how to declare your layout in XML.
39Vibrant Technology & Computers
40. • If you're interested in instantiating View
objects at runtime, refer to the ViewGroup
and View class references.
40Vibrant Technology & Computers
41. • In general, the XML vocabulary for declaring
UI elements closely follows the structure and
naming of the classes and methods, where
element names correspond to class names
and attribute names correspond to methods.
• In fact, the correspondence is often so direct
that you can guess what XML attribute
corresponds to a class method, or guess what
class corresponds to a given xml element.
41Vibrant Technology & Computers
42. • However, note that not all vocabulary is
identical.
• In some cases, there are slight naming
differences.
42Vibrant Technology & Computers
43. • For example, the EditText element has a text
attribute that corresponds to
EditText.setText().
• [They got their explanations slightly out of
order.
• The text attribute and setText() method are an
example of correspondence.
• The are not intended as an example of a case
with a slight difference.]
43Vibrant Technology & Computers
44. • Tip:
• Learn more about different layout types in
Common Layout Objects.
• There are also a collection of tutorials on
building various layouts in the Hello Views
tutorial guide.
44Vibrant Technology & Computers
45. • Write the XML
• Using Android's XML vocabulary, you can
quickly design UI layouts and the screen
elements they contain, in the same way you
create web pages in HTML — with a series of
nested elements.
• Each layout file must contain exactly one root
element, which must be a View or ViewGroup
object.
45Vibrant Technology & Computers
46. • Once you've defined the root element, you
can add additional layout objects or widgets
as child elements to gradually build a View
hierarchy that defines your layout.
• For example, here's an XML layout that uses a
vertical LinearLayout to hold a TextView and a
Button:
46Vibrant Technology & Computers
47. • <?xml version="1.0" encoding="utf-8"?>
<LinearLayout
xmlns:android="http://schemas.android.com/apk/res/androi
d"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:orientation="vertical" >
<TextView android:id="@+id/text"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Hello, I am a TextView" />
<Button android:id="@+id/button"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Hello, I am a Button" />
</LinearLayout>
47Vibrant Technology & Computers
48. • After you've declared your layout in XML, save
the file with the .xml extension, in your
Android project's res/layout/ directory, so it
will properly compile.
• More information about the syntax for a
layout XML file is available in the Layout
Resources document.
48Vibrant Technology & Computers
49. • Load the XML Resource
• When you compile your application, each XML
layout file is compiled into a View resource.
• You should load the layout resource from your
application code, in your Activity.onCreate()
callback implementation.
49Vibrant Technology & Computers
50. • Do so by calling setContentView(), passing it
the reference to your layout resource in the
form of:
• R.layout.layout_file_name
• For example, if your XML layout is saved as
main_layout.xml, you would load it for your
Activity like so:
50Vibrant Technology & Computers
51. • public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.main_layout);
}
• The onCreate() callback method in your
Activity is called by the Android framework
when your Activity is launched (see the
discussion about lifecycles, in the Activities
document).
51Vibrant Technology & Computers
52. • [It may be worth noting something here:
• You can access layouts directly using their name
as given in R.java:
• setContentView(R.layout.main_layout);
• Contrast this with how you acquire a reference to
an individual view in a layout:
• EditText myEditText = (EditText)
findViewById(R.id.input_message_view);
52Vibrant Technology & Computers
53. • Or how you access a resource:
• Resources res = getResources();
• String[] prompts = res.getStringArray(R.array.prompt_array);
• int colorIndex = res.getInteger(R.integer.numberInColorCycle);
• ]
53Vibrant Technology & Computers
54. • Attributes
• Every View and ViewGroup object supports
their own variety of XML attributes.
• Some attributes are specific to a View object
(for example, TextView supports the textSize
attribute), but these attributes are also
inherited by any View objects that may extend
this class.
54Vibrant Technology & Computers
55. • Some are common to all View objects,
because they are inherited from the root View
class (like the id attribute).
• And, other attributes are considered "layout
parameters," which are attributes that
describe certain layout orientations of the
View object, as defined by that object's parent
ViewGroup object.
55Vibrant Technology & Computers
56. • ID
• Any View object may have an integer ID
associated with it, to uniquely identify the
View within the tree.
• When the application is compiled, this ID is
referenced as an integer, but the ID is typically
assigned in the layout XML file as a string, in
the id attribute.
56Vibrant Technology & Computers
57. • This is an XML attribute common to all View
objects (defined by the View class) and you
will use it very often.
• The syntax for an ID, inside an XML tag is:
• android:id="@+id/my_button"
57Vibrant Technology & Computers
58. • The at-symbol (@) at the beginning of the
string indicates that the XML parser should
parse and expand the rest of the ID string and
identify it as an ID resource.
• The plus-symbol (+) means that this is a new
resource name that must be created and
added to our resources (in the R.java file).
58Vibrant Technology & Computers
59. • There are a number of other ID resources that
are offered by the Android framework.
• When referencing an Android resource ID, you
do not need the plus-symbol, but must add
the android package namespace, like so:
• android:id="@android:id/empty"
59Vibrant Technology & Computers
60. • With the android package namespace in place,
we're now referencing an ID from the android.R
resources class, rather than the local resources
class.
• [If accurate, this is an interesting statement.
• We’re being told something about the meaning
of the syntax.
• Java app code depends on R.java.
• After the related project files are built, layout and
other resource files also depend on R.java for
id’s.]
60Vibrant Technology & Computers
61. • In order to create views and reference them
from the application, a common pattern is to:
• 1. Define a view/widget in the layout file and
assign it a unique ID:
• <Button android:id="@+id/my_button"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@string/my_button_text"/>
61Vibrant Technology & Computers
62. • 2. Then create an instance of the view object and
capture it from the layout (typically in the
onCreate() method):
• Button myButton = (Button)
findViewById(R.id.my_button);
• [You’re not creating an instance of the object.
• You’re recovering a reference to the object as
defined/created in the layout file.]
62Vibrant Technology & Computers
63. • Defining IDs for view objects is important
when creating a RelativeLayout.
• In a relative layout, sibling views can define
their layout relative to another sibling view,
which is referenced by the unique ID.
63Vibrant Technology & Computers
64. • An ID need not be unique throughout the
entire tree, but it should be unique within the
part of the tree you are searching (which may
often be the entire tree, so it's best to be
completely unique when possible).
• [Clowns: Just make them globally unique.]
64Vibrant Technology & Computers
65. • Layout Parameters
• XML layout attributes named layout_something
define layout parameters for the View that are
appropriate for the ViewGroup in which it
resides.
• Every ViewGroup class implements a nested class
that extends ViewGroup.LayoutParams.
• This subclass contains property types that define
the size and position for each child view, as
appropriate for the view group.
65Vibrant Technology & Computers
66. • As you can see in figure 1, the parent view group
defines layout parameters for each child view
(including the child view group).
• [Following overhead]
• [General note on this topic:
• What they seem to be saying is that a parent in
effect defines what kinds of parameters its
children will have.
• It’s up to the children to use values which are
appropriate to the parameters defined in their
parents.]
66Vibrant Technology & Computers
67. Figure 1. Visualization of a view hierarchy with
layout parameters associated with each view.
67Vibrant Technology & Computers
68. • Note that every LayoutParams subclass has its
own syntax for setting values.
• Each child element must define LayoutParams
that are appropriate for its parent, though it may
also define different LayoutParams for its own
children.
• All view groups include a width and height
(layout_width and layout_height), and each view
is required to define them.
• Many LayoutParams also include optional
margins and borders.
68Vibrant Technology & Computers
69. • You can specify width and height with exact
measurements, though you probably won't want
to do this often.
• More often, you will use one of these constants
to set the width or height:
• wrap_content tells your view to size itself to the
dimensions required by its content
• fill_parent (renamed match_parent in API Level 8)
tells your view to become as big as its parent
view group will allow.
69Vibrant Technology & Computers
70. • In general, specifying a layout width and height
using absolute units such as pixels is not
recommended.
• Instead, using relative measurements such as
density-independent pixel units (dp),
wrap_content, or fill_parent, is a better
approach, because it helps ensure that your
application will display properly across a variety
of device screen sizes.
• The accepted measurement types are defined in
the Available Resources document.
70Vibrant Technology & Computers
71. • Layout Position
• The geometry of a view is that of a rectangle.
• A view has a location, expressed as a pair of
left and top coordinates, and two dimensions,
expressed as a width and a height.
• The unit for location and dimensions is the
pixel.
71Vibrant Technology & Computers
72. • It is possible to retrieve the location of a view
by invoking the methods getLeft() and
getTop().
• The former returns the left, or X, coordinate of
the rectangle representing the view.
• The latter returns the top, or Y, coordinate of
the rectangle representing the view.
• [Notice the similarity with the bounding box in
Java graphics.]
72Vibrant Technology & Computers
73. • These methods both return the location of the
view relative to its parent.
• For instance, when getLeft() returns 20, that
means the view is located 20 pixels to the
right of the left edge of its direct parent.
• [Keep in mind that this is of pretty remote
usefulness.
• In general we’d like to avoid hardcoding
dimensional values.]
73Vibrant Technology & Computers
74. • In addition, several convenience methods are
offered to avoid unnecessary computations,
namely getRight() and getBottom().
• These methods return the coordinates of the
right and bottom edges of the rectangle
representing the view.
• For instance, calling getRight() is similar to the
following computation: getLeft() + getWidth().
74Vibrant Technology & Computers
75. • Size, Padding and Margins
• The size of a view is expressed with a width and a
height.
• A view actually possess two pairs of width and height
values.
• The first pair is known as measured width and
measured height.
• These dimensions define how big a view wants to be
within its parent.
• The measured dimensions can be obtained by calling
getMeasuredWidth() and getMeasuredHeight().
75Vibrant Technology & Computers
76. • The second pair is simply known as width and
height, or sometimes drawing width and drawing
height.
• These dimensions define the actual size of the
view on screen, at drawing time and after layout.
• These values may, but do not have to, be
different from the measured width and height.
• The width and height can be obtained by calling
getWidth() and getHeight().
76Vibrant Technology & Computers
77. • To measure its dimensions, a view takes into
account its padding.
• The padding is expressed in pixels for the left,
top, right and bottom parts of the view.
• Padding can be used to offset the content of
the view by a specific amount of pixels.
77Vibrant Technology & Computers
78. • For instance, a left padding of 2 will push the
view's content by 2 pixels to the right of the
left edge.
• Padding can be set using the setPadding(int,
int, int, int) method and queried by calling
getPaddingLeft(), getPaddingTop(),
getPaddingRight() and getPaddingBottom().
78Vibrant Technology & Computers
79. • Even though a view can define a padding, it
does not provide any support for margins.
• However, view groups provide such a support.
Refer to ViewGroup and
ViewGroup.MarginLayoutParams for further
information.
• For more information about dimensions, see
Dimension Values.
79Vibrant Technology & Computers
80. • [Remember that in the graphical development
environment you can set properties.
• For the time being, you can think of the
information given above as general
background on properties.
• As noted a little while back, we hope to avoid
details like this as much as possible.]
80Vibrant Technology & Computers
81. • Common Layouts
• Each subclass of the ViewGroup class provides
a unique way to display the views you nest
within it.
• Below are some of the more common layout
types that are built into the Android platform.
81Vibrant Technology & Computers
82. • Linear Layout, Relative Layout, and Web View
82Vibrant Technology & Computers
83. • Linear Layout
• A layout that organizes its children into a
single horizontal or vertical row.
• It creates a scrollbar if the length of the
window exceeds the length of the screen.
83Vibrant Technology & Computers
84. • Relative Layout
• Enables you to specify the location of child
objects relative to each other (child A to the
left of child B) or to the parent (aligned to the
top of the parent).
• Web View
• Displays web pages.
84Vibrant Technology & Computers
85. • Building Layouts with an Adapter
• When the content for your layout is dynamic
or not pre-determined, you can use a layout
that subclasses AdapterView to populate the
layout with views at runtime.
• A subclass of the AdapterView class uses an
Adapter to bind data to its layout.
85Vibrant Technology & Computers
86. • The Adapter behaves as a middle-man
between the data source and the
AdapterView layout—the Adapter retrieves
the data (from a source such as an array or a
database query) and converts each entry into
a view that can be added into the
AdapterView layout.
86Vibrant Technology & Computers
87. • [This comes up in design patterns—and exists in
the Java API.
• Setting aside Android for the moment:
• Suppose you have an array of objects of the same
class, which each have some string value.
• Suppose your application contains a Table class,
where this class has had its cells defined
generically so they can be populated with
“anything”.
87Vibrant Technology & Computers
88. • Adaptation has to do with the process of
converting the set of string instance variable
values coming from the array of objects into a
set of objects/values which can populate the
cells in a row of the table.
• The same idea applies when trying to
populate the elements of a ViewGroup which
contains a well defined set of child Views.]
88Vibrant Technology & Computers
89. • Common layouts backed by an adapter
include: List View, Grid View
89Vibrant Technology & Computers
90. • List View:
• Displays a scrolling single column list.
• Grid View:
• Displays a scrolling grid of columns and rows.
90Vibrant Technology & Computers
91. • Filling an adapter view with data
• You can populate an AdapterView such as
ListView or GridView by binding the AdapterView
instance to an Adapter, which retrieves data from
an external source and creates a View that
represents each data entry.
• Android provides several subclasses of Adapter
that are useful for retrieving different kinds of
data and building views for an AdapterView. The
two most common adapters are: [ArrayAdapter,
SimpleCursorAdapter]
91Vibrant Technology & Computers
92. • ArrayAdapter
• Use this adapter when your data source is an
array.
• By default, ArrayAdapter creates a view for each
array item by calling toString() on each item and
placing the contents in a TextView.
• [Notice our friend toString() doing the conversion
or adaptation of an object and turning it into a
child TextView in an AdapterView.]
92Vibrant Technology & Computers
93. • For example, if you have an array of strings
you want to display in a ListView, initialize a
new ArrayAdapter using a constructor to
specify the layout for each string and the
string array:
• ArrayAdapter adapter = new ArrayAdapter<String>(this,
android.R.layout.simple_list_item_1, myStringArray);
93Vibrant Technology & Computers
94. • The arguments for this constructor are:
• Your app Context
• The layout that contains a TextView for each
string in the array
• The string array
94Vibrant Technology & Computers
95. • Then simply call setAdapter() on your
ListView:
• ListView listView = (ListView) findViewById(R.id.listview);
listView.setAdapter(adapter);
• [Recall the statements made earlier:
• You populate the AdapterView (simply) by
binding it to the adapter (which adapts some
data set).]
95Vibrant Technology & Computers
96. • To customize the appearance of each item you
can override the toString() method for the
objects in your array.
• Or, to create a view for each item that's
something other than a TextView (for
example, if you want an ImageView for each
array item), extend the ArrayAdapter class and
override getView() to return the type of view
you want for each item.
96Vibrant Technology & Computers
97. • [There is nothing cosmic about this comment.
• It just gets hard to see the forest for the trees
sometimes.
• All of the preceding information tells you this:
• The whole mechanism is set up by default to
display strings.
• A vanilla ListView consists of a bunch of
TextViews.]
97Vibrant Technology & Computers
98. • [The next subsection on the CursorAdapter is
included for completeness’ sake.
• But I have no intention of covering it in detail.
• That would require delving into
cursors…which haven’t been covered yet.
• Until we’ve covered more stuff on input
functions, adapting to cursors is off topic.]
98Vibrant Technology & Computers
99. • SimpleCursorAdapter
• Use this adapter when your data comes from a Cursor.
• When using SimpleCursorAdapter, you must specify a
layout to use for each row in the Cursor and which
columns in the Cursor should be inserted into which
views of the layout.
• For example, if you want to create a list of people's
names and phone numbers, you can perform a query
that returns a Cursor containing a row for each person
and columns for the names and numbers.
99Vibrant Technology & Computers
100. • You then create a string array specifying which
columns from the Cursor you want in the
layout for each result and an integer array
specifying the corresponding views that each
column should be placed:
• String[] fromColumns = {ContactsContract.Data.DISPLAY_NAME,
ContactsContract.CommonDataKinds.Phone.NUMBER};
int[] toViews = {R.id.display_name, R.id.phone_number};
100Vibrant Technology & Computers
101. • When you instantiate the
SimpleCursorAdapter, pass the layout to use
for each result, the Cursor containing the
results, and these two arrays:
• SimpleCursorAdapter adapter = new SimpleCursorAdapter(this,
R.layout.person_name_and_number, cursor, fromColumns, toViews, 0);
ListView listView = getListView();
listView.setAdapter(adapter);
101Vibrant Technology & Computers
102. • The SimpleCursorAdapter then creates a view for
each row in the Cursor using the provided layout
by inserting each fromColumns item into the
corresponding toViews view.
• If, during the course of your application's life, you
change the underlying data that is read by your
adapter, you should call notifyDataSetChanged().
This will notify the attached view that the data
has been changed and it should refresh itself.
102Vibrant Technology & Computers
103. • [The next section is kind of out of the blue.
• Like the foregoing, it’s included for
completeness’ sake.
• Here is a scenario:
• Suppose you wanted to populate a ListView
with buttons instead of text…
103Vibrant Technology & Computers
104. • Keep in mind that this section on adaptation
presupposes that you couldn’t completely define
a layout in advance.
• The buttons aren’t there and you can’t predefine
sendMessage() methods for them.
• You’re doing it “programmatically,” namely, when
your Java code is running.
• So at run time, you want to make some buttons
and you’d like them to have functionality.]
104Vibrant Technology & Computers
105. • Handling click events
• You can respond to click events on each item
in an AdapterView by implementing the
AdapterView.OnItemClickListener interface.
For example:
• // Create a message handling object as an anonymous class.
private OnItemClickListener mMessageClickedHandler = new OnItemClickListener() {
public void onItemClick(AdapterView parent, View v, int position, long id) {
// Do something in response to the click
}
};
listView.setOnItemClickListener(mMessageClickedHandler);
105Vibrant Technology & Computers
106. • [Notice that the foregoing example code used
the syntax for an anonymous listener.
• The event handling method in the listener is
onItemClick().
• In the coming sections, the use of listeners in
Android Java code will be covered in more
detail.]
106Vibrant Technology & Computers
108. • Linear Layout
• LinearLayout is a view group that aligns all
children in a single direction, vertically or
horizontally.
• You can specify the layout direction with the
android:orientation attribute.
108Vibrant Technology & Computers
109. • All children of a LinearLayout are stacked one
after the other, so a vertical list will only have
one child per row, no matter how wide they
are, and a horizontal list will only be one row
high (the height of the tallest child, plus
padding).
• A LinearLayout respects margins between
children and the gravity (right, center, or left
alignment) of each child.
109Vibrant Technology & Computers
110. • Layout Weight
• LinearLayout also supports assigning a weight
to individual children with the
android:layout_weight attribute.
• This attribute assigns an "importance" value
to a view in terms of how much space is
should occupy on the screen.
• A larger weight value allows it to expand to fill
any remaining space in the parent view.
110Vibrant Technology & Computers
111. • Child views can specify a weight value, and
then any remaining space in the view group is
assigned to children in the proportion of their
declared weight.
• Default weight is zero.
111Vibrant Technology & Computers
112. • For example, if there are three text fields and
two of them declare a weight of 1, while the
other is given no weight, the third text field
without weight will not grow and will only
occupy the area required by its content.
• The other two will expand equally to fill the
space remaining after all three fields are
measured.
112Vibrant Technology & Computers
113. • If the third field is then given a weight of 2
(instead of 0), then it is now declared more
important than both the others, so it gets half
the total remaining space, while the first two
share the rest equally.
113Vibrant Technology & Computers
114. • Equally weighted children
• To create a linear layout in which each child
uses the same amount of space on the screen,
set the android:layout_height of each view to
"0dp" (for a vertical layout) or the
android:layout_width of each view to "0dp"
(for a horizontal layout).
• Then set the android:layout_weight of each
view to "1".
114Vibrant Technology & Computers
116. • Relative Layout
• RelativeLayout is a view group that displays
child views in relative positions.
• The position of each view can be specified as
relative to sibling elements (such as to the
left-of or below another view) or in positions
relative to the parent RelativeLayout area
(such as aligned to the bottom, left of center).
116Vibrant Technology & Computers
117. • A RelativeLayout is a very powerful utility for
designing a user interface because it can
eliminate nested view groups and keep your
layout hierarchy flat, which improves
performance.
• If you find yourself using several nested
LinearLayout groups, you may be able to
replace them with a single RelativeLayout.
117Vibrant Technology & Computers
118. • Positioning Views
• RelativeLayout lets child views specify their
position relative to the parent view or to each
other (specified by ID).
• So you can align two elements by right border, or
make one below another, centered in the screen,
centered left, and so on.
• By default, all child views are drawn at the top-
left of the layout, so you must define the position
of each view using the various layout properties
available from RelativeLayout.LayoutParams.
118Vibrant Technology & Computers
119. • Some of the many layout properties available
to views in a RelativeLayout include:
• android:layout_alignParentTop
• If "true", makes the top edge of this view
match the top edge of the parent.
android:layout_centerVertical
• If "true", centers this child vertically within its
parent.
119Vibrant Technology & Computers
120. • android:layout_below
• Positions the top edge of this view below the
view specified with a resource ID.
android:layout_toRightOf
• Positions the left edge of this view to the right
of the view specified with a resource ID.
• These are just a few examples.
• All layout attributes are documented at
RelativeLayout.LayoutParams.
120Vibrant Technology & Computers
121. • The value for each layout property is either a boolean
to enable a layout position relative to the parent
RelativeLayout or an ID that references another view in
the layout against which the view should be
positioned.
• In your XML layout, dependencies against other views
in the layout can be declared in any order. For example,
you can declare that "view1" be positioned below
"view2" even if "view2" is the last view declared in the
hierarchy.
• The example below demonstrates such a scenario.
121Vibrant Technology & Computers
123. • Each of the attributes that control the relative
position of each view are emphasized.
• [Note that this layout contains spinners.
• They haven’t been introduced yet, but they
will be in the next unit.]
123Vibrant Technology & Computers
124. • For details about all the layout attributes
available to each child view of a
RelativeLayout, see
RelativeLayout.LayoutParams.
124Vibrant Technology & Computers
126. • List View
• ListView is a view group that displays a list of
scrollable items.
• The list items are automatically inserted to the
list using an Adapter that pulls content from a
source such as an array or database query and
converts each item result into a view that's
placed into the list.
• For an introduction to how you can dynamically
insert views using an adapter, read Building
Layouts with an Adapter.
126Vibrant Technology & Computers
128. • Using a Loader
• Using a CursorLoader is the standard way to
query a Cursor as an asynchronous task in order
to avoid blocking your app's main thread with the
query.
• When the CursorLoader receives the Cursor
result, the LoaderCallbacks receives a callback to
onLoadFinished(), which is where you update
your Adapter with the new Cursor and the list
view then displays the results.
128Vibrant Technology & Computers
129. • Although the CursorLoader APIs were first
introduced in Android 3.0 (API level 11), they
are also available in the Support Library so
that your app may use them while supporting
devices running Android 1.6 or higher.
• For more information about using a Loader to
asynchronously load data, see the Loaders
guide.
129Vibrant Technology & Computers
130. • Example
• The following example uses ListActivity, which
is an activity that includes a ListView as its
only layout element by default.
• It performs a query to the Contacts Provider
for a list of names and phone numbers.
• The activity implements the LoaderCallbacks
interface in order to use a CursorLoader that
dynamically loads the data for the list view.
130Vibrant Technology & Computers
131. • [Note that this is a lot of information.
• It would take some serious code reading to
figure out what’s going on.
• I probably won’t do this in class.
• It’s here for reference.]
131Vibrant Technology & Computers
132. • [If you’re interested, this is the kind of thing you
figure out as part of the assignment
• Or you could do this as part of your project.
• Note that one of the uses is in displaying the
results of db queries.
• By definition, you can’t say in advance how many
rows you’ll get.
• So this idea of being able to generate layout
contents programmatically is useful in advanced
settings.]
132Vibrant Technology & Computers
134. • Grid View
• GridView is a ViewGroup that displays items in
a two-dimensional, scrollable grid.
• The grid items are automatically inserted to
the layout using a ListAdapter.
• For an introduction to how you can
dynamically insert views using an adapter,
read Building Layouts with an Adapter.
134Vibrant Technology & Computers
136. • Example
• In this tutorial, you'll create a grid of image
thumbnails.
• When an item is selected, a toast message will
display the position of the image.
136Vibrant Technology & Computers
137. • [Because of the order that I’m presenting things
in, the term Toast hasn’t been explained yet.
• This is from the API.
• “A toast is a view containing a quick little message
for the user.”
• In Java we saw the use of dialog boxes
• A toast isn’t even that complex, but the idea of a
simple, system supplied thing for supporting
interaction with the user is similar.]
137Vibrant Technology & Computers
138. • 1. Start a new project named HelloGridView.
• 2. Find some photos you'd like to use, or
download these sample images.
• Save the image files into the project's
res/drawable/ directory.
138Vibrant Technology & Computers
139. • 3. Open the res/layout/main.xml file and insert the following:
•
• <?xml version="1.0" encoding="utf-8"?>
<GridView
xmlns:android="http://schemas.android.com/apk
/res/android"
android:id="@+id/gridview"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:columnWidth="90dp"
android:numColumns="auto_fit"
android:verticalSpacing="10dp"
android:horizontalSpacing="10dp"
android:stretchMode="columnWidth"
android:gravity="center"
/>
139Vibrant Technology & Computers
140. • This GridView will fill the entire screen.
• The attributes are rather self explanatory.
• [?]
• For more information about valid attributes,
see the GridView reference.
140Vibrant Technology & Computers
141. • 4. Open HelloGridView.java and insert the following
code for the onCreate() method:
• public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.main);
GridView gridview = (GridView) findViewById(R.id.gridview);
gridview.setAdapter(new ImageAdapter(this));
gridview.setOnItemClickListener(new OnItemClickListener() {
public void onItemClick(AdapterView<?> parent, View v, int
position, long id) {
Toast.makeText(HelloGridView.this, "" + position,
Toast.LENGTH_SHORT).show();
}
});
}
141Vibrant Technology & Computers
142. • After the main.xml layout is set for the
content view, the GridView is captured from
the layout with findViewById(int).
• The setAdapter() method then sets a custom
adapter (ImageAdapter) as the source for all
items to be displayed in the grid.
• The ImageAdapter is created in the next step.
142Vibrant Technology & Computers
143. • To do something when an item in the grid is
clicked, the setOnItemClickListener() method is
passed a new AdapterView.OnItemClickListener.
• This anonymous instance defines the
onItemClick() callback method to show a Toast
that displays the index position (zero-based) of
the selected item (in a real world scenario, the
position could be used to get the full sized image
for some other task).
143Vibrant Technology & Computers
144. • 5. Create a new class called ImageAdapter that extends
BaseAdapter:
• public class ImageAdapter extends BaseAdapter {
private Context mContext;
public ImageAdapter(Context c) {
mContext = c;
}
public int getCount() {
return mThumbIds.length;
}
public Object getItem(int position) {
return null;
}
public long getItemId(int position) {
return 0;
}
Run the Application
144Vibrant Technology & Computers
145. • // create a new ImageView for each item referenced by the Adapter
public View getView(int position, View convertView, ViewGroup parent) {
ImageView imageView;
if (convertView == null) { // if it's not recycled, initialize some attributes
imageView = new ImageView(mContext);
imageView.setLayoutParams(new GridView.LayoutParams(85, 85));
imageView.setScaleType(ImageView.ScaleType.CENTER_CROP);
imageView.setPadding(8, 8, 8, 8);
} else {
imageView = (ImageView) convertView;
}
imageView.setImageResource(mThumbIds[position]);
return imageView;
}
145Vibrant Technology & Computers
147. • First, this implements some required methods
inherited from BaseAdapter.
• The constructor and getCount() are self-
explanatory.
• Normally, getItem(int) should return the
actual object at the specified position in the
adapter, but it's ignored for this example.
• Likewise, getItemId(int) should return the row
id of the item, but it's not needed here.
147Vibrant Technology & Computers
148. • The first method necessary is getView().
• This method creates a new View for each image
added to the ImageAdapter.
• When this is called, a View is passed in, which is
normally a recycled object (at least after this has
been called once), so there's a check to see if the
object is null.
• If it is null, an ImageView is instantiated and
configured with desired properties for the image
presentation:
148Vibrant Technology & Computers
149. • setLayoutParams(ViewGroup.LayoutParams) sets the
height and width for the View—this ensures that, no
matter the size of the drawable, each image is resized
and cropped to fit in these dimensions, as appropriate.
• setScaleType(ImageView.ScaleType) declares that
images should be cropped toward the center (if
necessary).
• setPadding(int, int, int, int) defines the padding for all
sides. (Note that, if the images have different aspect-
ratios, then less padding will cause more cropping of
the image if it does not match the dimensions given to
the ImageView.)
149Vibrant Technology & Computers
150. • If the View passed to getView() is not null, then
the local ImageView is initialized with the
recycled View object.
• At the end of the getView() method, the position
integer passed into the method is used to select
an image from the mThumbIds array, which is set
as the image resource for the ImageView.
• All that's left is to define the mThumbIds array of
drawable resources.
150Vibrant Technology & Computers