The document provides instructions for building an Android app that makes an API call to GitHub to retrieve a list of Java developers in Nairobi. It retrieves the data using Volley, parses the JSON response, and displays the developer names, images, and URLs in a RecyclerView with CardViews. It also describes how to set up an adapter to connect the data to the RecyclerView items, create a model class to store the developer data, and add a click handler to launch a profile activity with more details when an item is tapped.
This document contains a list of Java programming lab assignments with questions ranging from basic programming concepts like variables, conditionals, loops, methods and classes to more advanced topics like inheritance, abstraction, polymorphism and exceptions. Some questions involve writing simple programs to calculate things like pay, time conversions or name formatting while others require designing classes and relationships between them. The assignments cover core Java programming techniques and principles.
This document contains instructions for several Java programming exercises involving classes, packages, inheritance, overriding, exceptions, and threads. It outlines code for programs that demonstrate concepts like classes and objects, command line arguments, bitwise operators, method overriding, and packages. For each exercise, it provides the aim, algorithm, sample code, input/output, and result to verify the output. The exercises are intended to help students learn and practice core Java programming concepts.
The document provides the syllabus for a Java lab course. It outlines 11 programming assignments that students must complete, including developing classes for rational numbers, dates, Lisp-like lists, stacks, vehicles, currency conversion, and a scientific calculator. It provides sample code and algorithms for implementing a rational number class, date class, Lisp list operations, stack data structure using arrays and linked lists, vehicle class hierarchy demonstrating polymorphism, currency classes for serialization, and a basic calculator using event-driven GUI programming.
The document contains the lab manual for the Java lab subject CS2309 for the V semester B.E CSE program. It includes 11 exercises to be completed as part of the lab. The exercises cover topics like implementing rational numbers, date class, lisp-like lists, stacks, object serialization, scientific calculator, multi-threading and a mini-project on a programmer's editor. It also provides the syllabus, list of experiments, requirements and a sample program for implementing rational numbers.
The document provides code examples for several basic Java programs, including:
1) A program that compares two numbers and prints which is greater.
2) A program that takes a number as input and prints all even numbers between 1 and the input.
3) Programs that calculate the area and perimeter of shapes like circles and rectangles.
4) Programs that calculate the factorial of a number and construct a triangle shape using asterisks.
5) A program that finds and lists all leap years between two given years.
This document contains questions and answers related to Java programming. It has multiple chapters on Java concepts like data types, operators, control statements, classes, inheritance and exception handling. Each chapter contains multiple questions asking to write Java programs demonstrating the related concept. The questions range from very basic programs printing strings to more complex programs using classes, objects, inheritance and exceptions.
This document contains a Java practical file belonging to Rachit Gupta, an MCA student. It consists of 16 programs of varying complexity written in Java, along with the output of each program. The programs cover topics such as calculating the square root of a number, finding the perimeter of a rectangle, calculating percentage of marks, and generating an electric bill based on units consumed. The file is a submission of Rachit Gupta's Java practical assignments for his 4th semester MCA course at the University of Jammu.
This document contains a list of Java programming lab assignments with questions ranging from basic programming concepts like variables, conditionals, loops, methods and classes to more advanced topics like inheritance, abstraction, polymorphism and exceptions. Some questions involve writing simple programs to calculate things like pay, time conversions or name formatting while others require designing classes and relationships between them. The assignments cover core Java programming techniques and principles.
This document contains instructions for several Java programming exercises involving classes, packages, inheritance, overriding, exceptions, and threads. It outlines code for programs that demonstrate concepts like classes and objects, command line arguments, bitwise operators, method overriding, and packages. For each exercise, it provides the aim, algorithm, sample code, input/output, and result to verify the output. The exercises are intended to help students learn and practice core Java programming concepts.
The document provides the syllabus for a Java lab course. It outlines 11 programming assignments that students must complete, including developing classes for rational numbers, dates, Lisp-like lists, stacks, vehicles, currency conversion, and a scientific calculator. It provides sample code and algorithms for implementing a rational number class, date class, Lisp list operations, stack data structure using arrays and linked lists, vehicle class hierarchy demonstrating polymorphism, currency classes for serialization, and a basic calculator using event-driven GUI programming.
The document contains the lab manual for the Java lab subject CS2309 for the V semester B.E CSE program. It includes 11 exercises to be completed as part of the lab. The exercises cover topics like implementing rational numbers, date class, lisp-like lists, stacks, object serialization, scientific calculator, multi-threading and a mini-project on a programmer's editor. It also provides the syllabus, list of experiments, requirements and a sample program for implementing rational numbers.
The document provides code examples for several basic Java programs, including:
1) A program that compares two numbers and prints which is greater.
2) A program that takes a number as input and prints all even numbers between 1 and the input.
3) Programs that calculate the area and perimeter of shapes like circles and rectangles.
4) Programs that calculate the factorial of a number and construct a triangle shape using asterisks.
5) A program that finds and lists all leap years between two given years.
This document contains questions and answers related to Java programming. It has multiple chapters on Java concepts like data types, operators, control statements, classes, inheritance and exception handling. Each chapter contains multiple questions asking to write Java programs demonstrating the related concept. The questions range from very basic programs printing strings to more complex programs using classes, objects, inheritance and exceptions.
This document contains a Java practical file belonging to Rachit Gupta, an MCA student. It consists of 16 programs of varying complexity written in Java, along with the output of each program. The programs cover topics such as calculating the square root of a number, finding the perimeter of a rectangle, calculating percentage of marks, and generating an electric bill based on units consumed. The file is a submission of Rachit Gupta's Java practical assignments for his 4th semester MCA course at the University of Jammu.
This document provides information about a lab manual for an Object Oriented Programming lab through Java at Guru Nanak Engineering College for the 2007-2008 academic year. It includes the lab objectives, guidelines for students, a list of lab exercises to be completed over 15 weeks, descriptions of OOP concepts, and solutions to sample programs. The document was prepared by D. Rama Rao and approved by G. Prabhakar Raju for use in the Department of Information Technology.
The document contains code snippets from 3 weekly coding assignments:
1) A Java program to check if a string is a palindrome. It compares characters at the beginning and end of the string.
2) A Java program to sort a list of names in ascending order using string comparison and swapping.
3) A Java program to count the frequency of words in a given text by tokenizing, sorting, and printing the words.
The document provides details of programs to be implemented in C++ and Java as part of an Object Oriented Programming lab. The C++ programs include implementations of inline function overloading, complex numbers using operator overloading, friend functions, string concatenation using dynamic memory allocation, type conversion using complex numbers, managing bank accounts using inheritance, and a stack class with exception handling. The Java programs include writing simple programs, palindrome checking using strings, interfaces, inheritance, exception handling, and multithreaded programs.
The document provides information on arrays in Java programming:
1. Arrays allow storing multiple values of the same type in a single variable through contiguous memory locations. One-dimensional and multi-dimensional arrays are covered.
2. Sample code is provided to demonstrate declaring and initializing a one-dimensional integer array, calculating the sum of elements, and accepting input from the user to populate the array.
3. Another sample shows transposing a 2D array, with code to input values, store the original and transposed arrays, and output the transposed array.
Exercises are provided before, during and after the lab session to practice array concepts.
Java was developed in 1991 by Sun Microsystems as part of the Green project. A team member named James Gosling grew dissatisfied with C++ and created a new language called Oak, which was later renamed to Java in 1995 by Sun Microsystems. Java is an object-oriented language that is platform independent, robust, reliable, secure, and has features like compilation to bytecode, dynamic binding, and multithreading.
This document provides code examples and exercises for learning Java programming. It lists chapter exercises from the book "Java Programming 7th Edition by Joyce Farrell" and additional examples from other sources. The examples cover topics like converting between units of measurement, calculating projections, and interactive guessing games. The document also includes sample code for making the examples interactive by prompting the user for input via dialog boxes.
The document is a lab manual for Java programming that includes 12 experiments. The first experiment involves creating a Java package with Stack and Queue classes that demonstrate LIFO and FIFO principles respectively using methods like push(), pop() and enqueue(), dequeue(). The second experiment involves designing a ComplexNumber class with constructors to perform addition, subtraction and multiplication of complex numbers.
The document contains 10 Java programs demonstrating various Java concepts:
1. Constructor overloading and method overloading using a Box class.
2. Inner classes and access protections using an Outer and Inner class.
3. Inheritance using classes A and B, with B extending A.
4. Exception handling using nested try-catch blocks.
5. Linked list operations using a LinkedList class.
6. File input/output streams using FileInputStream and FileOutputStream.
7. Object serialization writing an object to a file.
8. Client-server communication using datagram sockets.
9. Mouse event handling using MouseListener and MouseMotionListener interfaces.
10. Keyboard event handling using the
This document provides examples of Java programming concepts and code snippets to demonstrate how to implement various Java features. It includes examples for Java basics like strings, arrays, files and directories as well as more advanced topics like collections, networking, threading and GUI programming. Each section breaks down a specific concept like string manipulation or environment settings into discrete code examples that show how to perform common tasks like comparing strings, setting the classpath, or splitting a string.
The document provides examples of Java code demonstrating various programming concepts like loops, conditional statements, methods, arrays and string manipulation. It includes code snippets to print "Hello World", check if a number is even or odd, print multiplication tables, convert temperatures between Fahrenheit and Celsius scales, take input from the user and perform basic operations on strings. The examples illustrate the use of various loops like for, while and do-while loops, if-else statements, methods and built-in string/array methods in Java.
Procedure to create_the_calculator_application javagthe
The document describes the development of a Java console-based calculator application. It includes 5 classes - an interface, a base Calculate class containing calculation methods, and Calculator/ScientificCalculator subclasses for basic and scientific operations. The main UseCalculator class allows the user to choose operation type and perform calculations via do-while loops until quitting.
The document provides examples of various Java programming concepts like displaying messages, using control structures like if-else, for loops, methods, constructors, access specifiers, static variables and more. It shows how to write simple Java programs to print messages, integers, use conditional and looping statements. It also explains concepts like default and parameterized constructors, static and non-static methods, different access specifiers and their usage. The examples help learn how different Java features can be used to develop programs with classes, objects and methods.
The document discusses implementing classes in Java. It begins with an example class called Counter that models a tally counter. It then covers key concepts for implementing classes like instance variables, methods, constructors, and encapsulation. It provides examples of implementing a simple Counter class with methods like click(), getValue(), and reset(). It also discusses specifying the public interface of a class before implementation, using a hypothetical BankAccount class as an example.
Composing an App with Free Monads (using Cats)Hermann Hueck
In this talk I will explain what Free Monads are and how to use them (using the Cats implementation).
After having shown the basics I build a small app by composing several
Free Monads to a small program.
I discuss the pros and cons of this technique.
Finally I will demonstrate how to avoid some boilerplate with the FreeK library.
Rhino Mocks is a .NET mocking framework that allows developers to easily create and setup mock objects to test interactions using unit tests. It generates both mocks, which allow expectations to be set and verified, and stubs, which simply return preset values without verification. The document provides examples of using Rhino Mocks to generate mocks and stubs of interfaces, set expectations on mocks, and verify mock interactions using the AAA (Arrange, Act, Assert) syntax. It also distinguishes between mocks and stubs.
Operators in Java provide symbols that operate on arguments to produce results. The document discusses the different types of operators in Java including assignment, arithmetic, relational, logical, bitwise, and ternary operators. Examples are provided to demonstrate the usage of various operators like increment/decrement, arithmetic, relational, logical, bitwise, ternary, and instanceof operators in Java code.
This document provides an overview of writing simple Java programs. It introduces key Java concepts like objects, classes, methods, and standard library classes.
The first program example displays a window using the JFrame class. Object declaration and creation are described. Standard classes like JOptionPane, String, Date, and SimpleDateFormat are presented.
Program development is explained using an incremental approach. Comments, imports, and class/method declarations are covered. Object-oriented concepts like objects, messages, and dependencies are illustrated in program diagrams.
This document provides an overview of the Java Collections Framework. It discusses the main interfaces like Collection, List, Set, Map and their implementing classes like ArrayList, LinkedList, HashSet, TreeSet, HashMap, and TreeMap. It also covers topics like iterators, choosing appropriate collections, and using stacks, queues and priority queues. Examples are provided to demonstrate working with sets, maps, and using collections for problems like spell checking. The document aims to teach how to use the collection classes provided in the Java library and choose appropriate collections to solve programming problems.
The document outlines a Java programming practical course covering various Java concepts and programs. It includes 40 practical programs to be completed ranging from basic programs to find area of a circle, factorial of a number to more advanced programs involving OOP concepts like inheritance, abstraction, exception handling and multithreading. It also provides the evaluation and marking scheme for the practical exam.
This document provides an overview of beginning native Android app development. It discusses Android app structure including the manifest, activities, intents and lifecycles. It also covers common Android views and layouts, accessing device capabilities like the camera and location, working with data via content providers, and rendering with OpenGL. Example code is provided for various app features like input handling, scrollable lists, and camera access. The document concludes with the process for submitting an app to the Google Play Store.
This document discusses creating an MVC application from scratch using LINQ to SQL to perform CRUD operations on a database. It covers:
1. Creating an empty MVC project and adding controllers, views and models
2. Creating a sample database and using LINQ to SQL for communication between the MVC app and database
3. Performing CRUD operations in the MVC app by querying the database and passing data between controllers and views
This document provides information about a lab manual for an Object Oriented Programming lab through Java at Guru Nanak Engineering College for the 2007-2008 academic year. It includes the lab objectives, guidelines for students, a list of lab exercises to be completed over 15 weeks, descriptions of OOP concepts, and solutions to sample programs. The document was prepared by D. Rama Rao and approved by G. Prabhakar Raju for use in the Department of Information Technology.
The document contains code snippets from 3 weekly coding assignments:
1) A Java program to check if a string is a palindrome. It compares characters at the beginning and end of the string.
2) A Java program to sort a list of names in ascending order using string comparison and swapping.
3) A Java program to count the frequency of words in a given text by tokenizing, sorting, and printing the words.
The document provides details of programs to be implemented in C++ and Java as part of an Object Oriented Programming lab. The C++ programs include implementations of inline function overloading, complex numbers using operator overloading, friend functions, string concatenation using dynamic memory allocation, type conversion using complex numbers, managing bank accounts using inheritance, and a stack class with exception handling. The Java programs include writing simple programs, palindrome checking using strings, interfaces, inheritance, exception handling, and multithreaded programs.
The document provides information on arrays in Java programming:
1. Arrays allow storing multiple values of the same type in a single variable through contiguous memory locations. One-dimensional and multi-dimensional arrays are covered.
2. Sample code is provided to demonstrate declaring and initializing a one-dimensional integer array, calculating the sum of elements, and accepting input from the user to populate the array.
3. Another sample shows transposing a 2D array, with code to input values, store the original and transposed arrays, and output the transposed array.
Exercises are provided before, during and after the lab session to practice array concepts.
Java was developed in 1991 by Sun Microsystems as part of the Green project. A team member named James Gosling grew dissatisfied with C++ and created a new language called Oak, which was later renamed to Java in 1995 by Sun Microsystems. Java is an object-oriented language that is platform independent, robust, reliable, secure, and has features like compilation to bytecode, dynamic binding, and multithreading.
This document provides code examples and exercises for learning Java programming. It lists chapter exercises from the book "Java Programming 7th Edition by Joyce Farrell" and additional examples from other sources. The examples cover topics like converting between units of measurement, calculating projections, and interactive guessing games. The document also includes sample code for making the examples interactive by prompting the user for input via dialog boxes.
The document is a lab manual for Java programming that includes 12 experiments. The first experiment involves creating a Java package with Stack and Queue classes that demonstrate LIFO and FIFO principles respectively using methods like push(), pop() and enqueue(), dequeue(). The second experiment involves designing a ComplexNumber class with constructors to perform addition, subtraction and multiplication of complex numbers.
The document contains 10 Java programs demonstrating various Java concepts:
1. Constructor overloading and method overloading using a Box class.
2. Inner classes and access protections using an Outer and Inner class.
3. Inheritance using classes A and B, with B extending A.
4. Exception handling using nested try-catch blocks.
5. Linked list operations using a LinkedList class.
6. File input/output streams using FileInputStream and FileOutputStream.
7. Object serialization writing an object to a file.
8. Client-server communication using datagram sockets.
9. Mouse event handling using MouseListener and MouseMotionListener interfaces.
10. Keyboard event handling using the
This document provides examples of Java programming concepts and code snippets to demonstrate how to implement various Java features. It includes examples for Java basics like strings, arrays, files and directories as well as more advanced topics like collections, networking, threading and GUI programming. Each section breaks down a specific concept like string manipulation or environment settings into discrete code examples that show how to perform common tasks like comparing strings, setting the classpath, or splitting a string.
The document provides examples of Java code demonstrating various programming concepts like loops, conditional statements, methods, arrays and string manipulation. It includes code snippets to print "Hello World", check if a number is even or odd, print multiplication tables, convert temperatures between Fahrenheit and Celsius scales, take input from the user and perform basic operations on strings. The examples illustrate the use of various loops like for, while and do-while loops, if-else statements, methods and built-in string/array methods in Java.
Procedure to create_the_calculator_application javagthe
The document describes the development of a Java console-based calculator application. It includes 5 classes - an interface, a base Calculate class containing calculation methods, and Calculator/ScientificCalculator subclasses for basic and scientific operations. The main UseCalculator class allows the user to choose operation type and perform calculations via do-while loops until quitting.
The document provides examples of various Java programming concepts like displaying messages, using control structures like if-else, for loops, methods, constructors, access specifiers, static variables and more. It shows how to write simple Java programs to print messages, integers, use conditional and looping statements. It also explains concepts like default and parameterized constructors, static and non-static methods, different access specifiers and their usage. The examples help learn how different Java features can be used to develop programs with classes, objects and methods.
The document discusses implementing classes in Java. It begins with an example class called Counter that models a tally counter. It then covers key concepts for implementing classes like instance variables, methods, constructors, and encapsulation. It provides examples of implementing a simple Counter class with methods like click(), getValue(), and reset(). It also discusses specifying the public interface of a class before implementation, using a hypothetical BankAccount class as an example.
Composing an App with Free Monads (using Cats)Hermann Hueck
In this talk I will explain what Free Monads are and how to use them (using the Cats implementation).
After having shown the basics I build a small app by composing several
Free Monads to a small program.
I discuss the pros and cons of this technique.
Finally I will demonstrate how to avoid some boilerplate with the FreeK library.
Rhino Mocks is a .NET mocking framework that allows developers to easily create and setup mock objects to test interactions using unit tests. It generates both mocks, which allow expectations to be set and verified, and stubs, which simply return preset values without verification. The document provides examples of using Rhino Mocks to generate mocks and stubs of interfaces, set expectations on mocks, and verify mock interactions using the AAA (Arrange, Act, Assert) syntax. It also distinguishes between mocks and stubs.
Operators in Java provide symbols that operate on arguments to produce results. The document discusses the different types of operators in Java including assignment, arithmetic, relational, logical, bitwise, and ternary operators. Examples are provided to demonstrate the usage of various operators like increment/decrement, arithmetic, relational, logical, bitwise, ternary, and instanceof operators in Java code.
This document provides an overview of writing simple Java programs. It introduces key Java concepts like objects, classes, methods, and standard library classes.
The first program example displays a window using the JFrame class. Object declaration and creation are described. Standard classes like JOptionPane, String, Date, and SimpleDateFormat are presented.
Program development is explained using an incremental approach. Comments, imports, and class/method declarations are covered. Object-oriented concepts like objects, messages, and dependencies are illustrated in program diagrams.
This document provides an overview of the Java Collections Framework. It discusses the main interfaces like Collection, List, Set, Map and their implementing classes like ArrayList, LinkedList, HashSet, TreeSet, HashMap, and TreeMap. It also covers topics like iterators, choosing appropriate collections, and using stacks, queues and priority queues. Examples are provided to demonstrate working with sets, maps, and using collections for problems like spell checking. The document aims to teach how to use the collection classes provided in the Java library and choose appropriate collections to solve programming problems.
The document outlines a Java programming practical course covering various Java concepts and programs. It includes 40 practical programs to be completed ranging from basic programs to find area of a circle, factorial of a number to more advanced programs involving OOP concepts like inheritance, abstraction, exception handling and multithreading. It also provides the evaluation and marking scheme for the practical exam.
This document provides an overview of beginning native Android app development. It discusses Android app structure including the manifest, activities, intents and lifecycles. It also covers common Android views and layouts, accessing device capabilities like the camera and location, working with data via content providers, and rendering with OpenGL. Example code is provided for various app features like input handling, scrollable lists, and camera access. The document concludes with the process for submitting an app to the Google Play Store.
This document discusses creating an MVC application from scratch using LINQ to SQL to perform CRUD operations on a database. It covers:
1. Creating an empty MVC project and adding controllers, views and models
2. Creating a sample database and using LINQ to SQL for communication between the MVC app and database
3. Performing CRUD operations in the MVC app by querying the database and passing data between controllers and views
This document provides instructions on how to create a basic "Hello Widget" Android widget app. It discusses creating a new Android project, designing the widget layout with XML, adding code to the AppWidgetProvider to handle updates, and testing the widget. It also provides an example of adding interactivity by coding buttons on the widget and handling button clicks by launching an activity. The document history section lists the document versions and authors.
This document provides instructions on how to create a basic "Hello Widget" Android widget app. It discusses creating a new Android project, designing the widget layout with XML, adding code to the manifest file, and creating an AppWidgetProvider class. It then expands on this with two examples - one that displays the current time by updating every second, and one that shows how to add buttons to a widget and handle button clicks.
Android activity, service, and broadcast recieversUtkarsh Mankad
The document provides an overview of creating a basic "Hello World" Android application. It discusses creating a new Android project, the typical project file structure including the src, res, assets, and AndroidManifest.xml files. It also summarizes the purpose of activities, services, and broadcast receivers as core Android application components.
How To Integrate Native Android App With React Native.Techugo
The popularity of React Native Technology cannot be contained. The growing inclination of the app industry towards this cross-platform technology has triggered the curiosity of many domains. Therefore, we need to learn more about related development concepts. So today, let us learn the way to integrate Native Android App with React Native!
React Native mobile app development is emerging out to be an exciting opportunity for businesses. It not only offers pocket-friendly choices, but it also reduces the development time. If you want to upheave your revenue funnel then connect with our experienced professionals who can guide you in the right direction.
The document discusses renaming features in Visual Studio 2015. It describes how VS2015 provides renaming assistance through suggestions from the light bulb icon and previews changes before renaming. The renaming window allows renaming variables, methods, properties, classes, parameters and strings. It can also rename code comments and detect conflicts if the new name already exists. Renaming occurs inline and on the fly. The examples demonstrate renaming a variable, method, and parameter across multiple files. VS2015 helps optimize code through intelligent and automated renaming.
Information on an Appcelerator Alloy project demonstrating the use of a restApi sync adapter along with Model/Collection Databinding to a TableView
Complete Project here on Github: https://github.com/aaronksaunders/scs-backbonetest1
This document provides instructions for connecting an SQLite database to an Android application using Android Studio. It describes creating a database using SQLite Manager and placing it in the Android project's assets folder. It then explains creating a Connection class with paths to the database folder and file. The document outlines creating a DataDB class to connect to the Connection class and calling getNameDB in the MainActivity to retrieve the database name. It provides code snippets for the Connection and DataDB classes.
This document provides an overview of React Native, Redux, and ES6 concepts. It begins with an introduction to React Native fundamentals like components, props vs state, and styling. It then covers Redux terminology such as actions, reducers, and middleware. Finally, it discusses ES6 features like arrow functions, destructuring, and template literals. Code examples and links to documentation are provided throughout for illustrating key concepts.
This document discusses different types of adapters and lists in Android. It begins by explaining adapters and the two main types: ArrayAdapter and SimpleCursorAdapter. It then describes an exercise to create a student grades application using a list view, auto-complete text view, and custom list. The last section discusses four methods for implementing a custom list adapter: 1) using a LayoutInflater, 2) recycling views, 3) using a ViewHolder, and 4) using a RecyclerView. The document provides code examples for creating adapters and lists in each case.
XCode Templates tutorial – How To Create Custom Template Step By Step.pdfSatawareTechnologies6
Xamarin, Ionic and React Native app development has extended been butting heads in a bid to become the go-to agenda for cross-platform mobile app development. We have completed a little research to discover out which is on top app development now.
This document provides instructions for creating a simple tasklist application using ASP.NET MVC. It describes creating the controller, views, database, and model. The controller contains actions for listing, creating, and completing tasks. Views are created for displaying the task list and creating new tasks. A database with a Tasks table is set up using LINQ to SQL. Logic is added to the controller actions to retrieve and save tasks from the database. The task list view is modified to display tasks from the model.
Angular 7 Firebase5 CRUD Operations with Reactive FormsDigamber Singh
This document discusses how to create Angular 7 Firebase5 CRUD operations using Reactive Forms. It involves setting up a student record management system where an admin can create, read, update and delete student records. The key steps include setting up an Angular project with Bootstrap and Firebase, creating CRUD services, generating components, setting up routing, and integrating modules like NGX Toastr for alerts.
Learn React hooks best practices which you should follow in 2022. You will know the some of the best tricks to use the React hooks in 2022. Read the complete article for more insights.
AngularJS is a JavaScript framework that makes building and maintaining web apps simple. The document demonstrates building a simple AngularJS app in 5 steps: 1) Create an Angular module, 2) Add the ng-app directive to define the app scope, 3) Create a controller and attach properties to $scope, 4) Add the ng-controller directive to define the controller scope, 5) Access properties in the view using expressions. The controller is updated to change the title and add a promo text, which are then displayed in the view.
Project Management Semester Long Project - Acuityjpupo2018
Acuity is an innovative learning app designed to transform the way you engage with knowledge. Powered by AI technology, Acuity takes complex topics and distills them into concise, interactive summaries that are easy to read & understand. Whether you're exploring the depths of quantum mechanics or seeking insight into historical events, Acuity provides the key information you need without the burden of lengthy texts.
Generating privacy-protected synthetic data using Secludy and MilvusZilliz
During this demo, the founders of Secludy will demonstrate how their system utilizes Milvus to store and manipulate embeddings for generating privacy-protected synthetic data. Their approach not only maintains the confidentiality of the original data but also enhances the utility and scalability of LLMs under privacy constraints. Attendees, including machine learning engineers, data scientists, and data managers, will witness first-hand how Secludy's integration with Milvus empowers organizations to harness the power of LLMs securely and efficiently.
In the rapidly evolving landscape of technologies, XML continues to play a vital role in structuring, storing, and transporting data across diverse systems. The recent advancements in artificial intelligence (AI) present new methodologies for enhancing XML development workflows, introducing efficiency, automation, and intelligent capabilities. This presentation will outline the scope and perspective of utilizing AI in XML development. The potential benefits and the possible pitfalls will be highlighted, providing a balanced view of the subject.
We will explore the capabilities of AI in understanding XML markup languages and autonomously creating structured XML content. Additionally, we will examine the capacity of AI to enrich plain text with appropriate XML markup. Practical examples and methodological guidelines will be provided to elucidate how AI can be effectively prompted to interpret and generate accurate XML markup.
Further emphasis will be placed on the role of AI in developing XSLT, or schemas such as XSD and Schematron. We will address the techniques and strategies adopted to create prompts for generating code, explaining code, or refactoring the code, and the results achieved.
The discussion will extend to how AI can be used to transform XML content. In particular, the focus will be on the use of AI XPath extension functions in XSLT, Schematron, Schematron Quick Fixes, or for XML content refactoring.
The presentation aims to deliver a comprehensive overview of AI usage in XML development, providing attendees with the necessary knowledge to make informed decisions. Whether you’re at the early stages of adopting AI or considering integrating it in advanced XML development, this presentation will cover all levels of expertise.
By highlighting the potential advantages and challenges of integrating AI with XML development tools and languages, the presentation seeks to inspire thoughtful conversation around the future of XML development. We’ll not only delve into the technical aspects of AI-powered XML development but also discuss practical implications and possible future directions.
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.
Salesforce Integration for Bonterra Impact Management (fka Social Solutions A...Jeffrey Haguewood
Sidekick Solutions uses Bonterra Impact Management (fka Social Solutions Apricot) and automation solutions to integrate data for business workflows.
We believe integration and automation are essential to user experience and the promise of efficient work through technology. Automation is the critical ingredient to realizing that full vision. We develop integration products and services for Bonterra Case Management software to support the deployment of automations for a variety of use cases.
This video focuses on integration of Salesforce with Bonterra Impact Management.
Interested in deploying an integration with Salesforce for Bonterra Impact Management? Contact us at sales@sidekicksolutionsllc.com to discuss next steps.
Building Production Ready Search Pipelines with Spark and MilvusZilliz
Spark is the widely used ETL tool for processing, indexing and ingesting data to serving stack for search. Milvus is the production-ready open-source vector database. In this talk we will show how to use Spark to process unstructured data to extract vector representations, and push the vectors to Milvus vector database for search serving.
Best 20 SEO Techniques To Improve Website Visibility In SERPPixlogix Infotech
Boost your website's visibility with proven SEO techniques! Our latest blog dives into essential strategies to enhance your online presence, increase traffic, and rank higher on search engines. From keyword optimization to quality content creation, learn how to make your site stand out in the crowded digital landscape. Discover actionable tips and expert insights to elevate your SEO game.
Have you ever been confused by the myriad of choices offered by AWS for hosting a website or an API?
Lambda, Elastic Beanstalk, Lightsail, Amplify, S3 (and more!) can each host websites + APIs. But which one should we choose?
Which one is cheapest? Which one is fastest? Which one will scale to meet our needs?
Join me in this session as we dive into each AWS hosting service to determine which one is best for your scenario and explain why!
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.
For the full video of this presentation, please visit: https://www.edge-ai-vision.com/2024/06/building-and-scaling-ai-applications-with-the-nx-ai-manager-a-presentation-from-network-optix/
Robin van Emden, Senior Director of Data Science at Network Optix, presents the “Building and Scaling AI Applications with the Nx AI Manager,” tutorial at the May 2024 Embedded Vision Summit.
In this presentation, van Emden covers the basics of scaling edge AI solutions using the Nx tool kit. He emphasizes the process of developing AI models and deploying them globally. He also showcases the conversion of AI models and the creation of effective edge AI pipelines, with a focus on pre-processing, model conversion, selecting the appropriate inference engine for the target hardware and post-processing.
van Emden shows how Nx can simplify the developer’s life and facilitate a rapid transition from concept to production-ready applications.He provides valuable insights into developing scalable and efficient edge AI solutions, with a strong focus on practical implementation.
5th LF Energy Power Grid Model Meet-up SlidesDanBrown980551
5th Power Grid Model Meet-up
It is with great pleasure that we extend to you an invitation to the 5th Power Grid Model Meet-up, scheduled for 6th June 2024. This event will adopt a hybrid format, allowing participants to join us either through an online Mircosoft Teams session or in person at TU/e located at Den Dolech 2, Eindhoven, Netherlands. The meet-up will be hosted by Eindhoven University of Technology (TU/e), a research university specializing in engineering science & technology.
Power Grid Model
The global energy transition is placing new and unprecedented demands on Distribution System Operators (DSOs). Alongside upgrades to grid capacity, processes such as digitization, capacity optimization, and congestion management are becoming vital for delivering reliable services.
Power Grid Model is an open source project from Linux Foundation Energy and provides a calculation engine that is increasingly essential for DSOs. It offers a standards-based foundation enabling real-time power systems analysis, simulations of electrical power grids, and sophisticated what-if analysis. In addition, it enables in-depth studies and analysis of the electrical power grid’s behavior and performance. This comprehensive model incorporates essential factors such as power generation capacity, electrical losses, voltage levels, power flows, and system stability.
Power Grid Model is currently being applied in a wide variety of use cases, including grid planning, expansion, reliability, and congestion studies. It can also help in analyzing the impact of renewable energy integration, assessing the effects of disturbances or faults, and developing strategies for grid control and optimization.
What to expect
For the upcoming meetup we are organizing, we have an exciting lineup of activities planned:
-Insightful presentations covering two practical applications of the Power Grid Model.
-An update on the latest advancements in Power Grid -Model technology during the first and second quarters of 2024.
-An interactive brainstorming session to discuss and propose new feature requests.
-An opportunity to connect with fellow Power Grid Model enthusiasts and users.
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
TrustArc Webinar - 2024 Global Privacy SurveyTrustArc
How does your privacy program stack up against your peers? What challenges are privacy teams tackling and prioritizing in 2024?
In the fifth annual Global Privacy Benchmarks Survey, we asked over 1,800 global privacy professionals and business executives to share their perspectives on the current state of privacy inside and outside of their organizations. This year’s report focused on emerging areas of importance for privacy and compliance professionals, including considerations and implications of Artificial Intelligence (AI) technologies, building brand trust, and different approaches for achieving higher privacy competence scores.
See how organizational priorities and strategic approaches to data security and privacy are evolving around the globe.
This webinar will review:
- The top 10 privacy insights from the fifth annual Global Privacy Benchmarks Survey
- The top challenges for privacy leaders, practitioners, and organizations in 2024
- Key themes to consider in developing and maintaining your privacy program
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.
Your One-Stop Shop for Python Success: Top 10 US Python Development Providers
Volley lab btc_bbit
1. Volley Lab: ICS and BTC
Instructor: Stanslaus Mwongela
Core Knowledge
1. Make an API call to a github ENDPOINT with Volley
2. Process the JSON data returned as response
3. Arrange and display the response on RecyclerView with Cardviews
Additional side knowledge to gain in this tutorial will be
How to populate the RecyclerView with Cards
How to parse an image response data to a View with Picasso
First off, what we’ll be building in this lab is an android app that will make a request
to get a list of java developers in Nairobi from github using this API ENDPOINT
private static final string URL_DATA=
“https://api.github.com/search/users?q=language:java+location:nairobi";
We will then proceed to display the contents (developers image, developers username
and developer git URL) on the RecyclerView with cards (CardView).
This is a visual idea of what we’ll be building, just to feed your subconscious mind the
end product
2. Set Up
First off, launch android studio and create a new project [File > New > New
Project]. While setting up your project feel free to give your project any name of your
choice, in my case I’ll name it My Volley.
Once your project has finished building, you’ll need to add some dependencies to your
app level Gradle file [app > build.gradle] then locate the dependency block and add
these dependencies.
implementation 'com.google.android.material:material:1.1.0'
implementation 'androidx.cardview:cardview:1.0.0'
implementation 'com.android.volley:volley:1.1.0'
implementation 'com.squareup.picasso:picasso:2.5.2'
Then set internet permissions in the manifest file.
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.mwongela.myvolley">
<uses-permission android:name="android.permission.INTERNET" />
<application
android:allowBackup="true"
android:icon="@mipmap/ic_launcher"
android:label="@string/app_name"
Layout
By default you already have activity_main.xml [res > layout >
activity_main.xml] this is the layout that will hold the RecyclerView, so set the
layout to RelativeLayout initialize the RecyclerView here.
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
tools:context=".MainActivity">
<androidx.recyclerview.widget.RecyclerView
android:id="@+id/recycler_view"
android:layout_width="match_parent"
android:layout_height="match_parent"
/>
</RelativeLayout>
Open the MainActivity.java file and initialize the RecyclerView in the on create method
and find it by the id you assigned to it in the activity_main.xml file. In my case I set it’s
3. id to be “recyler_view” according to the snippet above. So open your MainActivity and
do this:
public class MainActivity extends AppCompatActivity {
//declare the recycler view
private RecyclerView recyclerView;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
//Initialize the recycler view
recyclerView=findViewById(R.id.recycler_view);
recyclerView.setHasFixedSize(true);
recyclerView.setLayoutManager(new LinearLayoutManager(this));
Now we have the RecyclerView set, for the items that will be in the RecyclerView, we’ll
create another layout resource file that will store the data in a CardView and then use
the cards to populate the RecyclerView.
Create a new layout resource file [app > res > layout > New > layout resource
file] and name it developers_list.xml.
4. We have created a layout resource file and specified its root view as linear layout.
Next, we’ll create a CardView in the developers_list.xml to hold the contents that will
be displayed to a user. Inside the card view we will nest a linear layout to specify the
order of displaying details of a particular developer.
Below is the Screen shot of developer_list.xml layout resource file.
5. Now, we are done with the two layout files (activity_main and developer_list). To
actually get the data with which we’ll populate our developer_list file, we need to create
a java class for it ,this is what we call a model class.
6. Name the Java class as you deem fit, in my case I called this java class DevelopersList
and set it up like this
So here we define 3 String variables “login” to hold the developers name, “avatar_url”
to hold the developers image url and “html_url” to hold the developers github url.
We then initialized them and generated their getters and constructors since we’ll be
making use of them in the DevelopersAdapter class.
The Adapter
P.S: If this is hard to follow please revisit the video I shared for creating recycler view
adapter on e-learning.
Android uses adapters (from the Adapter class) to connect data with View items in a
list. There are many different kinds of adapters available, and you can also write
custom adapters. In this task you will create an adapter that associates your list of
words with word list View items.
To connect data with View items, the adapter needs to know about the View items. The
adapter uses a ViewHolder that describes a View item and its position within
the RecyclerView.
First, we will build an adapter that bridges the gap between the data in your Developer
list and the RecyclerView that displays it:
1. Right-click java/com.android.example.recyclerview and select New >
Java Class.
2. Name the class DevelopersAdapter.
3. Give DevelopersAdapter the following signature:
7. DevelopersAdapter extends a generic adapter for RecyclerView to use a View holder
that is specific for your app and defined inside DevelopersAdapter. ViewHolder shows
an error, because you have not yet defined it.
4. Click the class declaration (DevelopersAdapter), then click the red light bulb on
the left side of the pane. Choose Implement methods.
A dialog appears that asks you to choose which methods to implement. Choose all
three methods and click OK.
Android Studio creates empty placeholders for all the methods. Note
how onCreateViewHolder and onBindViewHolder both reference the ViewHolder,
which hasn't been implemented yet.
Create the ViewHolder for the adapter
To create the ViewHolder, follow these steps:
1. Inside the DevelopersAdapter class, add a new ViewHolder inner class with this
signature:
public class ViewHolder extends RecyclerView.ViewHolder { }
You will see an error about a missing default constructor. You can see details about the
errors by hovering your mouse cursor over the red-underlined code or over any red
horizontal line on the right margin of the editor pane. Ensure you add this constructor.
2. Add variables to the ViewHolder inner class for the developer name TextView,
developer ImageView, developer GitHub Url and the Linear Layout that
contained this three items(we will set a on click listener to this linear layout later)
Then initialize this variables in the constructor of the ViewHolder class;
public class ViewHolder extends RecyclerView.ViewHolder {
//Define the view objects
public TextView login;
public ImageView avatar_url;
public TextView html_url;
public LinearLayout linearLayout;
//the constructor
public ViewHolder(@NonNull View itemView) {
super(itemView);
//initialize view objects
login=itemView.findViewById(R.id.username);
avatar_url=itemView.findViewById(R.id.imageView);
html_url=itemView.findViewById(R.id.html_url);
linearLayout=itemView.findViewById(R.id.linearLayout);
}
}
8. Storing your data in the adapter
You need to hold your data in the adapter, and DevelopersAdapter needs a constructor
that initializes the developers list from the data. Follow these steps:
1. To hold your data in the adapter, create a private list of DevelopersList(model Java
Class) in DevelopersAdapter and call it developerList. Additionally create a private
member variable for providing the context and call it mContext
public class DevelopersAdapter extends
RecyclerView.Adapter<DevelopersAdapter.ViewHolder> {
//declare DeveloperList private member variable
private List<DeveloperList> developerList;
//context variable
private Context mContext;
2. You can now fill in the getItemCount() method to return the size of developerList:
@Override
public int getItemCount() {
//return the size of developer list
return developerList.size();
}
3. Implement the constructor for DevelopersAdapter. The constructor needs to have
a context parameter, and a List of developers which will be fetched remotely.
public DevelopersAdapter(List<DeveloperList>developerList,
Context context){
this.developerList=developerList;
this.mContext=context;
}
4. Fill out the onCreateViewHolder() method with this code:
public DevelopersAdapter.ViewHolder onCreateViewHolder(@NonNull
ViewGroup parent, int viewType) {
return new
ViewHolder(LayoutInflater.from(parent.getContext()).inflate(
R.layout.developer_list,parent,false));
}
The onCreateViewHolder() method is similar to the onCreate() method. It inflates
the developer_list layout, and returns a ViewHolder with the layout and the
adapter.
5. Fill out the onBindViewHolder() method with the code below:
public void onBindViewHolder(@NonNull DevelopersAdapter.ViewHolder holder, final int
position) {
//create a variable that get the current instance of the developer in the list
final DeveloperList currentDeveloper=developerList.get(position);
// populate the text views and image view with data
holder.login.setText(currentDeveloper.getLogin());
holder.html_url.setText(currentDeveloper.getHtml_url());
//Use the library Picasso to load images to prevent crashing..laoding images is
9. resource intensive
Picasso.with(mContext)
.load(currentDeveloper.getAvatar_url())
.into(holder.avatar_url);
The onBindViewHolder () method connects your data to the view holder.
* @param holder Refers to the ViewHolder into which the data should be put.
* @param position Refers to the adapter position.
6. Run your app to make sure that there are no errors.
Fetching the remote json data.
First off this is the structure of the json data we’ll be returning
Check this link
https://api.github.com/search/users?q=language:java+location:nairobi
As seen the data is in JSON format with other {Json Objects} all wrapped in a [Json
Array], so we’ll be returning the data in the same format. However we are not
particularly interested in all the keys of the objects, we only need the login, the html_url
and the avatar_url. These are the variables we defined in the DevelopersList class.
So we’ll be parsing the respective values to their corresponding variables.
Goto MainActivity and define a String variable for the api private static final String
URL_DATA = “api-url here”;
public class MainActivity extends AppCompatActivity {
//api
private static final String URL_DATA =
"https://api.github.com/search/users?q=language:java+location:nairobi";
Additionally create instances of the developer adapter and developer list you defined.
public class MainActivity extends AppCompatActivity {
//api
private static final String URL_DATA =
"https://api.github.com/search/users?q=language:java+location:nairobi";
//declare the recycler view
private RecyclerView recyclerView;
//declare the adapter
private DevelopersAdapter myAdapter;
//declare the Developers List
private List<DeveloperList> developerList;
Initialize the developers list in the on create method...this list will hold the contents of
our remote JSON and pass it to recycler view
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
//Initialize the recycler view
recyclerView=findViewById(R.id.recycler_view);
10. recyclerView.setHasFixedSize(true);
recyclerView.setLayoutManager(new LinearLayoutManager(this));
//Initialize the developers list...THIS LIST WILL HOLD THE CONTENTS OF OUR REMOTE JSON
AND PASS IT TO RECYCLERVIEW
developerList= new ArrayList<>();
loadUrlData();
}
Now, create a method loadUrlData() to fetch the url data for the RecyclerView and we’ll
call this method in the onCreate() .
private void loadUrlData(){
final ProgressDialog progressDialog = new ProgressDialog(this);
progressDialog.setMessage("Loading....");
progressDialog.show();
StringRequest stringRequest = new StringRequest(Request.Method.GET, URL_DATA, new
Response.Listener<String>() {
@Override
public void onResponse(String response) {
Log.w("res","Response:" + response);
progressDialog.dismiss();
try {
JSONObject jsonObject = new JSONObject(response);
JSONArray array = jsonObject.getJSONArray("items");
for (int i = 0; i < array.length(); i++) {
JSONObject jo = array.getJSONObject(i);
DeveloperList developers = new DeveloperList(jo.getString("login"),
jo.getString("html_url"), jo.getString("avatar_url"));
developerList.add(developers);
Log.d("res","developers"+ developers);
}
myAdapter = new DevelopersAdapter(developerList, getApplicationContext());
recyclerView.setAdapter(myAdapter);
} catch (JSONException e) {
e.printStackTrace();
}
Log.d("Tag",response);
}
}, new Response.ErrorListener() {
@Override
public void onErrorResponse(VolleyError error) {
Toast.makeText(MainActivity.this,"Error"+
error.toString(),Toast.LENGTH_SHORT).show();
}
});
RequestQueue requestQueue = Volley.newRequestQueue(this);
requestQueue.add(stringRequest);
}
This is a lot of code in one block, yeah I know so am going to try and explain what is
going in this block and hopefully you’ll get it. So we start by using StringRequest (From
the volley dependency) to define the request and RequestQueue to then send the
request. We then create an instance of the DevelopersList to store the individual objects
we’ll be getting from the items Array.
Once the request is sent, we need to display a progress dialog to keep the user engaged
while the task is performed. So we initialize the ProgressDialog globally and define it
inside the loadUrlData() method.
11. We’ll then process the JSON file that will be returned so we can easily parse it into the
defined variables we’ve already set for them. So we create a new JSONObject and pass
in (response) as a parameter, then surround it with (try and catch) to catch all the
possible exceptions. Next we define a JSONArray from the jsonObject we just created,
this is to enable us gain access to the “items” array inside the jsonObject thus we’ll pass
in “items” as a parameter.
Now we have the array, to get the data we want from the array, we’ll need a for-loop,
like the one we defined in the snippet above. This is to enable us get the data from the
array according to their index. Inside the loop, we create another JSONObject that will
allow us get data from the array according to the current index.
Next we create a DevelopersList object called developers and pass in the data we’ll be
getting from the jsonObject(o) as parameters with the getString method. This will get
the data as a String and save it to the corresponding variable as earlier defined in the
DevelopersList class. When this is all done, we then add the list into developersLists.
Then after the loop, we create the adapter and pass in the developersLists and the
application context as its parameters, after which we’ll set it as the RecyclerView
adapter.
The Profile Activity
So far we’ve been able to set up our layouts, used volley StringRequest and
RequestQueue to define and send our request, we’ve fetched the data from the server
and set it to display on the layout. Next we’ll handle what happens when an item is
clicked on the list. What we want is to have an intent that will launch a profile page for
every developer clicked on.
So first we create a new empty activity for profiles, call it ProfileActivity. This will be
the profile page for every developer, we’ll use an intent to pass their information from
the developerslist to this profile page and display their image, username (login) and
github link (html_url). We’ll also add a share button that will use intent to share their
profile with some hardcoded messages on other apps.
1. Create an activity using empty activity template and name the Activity : Profile
Activity
2. Create the layout for the Profile activity.
This is how the layout for the profile activity should look like
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:padding="16dp"
android:background="#FFFFFF"
android:orientation="vertical"
tools:context=".ProfileActivity">
<androidx.cardview.widget.CardView
android:layout_width="match_parent"
android:layout_height="0dp"
android:layout_weight="2"
13. another Relative layout to hold the developers gihub link (html_url) and the share
button. So basically we have 3 new views and a button, we’ll initialize them with their
id’s in the onCreate method of the profile activity
public class ProfileActivity extends AppCompatActivity {
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_profile);
//Initialize the views using the ID's you set in activity_profile.xml
ImageView profileImageView = findViewById(R.id.profileImageView);
TextView userNameTextView = findViewById(R.id.usernameTextView);
ImageButton shareProfile = findViewById(R.id.shareProfile);
TextView developerUrl = findViewById(R.id.developerUrl);
Handling Intents
We need to be able to pass data from the MainActivity to the ProfileActivity since we’ll
be displaying the developers image, username and link (in their profile page). Notice
that we defined 3 global static variables (KEY_NAME, KEY_IMAGE and KEY_URL)
in the DevelopersAdapter class.
public class DevelopersAdapter extends RecyclerView.Adapter<DevelopersAdapter.ViewHolder> {
//declare DeveloperList private member variable
private List<DeveloperList> developerList;
//context variable
private Context mContext;
//Keys for our intents
public static final String KEY_NAME = "name";
public static final String KEY_IMAGE = "image";
public static final String KEY_URL = "url";
These variables will help us achieve that task. So in the onBindVieHolder method inside
the DevelopersAdapter class, we’ll set an OnClickListener on the linear layout holding
the CardViews so that upon clicking any card on the RecyclerView, it’ll open the profile
page of the developer on that card with an Intent.
public void onBindViewHolder(@NonNull DevelopersAdapter.ViewHolder holder, final int
position) {
//create a variable that get the current instance of the developer in the list
final DeveloperList currentDeveloper=developerList.get(position);
// populate the text views and image view with data
holder.login.setText(currentDeveloper.getLogin());
holder.html_url.setText(currentDeveloper.getHtml_url());
//Use the library Picasso to load images to prevent crashing..laoding images is
resource intensive
Picasso.with(mContext)
.load(currentDeveloper.getAvatar_url())
.into(holder.avatar_url);
//Set on click listener to handle click events
holder.linearLayout.setOnClickListener(new View.OnClickListener() {
@Override
//ensure you override the onClick method
public void onClick(View v) {
//create an instance of the developer list and initialize it
DeveloperList developersList1 = developerList.get(position);
//create an intent and specify the target class as Profile Activity
Intent skipIntent = new Intent(v.getContext(), ProfileActivity.class);
//Use intent EXTRA TO Pass data from Main Activity to Profile Activity
14. skipIntent.putExtra(KEY_NAME, developersList1.getLogin());
skipIntent.putExtra(KEY_URL, developersList1.getHtml_url());
skipIntent.putExtra(KEY_IMAGE, developersList1.getAvatar_url());
v.getContext().startActivity(skipIntent);
}
});
}
So to achieve this we’ll define an object of the DevelopersList class inside the
OnClickListener and get the values we need from it (developersList1). Then we save
these values (Login, Html_url and Avatar_url) into the global static variables
(KEY_NAME, KEY_URL and KEY_IMAGE) so that we can get the values from
them in the ProfileActivity. To open the ProfileActivity we create an Intent (in this
context) which I called skipIntent and put the values into the static variables.
Getting the Intents
In the ProfileActivity java class, we’ll create an intent to get these values from the
holding variables and set them into the display String variables we’ve defined. For the
image we’ll still use Picasso to display it on the imageView of the profile page. So in the
onCreate() of the ProfileActivity java file add:
//Getting the intents send from main Activity
Intent intent = getIntent();
final String userName = intent.getStringExtra(DevelopersAdapter.KEY_NAME);
String image = intent.getStringExtra(DevelopersAdapter.KEY_IMAGE);
final String profileUrl = intent.getStringExtra(DevelopersAdapter.KEY_URL);
//Setting the views
Picasso.with(this)
.load(image)
.into(profileImageView);
userNameTextView.setText(userName);
developerUrl.setText(profileUrl);
Recall we’ve set the id’s of the TextView in the ProfileActivity layout file to
userNameTextView and developerUrl . so here we just set the Texts on them whilst
displaying the image on the profileImageView with Picasso.
Handling OnItem Clicks
Then we want to launch the browser to load the developers github profile page upon
clicking the developerUrl on the profile page so we set an onClickListener on the
developerUrl.
//set on click listener to developerUrl so as to open the developer link using implicit
intent
developerUrl.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
String url = profileUrl;
Intent i = new Intent(Intent.ACTION_VIEW);
i.setData(Uri.parse(url));
startActivity(i);
15. }
});
The last functionality we want for the app is to have a button in the Profile page that
will share the contents of the profile page via other social media apps, so we’ll define
the intent to handle this with an onClickListener on the button.
//set onclickLister to the image button shareProfile and implement implicit intent for
sharing developers profile
shareProfile.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
Intent shareIntent = new Intent(Intent.ACTION_SEND);
shareIntent.setType("text/plain");
shareIntent.putExtra(Intent.EXTRA_TEXT, "Check out this awesome developer " +
userName +
", " + profileUrl);
Intent chooser = Intent.createChooser(shareIntent, "Share via");
if (shareIntent.resolveActivity(getPackageManager()) != null) {
startActivity(chooser);
}
}
});
We have achieved all we set out to do in this tutorial, we’ve successfully built an android
app that returns a list of java developers from a github api and parse it to a RecyclerView
with CardViews.
Coding Challenge:
1. Redo the Lab using Retrofit Library.
2. Create the REST API for your group project and connect your Android Client to
your remote Server.
Copy protected with Online-PDF-No-Copy.com