The workshop deals with the design and implementation of applications for mobile devices using the Android operating system. Participants work at all stages of the development life-cycle from inception to deployment, whilst considering usability and device capabilities for a mobile application capable of meeting a functional specification. Participants are introduced to the programming environment for application development and have a hands-on approach to programming using the appropriate programming languages.
Bsc cs ii-dbms- u-ii-database system concepts and architectureRai University
This document discusses database system concepts and architecture. It describes data models, schemas and instances. It explains the three-schema architecture which defines schemas at the internal, conceptual and external levels. It also discusses database languages and interfaces used to define schemas and manipulate data. The document outlines the typical components of a database management system and compares centralized and client/server architectures.
Heatmiser heating controls catalogue 2016. All you need for controlling your boiler system. Full range at Plumb4Less http://plumb4less.co.uk/index.php?cPath=27_27&osCsid=ojo58a02a022ji274t3n0pu462
1. The document discusses the basics of operating systems, including definitions, architecture, and booting process. It describes how an OS manages hardware and software resources and acts as an interface between users, applications, and hardware.
2. The key components of an OS architecture include the user, user applications, system programs, the operating system itself, and underlying hardware. The booting process involves POST, BIOS initialization, and loading the operating system kernel into memory.
3. The document provides several examples of OS functions like process management, memory management, file management, I/O management, security, and user interfaces. It also discusses different types of OSs such as batch, multiprogramming, time-sharing,
Course Code: CS-301
Course Title: Introduction to Computing.
Degree: BS (SE, CS, BIO)
Contents of this chapter:
Basic information about computer networks, types of computer networks. Other contents include:
1. List four major benefits of connecting computers to form a network.
2. Define the terms LAN, WAN, and MAN.
3. List the three types of networks.
4. Name the three physical topologies used to build networks.
DNS is a globally distributed database that translates domain names to IP addresses. It consists of a name space organized in a hierarchical tree structure, servers that store data about parts of the name space, and resolvers that query servers to map names to addresses. The resolution process involves recursively querying servers at higher levels, like root and TLD servers, until reaching an authoritative name server that can provide the address. Caching improves performance by storing previous lookups.
HTTP is an application-level protocol for transmitting hypermedia documents across the internet. It uses a client-server model with requests containing a method, URL, and protocol version, and responses containing a status line and headers along with an optional body. Common methods include GET, POST, and HEAD. HTTP is stateless but can be made stateful through mechanisms like cookies.
The document provides an overview of database management systems (DBMS). It discusses DBMS applications, why DBMS are used, different users of databases, data models and languages like SQL. It also summarizes key components of a DBMS including data storage, query processing, transaction management and database architecture.
The document discusses different database system architectures including centralized, client-server, server-based transaction processing, data servers, parallel, and distributed systems. It covers key aspects of each architecture such as hardware components, process structure, advantages and limitations. The main types are centralized systems with one computer, client-server with backend database servers and frontend tools, parallel systems using multiple processors for improved performance, and distributed systems with data and users spread across a network.
Bsc cs ii-dbms- u-ii-database system concepts and architectureRai University
This document discusses database system concepts and architecture. It describes data models, schemas and instances. It explains the three-schema architecture which defines schemas at the internal, conceptual and external levels. It also discusses database languages and interfaces used to define schemas and manipulate data. The document outlines the typical components of a database management system and compares centralized and client/server architectures.
Heatmiser heating controls catalogue 2016. All you need for controlling your boiler system. Full range at Plumb4Less http://plumb4less.co.uk/index.php?cPath=27_27&osCsid=ojo58a02a022ji274t3n0pu462
1. The document discusses the basics of operating systems, including definitions, architecture, and booting process. It describes how an OS manages hardware and software resources and acts as an interface between users, applications, and hardware.
2. The key components of an OS architecture include the user, user applications, system programs, the operating system itself, and underlying hardware. The booting process involves POST, BIOS initialization, and loading the operating system kernel into memory.
3. The document provides several examples of OS functions like process management, memory management, file management, I/O management, security, and user interfaces. It also discusses different types of OSs such as batch, multiprogramming, time-sharing,
Course Code: CS-301
Course Title: Introduction to Computing.
Degree: BS (SE, CS, BIO)
Contents of this chapter:
Basic information about computer networks, types of computer networks. Other contents include:
1. List four major benefits of connecting computers to form a network.
2. Define the terms LAN, WAN, and MAN.
3. List the three types of networks.
4. Name the three physical topologies used to build networks.
DNS is a globally distributed database that translates domain names to IP addresses. It consists of a name space organized in a hierarchical tree structure, servers that store data about parts of the name space, and resolvers that query servers to map names to addresses. The resolution process involves recursively querying servers at higher levels, like root and TLD servers, until reaching an authoritative name server that can provide the address. Caching improves performance by storing previous lookups.
HTTP is an application-level protocol for transmitting hypermedia documents across the internet. It uses a client-server model with requests containing a method, URL, and protocol version, and responses containing a status line and headers along with an optional body. Common methods include GET, POST, and HEAD. HTTP is stateless but can be made stateful through mechanisms like cookies.
The document provides an overview of database management systems (DBMS). It discusses DBMS applications, why DBMS are used, different users of databases, data models and languages like SQL. It also summarizes key components of a DBMS including data storage, query processing, transaction management and database architecture.
The document discusses different database system architectures including centralized, client-server, server-based transaction processing, data servers, parallel, and distributed systems. It covers key aspects of each architecture such as hardware components, process structure, advantages and limitations. The main types are centralized systems with one computer, client-server with backend database servers and frontend tools, parallel systems using multiple processors for improved performance, and distributed systems with data and users spread across a network.
This document provides an overview of database system concepts and architecture. It discusses data models, schemas, instances, and states. It also describes the three-schema architecture, data independence, DBMS languages and interfaces, database system utilities and tools, and centralized and client-server architectures. Key classification of DBMSs are also covered.
This document discusses file processing systems and their components. It defines key terms like field, record, and file. It describes how a file processing system organizes and stores data in independent files of records without using databases. It classifies different types of files by their functions, such as master files, transaction files, report files, work files, program files, and text files. It outlines some advantages of file processing systems like lower costs and ease of use, as well as disadvantages like data redundancy, difficult data access, isolation, integrity, and security issues.
FellowBuddy.com is an innovative platform that brings students together to share notes, exam papers, study guides, project reports and presentation for upcoming exams.
We connect Students who have an understanding of course material with Students who need help.
Benefits:-
# Students can catch up on notes they missed because of an absence.
# Underachievers can find peer developed notes that break down lecture and study material in a way that they can understand
# Students can earn better grades, save time and study effectively
Our Vision & Mission – Simplifying Students Life
Our Belief – “The great breakthrough in your life comes when you realize it, that you can learn anything you need to learn; to accomplish any goal that you have set for yourself. This means there are no limits on what you can be, have or do.”
Like Us - https://www.facebook.com/FellowBuddycom
El documento describe el estándar IPSec, que proporciona servicios de seguridad a la capa IP. IPSec incluye dos protocolos (AH e ESP) que garantizan la integridad y autenticidad de los datos, y en el caso de ESP también la confidencialidad. También presenta IKE, un protocolo para la gestión de claves que permite a los nodos establecer una conexión segura. IPSec usa criptografía como DES, 3DES y algoritmos hash como MD5 y SHA-1.
Application software programs are designed to help users be more productive. There are different types of application software including packaged, custom, open source, shareware, and freeware. System software serves as the interface between users, application software, and computer hardware. Business software includes word processing, spreadsheet, database, presentation, project management, and accounting programs. Graphics and multimedia software encompasses CAD, desktop publishing, image editing, video/audio editing, and web authoring programs. Communication software facilitates instant messaging, newsgroups, FTP, video/audio conferencing, web browsers, and email.
A database is a collection of data that can be used alone or combined to answer users' questions. A database management system (DBMS) provides programs to manage databases, control data access, and include a query language. When designing a database, it is important to structure the data so that specific records can be easily accessed, the database can respond to different questions, minimal storage is used, and redundant data is avoided. Key concepts in database design include entities, attributes, records, primary keys, foreign keys, and relationships between tables.
CSS (Cascading Style Sheets) is a markup language used to style and lay out web documents. There are three types of CSS: external style sheets, internal style sheets, and inline styles. External style sheets are ideal for applying styles to many pages, internal style sheets are used for styling a single document with unique styles, and inline styles are applied directly to HTML elements but lose advantages of style sheets.
Computer Introduction-Lecture01 for applied scince college students, Seiyun University , yemen 2023-2024 Academic year. لطلاب كلية العلوم التطبيقية بجامعة سيئون
مقدمة في علوم الحاسوب المحاضرة الاولى مقدمة
This document provides an overview of different database management systems:
- It defines a database and DBMS, and describes their basic functions.
- It explains the features of a relational database including tables, rows, columns, primary keys and relationships.
- It describes object-oriented databases, including object identity, classes, inheritance and encapsulation.
- It discusses object-relational databases as putting an object-oriented front end on a relational database.
- It briefly covers advantages and disadvantages of relational, object-oriented and object-relational databases.
This document outlines the structure and content of a module on computer communications and networks. The module aims to provide an understanding of networking principles, technologies, and protocols. It is divided into four parts that cover: data transmission basics, packet transmission and local area networks, internetworking concepts and protocols like IP and TCP, and finally network applications. Assessment will involve a two hour written exam based on previous years' papers, with no coursework required.
O documento descreve o sistema operacional Debian 12 recém-lançado, incluindo seu lançamento em junho de 2023, suporte por 5 anos, ambientes de desktop suportados, mais de 64.000 pacotes disponíveis e atualizações, e instruções sobre como baixar e instalar o Debian 12.
The BIOS is low-level software that controls system hardware and acts as an interface between hardware and software. It is stored in a ROM chip and consists of drivers that interface hardware to the operating system. The BIOS performs a power-on self-test of hardware components, provides a setup utility to configure settings, loads the operating system boot sector to start the boot process, and includes basic input/output functions. Modern BIOS is stored in flash ROM which can be updated without removing the chip from the system.
This document discusses database fragmentation in distributed database management systems (DDBMS). Database fragmentation allows a single database object to be broken into multiple segments that can be stored across different sites on a network. This improves efficiency, security, parallelism, availability, reliability and performance. There are three main types of fragmentation: horizontal, vertical, and mixed. Horizontal fragmentation breaks data by attributes like location, vertical by attributes like departments, and mixed uses both. While fragmentation provides advantages, it also increases complexity, cost, and makes security and integrity control more difficult.
This document provides an overview of web technologies, including:
- Core technologies like web browsers, web servers, URIs, and HTTP.
- Client-side technologies like HTML, CSS, JavaScript, DOM, AJAX, and HTML5 for enhancing user interfaces.
- Server-side technologies like CGI, PHP, Java servlets, and JSPs for building dynamic web applications.
Primary memory, also known as main memory, is used to store data and instructions that the CPU is currently processing. It has limited capacity and is volatile, meaning data is lost when power is turned off. RAM and ROM are types of primary memory. Secondary memory is used for permanent storage and includes hard disks, CDs, DVDs. It has larger capacity but is slower to access. Memory is organized in a hierarchy with registers being fastest, then RAM, and finally secondary storage being slowest but able to store the most data.
Object relational database management systemSaibee Alam
this presentation provide a full explanation of object relational database management system. its a part of advanced database management system. important topic of computer science if you are UG/PG student or preparing for some competitive exam.
Web servers – features, installation and configurationwebhostingguy
A web server is a computer program and server that allows for hosting of websites and web applications. It accepts requests from browsers and returns HTML documents and other content. Common technologies used on web servers include CGI scripts, SSL security, and ASP to provide dynamic content and server-side processing. Web servers work by accepting connections from browsers, retrieving content from disk, running local programs, and transmitting data back to clients as quickly as possible while supporting threads and processes.
Overview of various types of operating systemUmme habiba
The operating system manages computer hardware and software resources, provides common services for programs, and comes in various types including single-tasking, multi-tasking, distributed, templated, embedded, and real-time. It performs functions like process management, memory management, I/O device management, file systems, protection and security, networking, and device drivers. Examples of operating systems include open source ones like UNIX and Linux, proprietary ones like Macintosh, and hybrid ones like Microsoft.
The document discusses the Domain Name System (DNS) and how it works. DNS is an internet directory service that maps hostnames to IP addresses, allowing users to use names instead of numbers. It uses a distributed, hierarchical system of name servers to perform this name resolution in a scalable way. DNS caches mappings for performance, starting queries at the highest level domains and following delegations between servers until the answer is found. DNS has become a major attack vector, so protection of DNS infrastructure and traffic is important.
The document discusses HTML frames, including:
1. Objectives such as creating frame layouts, controlling hyperlinks between frames, and using reserved target names.
2. Advantages of frames like flexibility in design and reducing redundancy. Disadvantages include increased loading time and some browsers not supporting frames.
3. Syntax for creating frame layouts using <frameset> tags and specifying frame sizes using pixels, percentages and asterisks.
It provides details on using frames and hyperlinks, including assigning names to frames and specifying link targets.
- Android is an open source operating system developed by Google that is used primarily for touchscreen mobile devices like smartphones and tablets. It is based on the Linux kernel and allows developers to write code using Java or Kotlin.
- The Android architecture consists of libraries and APIs on top of the Linux kernel, including a Dalvik virtual machine that executes applications. Apps are built using activities, fragments, intents and other components defined in the Android manifest file.
- Becoming an Android developer provides good career prospects with average salaries for entry-level positions around 3 lakhs per year in India. While Android has a huge user base, developing for its diverse ecosystem of devices can be challenging compared to platforms like iOS.
Tk2323 lecture 1 introduction to mobile applicationMengChun Lam
The document provides an introduction to a mobile application development course. It outlines topics that will be covered including Android architecture, mobile development considerations like device fragmentation and limited resources, and different app development methods like native, hybrid and web apps. It also introduces key mobile platforms like Android and iOS and how apps are distributed for each.
This document provides an overview of database system concepts and architecture. It discusses data models, schemas, instances, and states. It also describes the three-schema architecture, data independence, DBMS languages and interfaces, database system utilities and tools, and centralized and client-server architectures. Key classification of DBMSs are also covered.
This document discusses file processing systems and their components. It defines key terms like field, record, and file. It describes how a file processing system organizes and stores data in independent files of records without using databases. It classifies different types of files by their functions, such as master files, transaction files, report files, work files, program files, and text files. It outlines some advantages of file processing systems like lower costs and ease of use, as well as disadvantages like data redundancy, difficult data access, isolation, integrity, and security issues.
FellowBuddy.com is an innovative platform that brings students together to share notes, exam papers, study guides, project reports and presentation for upcoming exams.
We connect Students who have an understanding of course material with Students who need help.
Benefits:-
# Students can catch up on notes they missed because of an absence.
# Underachievers can find peer developed notes that break down lecture and study material in a way that they can understand
# Students can earn better grades, save time and study effectively
Our Vision & Mission – Simplifying Students Life
Our Belief – “The great breakthrough in your life comes when you realize it, that you can learn anything you need to learn; to accomplish any goal that you have set for yourself. This means there are no limits on what you can be, have or do.”
Like Us - https://www.facebook.com/FellowBuddycom
El documento describe el estándar IPSec, que proporciona servicios de seguridad a la capa IP. IPSec incluye dos protocolos (AH e ESP) que garantizan la integridad y autenticidad de los datos, y en el caso de ESP también la confidencialidad. También presenta IKE, un protocolo para la gestión de claves que permite a los nodos establecer una conexión segura. IPSec usa criptografía como DES, 3DES y algoritmos hash como MD5 y SHA-1.
Application software programs are designed to help users be more productive. There are different types of application software including packaged, custom, open source, shareware, and freeware. System software serves as the interface between users, application software, and computer hardware. Business software includes word processing, spreadsheet, database, presentation, project management, and accounting programs. Graphics and multimedia software encompasses CAD, desktop publishing, image editing, video/audio editing, and web authoring programs. Communication software facilitates instant messaging, newsgroups, FTP, video/audio conferencing, web browsers, and email.
A database is a collection of data that can be used alone or combined to answer users' questions. A database management system (DBMS) provides programs to manage databases, control data access, and include a query language. When designing a database, it is important to structure the data so that specific records can be easily accessed, the database can respond to different questions, minimal storage is used, and redundant data is avoided. Key concepts in database design include entities, attributes, records, primary keys, foreign keys, and relationships between tables.
CSS (Cascading Style Sheets) is a markup language used to style and lay out web documents. There are three types of CSS: external style sheets, internal style sheets, and inline styles. External style sheets are ideal for applying styles to many pages, internal style sheets are used for styling a single document with unique styles, and inline styles are applied directly to HTML elements but lose advantages of style sheets.
Computer Introduction-Lecture01 for applied scince college students, Seiyun University , yemen 2023-2024 Academic year. لطلاب كلية العلوم التطبيقية بجامعة سيئون
مقدمة في علوم الحاسوب المحاضرة الاولى مقدمة
This document provides an overview of different database management systems:
- It defines a database and DBMS, and describes their basic functions.
- It explains the features of a relational database including tables, rows, columns, primary keys and relationships.
- It describes object-oriented databases, including object identity, classes, inheritance and encapsulation.
- It discusses object-relational databases as putting an object-oriented front end on a relational database.
- It briefly covers advantages and disadvantages of relational, object-oriented and object-relational databases.
This document outlines the structure and content of a module on computer communications and networks. The module aims to provide an understanding of networking principles, technologies, and protocols. It is divided into four parts that cover: data transmission basics, packet transmission and local area networks, internetworking concepts and protocols like IP and TCP, and finally network applications. Assessment will involve a two hour written exam based on previous years' papers, with no coursework required.
O documento descreve o sistema operacional Debian 12 recém-lançado, incluindo seu lançamento em junho de 2023, suporte por 5 anos, ambientes de desktop suportados, mais de 64.000 pacotes disponíveis e atualizações, e instruções sobre como baixar e instalar o Debian 12.
The BIOS is low-level software that controls system hardware and acts as an interface between hardware and software. It is stored in a ROM chip and consists of drivers that interface hardware to the operating system. The BIOS performs a power-on self-test of hardware components, provides a setup utility to configure settings, loads the operating system boot sector to start the boot process, and includes basic input/output functions. Modern BIOS is stored in flash ROM which can be updated without removing the chip from the system.
This document discusses database fragmentation in distributed database management systems (DDBMS). Database fragmentation allows a single database object to be broken into multiple segments that can be stored across different sites on a network. This improves efficiency, security, parallelism, availability, reliability and performance. There are three main types of fragmentation: horizontal, vertical, and mixed. Horizontal fragmentation breaks data by attributes like location, vertical by attributes like departments, and mixed uses both. While fragmentation provides advantages, it also increases complexity, cost, and makes security and integrity control more difficult.
This document provides an overview of web technologies, including:
- Core technologies like web browsers, web servers, URIs, and HTTP.
- Client-side technologies like HTML, CSS, JavaScript, DOM, AJAX, and HTML5 for enhancing user interfaces.
- Server-side technologies like CGI, PHP, Java servlets, and JSPs for building dynamic web applications.
Primary memory, also known as main memory, is used to store data and instructions that the CPU is currently processing. It has limited capacity and is volatile, meaning data is lost when power is turned off. RAM and ROM are types of primary memory. Secondary memory is used for permanent storage and includes hard disks, CDs, DVDs. It has larger capacity but is slower to access. Memory is organized in a hierarchy with registers being fastest, then RAM, and finally secondary storage being slowest but able to store the most data.
Object relational database management systemSaibee Alam
this presentation provide a full explanation of object relational database management system. its a part of advanced database management system. important topic of computer science if you are UG/PG student or preparing for some competitive exam.
Web servers – features, installation and configurationwebhostingguy
A web server is a computer program and server that allows for hosting of websites and web applications. It accepts requests from browsers and returns HTML documents and other content. Common technologies used on web servers include CGI scripts, SSL security, and ASP to provide dynamic content and server-side processing. Web servers work by accepting connections from browsers, retrieving content from disk, running local programs, and transmitting data back to clients as quickly as possible while supporting threads and processes.
Overview of various types of operating systemUmme habiba
The operating system manages computer hardware and software resources, provides common services for programs, and comes in various types including single-tasking, multi-tasking, distributed, templated, embedded, and real-time. It performs functions like process management, memory management, I/O device management, file systems, protection and security, networking, and device drivers. Examples of operating systems include open source ones like UNIX and Linux, proprietary ones like Macintosh, and hybrid ones like Microsoft.
The document discusses the Domain Name System (DNS) and how it works. DNS is an internet directory service that maps hostnames to IP addresses, allowing users to use names instead of numbers. It uses a distributed, hierarchical system of name servers to perform this name resolution in a scalable way. DNS caches mappings for performance, starting queries at the highest level domains and following delegations between servers until the answer is found. DNS has become a major attack vector, so protection of DNS infrastructure and traffic is important.
The document discusses HTML frames, including:
1. Objectives such as creating frame layouts, controlling hyperlinks between frames, and using reserved target names.
2. Advantages of frames like flexibility in design and reducing redundancy. Disadvantages include increased loading time and some browsers not supporting frames.
3. Syntax for creating frame layouts using <frameset> tags and specifying frame sizes using pixels, percentages and asterisks.
It provides details on using frames and hyperlinks, including assigning names to frames and specifying link targets.
- Android is an open source operating system developed by Google that is used primarily for touchscreen mobile devices like smartphones and tablets. It is based on the Linux kernel and allows developers to write code using Java or Kotlin.
- The Android architecture consists of libraries and APIs on top of the Linux kernel, including a Dalvik virtual machine that executes applications. Apps are built using activities, fragments, intents and other components defined in the Android manifest file.
- Becoming an Android developer provides good career prospects with average salaries for entry-level positions around 3 lakhs per year in India. While Android has a huge user base, developing for its diverse ecosystem of devices can be challenging compared to platforms like iOS.
Tk2323 lecture 1 introduction to mobile applicationMengChun Lam
The document provides an introduction to a mobile application development course. It outlines topics that will be covered including Android architecture, mobile development considerations like device fragmentation and limited resources, and different app development methods like native, hybrid and web apps. It also introduces key mobile platforms like Android and iOS and how apps are distributed for each.
This is a basic crash course for android development covers:
Android Studio,Hello World Application,Application Components,Application Resources,User Interface,Good UI,Play Store
The document discusses Android application development. It provides an overview of the Android platform, including that it is an open source software stack for mobile devices powered by Linux. It describes the installation of development tools like Eclipse and the Android SDK. It then covers the basic building blocks for Android apps like activities, services, intents, and content providers.
The slides from the Java Meetup which was held in 12th of March 2015 at WSO2 Inc. Sri Lanka. Introduction to Android Development. By : Kasun Delgolla, Chathura Dilan And Inosh Perera, Engineers @ WSO2.
Android is a software stack for mobile devices created by Google. It includes an operating system, middleware and key applications. The Android SDK provides tools for developing Android applications in Java using the Eclipse IDE. Applications are deployed to devices or the Google Play store. Key aspects of Android development include designing user interfaces in XML, using layout managers, debugging apps in an emulator, and understanding the app folder structure and AndroidManifest file.
Android is a software stack developed by Google for building mobile apps. It includes an operating system, middleware, and key apps. Developers use the Android SDK and Eclipse IDE to build Android apps. The SDK includes tools like an emulator and debugger. Common Android versions include Cupcake, Donut, Eclair, Froyo, Gingerbread, Honeycomb, Ice Cream Sandwich, Jelly Bean, and KitKat. The emulator allows testing apps on a virtual mobile device without using a physical device.
This document provides instructions for setting up an environment for Android development. It discusses downloading and installing the Java Development Kit (JDK), Android SDK, and Android Studio. It also covers configuring a real Android device or emulator for testing apps. The document demonstrates creating a basic "Hello World" Android app in Android Studio and reviewing the underlying code and manifest file. It then briefly describes a more advanced app that scans for nearby WiFi access points when a button is pressed.
The document is a seminar report on Android and Android architecture. It discusses the history and introduction of Android, key aspects of the Android architecture including its layered design with the Linux kernel at the bottom and applications at the top, and describes Android versions, features, advantages, and disadvantages. It also covers the Open Handset Alliance and provides an overview of Android security.
Getting started with android dev and test perspectiveGunjan Kumar
The presentation covers basic intro to Android, how to get started with development, including instructions on setup, common UI usages like menus, dialogs; details on services like Sensors, Location and Google Maps
It also covers ideas on how to test including details on shell and installation instructions without using Eclipse
This document provides an overview of mobile application development with Android. It discusses the history of Android, including its origins and founders. It then defines Android as an open-source software platform based on Linux and allows developing apps using Java. The document outlines the major Android versions and highlights Android's features such as WiFi, Bluetooth, and various sensors. It also describes common Android app components like activities, services, content providers and broadcasts. Finally, the document summarizes Android's lifecycle methods and the process of passing data between activities.
TK2323 Lecture 1 - Introduction to Mobile Application.pdfLam Chun
This document provides an introduction to mobile application development. It outlines the course, including topics that will be covered such as basic Android app components, databases, APIs, permissions and sensors. It describes the class structure, which will involve lectures, labs, a group project and exams. Assessment will be based on lab assignments, a project, quizzes and an exam. The document also provides an overview of mobile platforms, app distribution methods, and development approaches such as native, web and hybrid.
Android is an open-source software stack for mobile devices comprising an operating system, middleware and key applications. It was founded in 2003 by Andy Rubin and later acquired by Google in 2005. The document then provides details of Android versions released from 1.1 to 6.0 including code names and key features added. It describes the architecture of Android comprising layers for the Linux kernel, libraries, runtime, framework and applications. Finally, it outlines the anatomy of Android applications including common folders and files.
This document provides an overview of mobile application development for Android. It discusses the Android platform architecture and application framework. The key application building blocks in Android like activities, intents, services and content providers are explained. It also describes the development tools and steps to create a simple "Hello World" application in Android. These include setting up the Android SDK, creating a new project in Eclipse, designing the UI layout and adding code to the activity. The document emphasizes that Android provides APIs for common tasks and uses the Java programming language for application development.
Android is an open source operating system used for mobile devices like smartphones and tablets. It is developed by Google and a consortium of technology companies called the Open Handset Alliance. Android allows developers to write programs in Java and offers tools to distribute apps to users. There are challenges to developing for Android like supporting a variety of device screen sizes and older platform versions, but it offers a large potential user base and opportunities to create engaging apps.
Introduction_to_android_and_android_studioAbdul Basit
This document provides an introduction to Android and Android Studio. It discusses what Android is, its operating system components, versions and features. It also describes Android Studio as the IDE for developing Android apps, outlining its tools and how to install, create, code and deploy an Android app. The document serves as a high-level overview of getting started with Android development.
Similar to Android - From Zero to Hero @ DEVit 2017 (20)
Atelier - Innover avec l’IA Générative et les graphes de connaissancesNeo4j
Atelier - Innover avec l’IA Générative et les graphes de connaissances
Allez au-delà du battage médiatique autour de l’IA et découvrez des techniques pratiques pour utiliser l’IA de manière responsable à travers les données de votre organisation. Explorez comment utiliser les graphes de connaissances pour augmenter la précision, la transparence et la capacité d’explication dans les systèmes d’IA générative. Vous partirez avec une expérience pratique combinant les relations entre les données et les LLM pour apporter du contexte spécifique à votre domaine et améliorer votre raisonnement.
Amenez votre ordinateur portable et nous vous guiderons sur la mise en place de votre propre pile d’IA générative, en vous fournissant des exemples pratiques et codés pour démarrer en quelques minutes.
Artificia Intellicence and XPath Extension FunctionsOctavian Nadolu
The purpose of this presentation is to provide an overview of how you can use AI from XSLT, XQuery, Schematron, or XML Refactoring operations, the potential benefits of using AI, and some of the challenges we face.
Hand Rolled Applicative User ValidationCode KataPhilip Schwarz
Could you use a simple piece of Scala validation code (granted, a very simplistic one too!) that you can rewrite, now and again, to refresh your basic understanding of Applicative operators <*>, <*, *>?
The goal is not to write perfect code showcasing validation, but rather, to provide a small, rough-and ready exercise to reinforce your muscle-memory.
Despite its grandiose-sounding title, this deck consists of just three slides showing the Scala 3 code to be rewritten whenever the details of the operators begin to fade away.
The code is my rough and ready translation of a Haskell user-validation program found in a book called Finding Success (and Failure) in Haskell - Fall in love with applicative functors.
Software Engineering, Software Consulting, Tech Lead, Spring Boot, Spring Cloud, Spring Core, Spring JDBC, Spring Transaction, Spring MVC, OpenShift Cloud Platform, Kafka, REST, SOAP, LLD & HLD.
E-commerce Development Services- Hornet DynamicsHornet Dynamics
For any business hoping to succeed in the digital age, having a strong online presence is crucial. We offer Ecommerce Development Services that are customized according to your business requirements and client preferences, enabling you to create a dynamic, safe, and user-friendly online store.
E-Invoicing Implementation: A Step-by-Step Guide for Saudi Arabian CompaniesQuickdice ERP
Explore the seamless transition to e-invoicing with this comprehensive guide tailored for Saudi Arabian businesses. Navigate the process effortlessly with step-by-step instructions designed to streamline implementation and enhance efficiency.
Revolutionizing Visual Effects Mastering AI Face Swaps.pdfUndress Baby
The quest for the best AI face swap solution is marked by an amalgamation of technological prowess and artistic finesse, where cutting-edge algorithms seamlessly replace faces in images or videos with striking realism. Leveraging advanced deep learning techniques, the best AI face swap tools meticulously analyze facial features, lighting conditions, and expressions to execute flawless transformations, ensuring natural-looking results that blur the line between reality and illusion, captivating users with their ingenuity and sophistication.
Web:- https://undressbaby.com/
SMS API Integration in Saudi Arabia| Best SMS API ServiceYara Milbes
Discover the benefits and implementation of SMS API integration in the UAE and Middle East. This comprehensive guide covers the importance of SMS messaging APIs, the advantages of bulk SMS APIs, and real-world case studies. Learn how CEQUENS, a leader in communication solutions, can help your business enhance customer engagement and streamline operations with innovative CPaaS, reliable SMS APIs, and omnichannel solutions, including WhatsApp Business. Perfect for businesses seeking to optimize their communication strategies in the digital age.
Using Query Store in Azure PostgreSQL to Understand Query PerformanceGrant Fritchey
Microsoft has added an excellent new extension in PostgreSQL on their Azure Platform. This session, presented at Posette 2024, covers what Query Store is and the types of information you can get out of it.
Most important New features of Oracle 23c for DBAs and Developers. You can get more idea from my youtube channel video from https://youtu.be/XvL5WtaC20A
Transform Your Communication with Cloud-Based IVR SolutionsTheSMSPoint
Discover the power of Cloud-Based IVR Solutions to streamline communication processes. Embrace scalability and cost-efficiency while enhancing customer experiences with features like automated call routing and voice recognition. Accessible from anywhere, these solutions integrate seamlessly with existing systems, providing real-time analytics for continuous improvement. Revolutionize your communication strategy today with Cloud-Based IVR Solutions. Learn more at: https://thesmspoint.com/channel/cloud-telephony
GraphSummit Paris - The art of the possible with Graph TechnologyNeo4j
Sudhir Hasbe, Chief Product Officer, Neo4j
Join us as we explore breakthrough innovations enabled by interconnected data and AI. Discover firsthand how organizations use relationships in data to uncover contextual insights and solve our most pressing challenges – from optimizing supply chains, detecting fraud, and improving customer experiences to accelerating drug discoveries.
What is Master Data Management by PiLog Groupaymanquadri279
PiLog Group's Master Data Record Manager (MDRM) is a sophisticated enterprise solution designed to ensure data accuracy, consistency, and governance across various business functions. MDRM integrates advanced data management technologies to cleanse, classify, and standardize master data, thereby enhancing data quality and operational efficiency.
AI Fusion Buddy Review: Brand New, Groundbreaking Gemini-Powered AI AppGoogle
AI Fusion Buddy Review: Brand New, Groundbreaking Gemini-Powered AI App
👉👉 Click Here To Get More Info 👇👇
https://sumonreview.com/ai-fusion-buddy-review
AI Fusion Buddy Review: Key Features
✅Create Stunning AI App Suite Fully Powered By Google's Latest AI technology, Gemini
✅Use Gemini to Build high-converting Converting Sales Video Scripts, ad copies, Trending Articles, blogs, etc.100% unique!
✅Create Ultra-HD graphics with a single keyword or phrase that commands 10x eyeballs!
✅Fully automated AI articles bulk generation!
✅Auto-post or schedule stunning AI content across all your accounts at once—WordPress, Facebook, LinkedIn, Blogger, and more.
✅With one keyword or URL, generate complete websites, landing pages, and more…
✅Automatically create & sell AI content, graphics, websites, landing pages, & all that gets you paid non-stop 24*7.
✅Pre-built High-Converting 100+ website Templates and 2000+ graphic templates logos, banners, and thumbnail images in Trending Niches.
✅Say goodbye to wasting time logging into multiple Chat GPT & AI Apps once & for all!
✅Save over $5000 per year and kick out dependency on third parties completely!
✅Brand New App: Not available anywhere else!
✅ Beginner-friendly!
✅ZERO upfront cost or any extra expenses
✅Risk-Free: 30-Day Money-Back Guarantee!
✅Commercial License included!
See My Other Reviews Article:
(1) AI Genie Review: https://sumonreview.com/ai-genie-review
(2) SocioWave Review: https://sumonreview.com/sociowave-review
(3) AI Partner & Profit Review: https://sumonreview.com/ai-partner-profit-review
(4) AI Ebook Suite Review: https://sumonreview.com/ai-ebook-suite-review
#AIFusionBuddyReview,
#AIFusionBuddyFeatures,
#AIFusionBuddyPricing,
#AIFusionBuddyProsandCons,
#AIFusionBuddyTutorial,
#AIFusionBuddyUserExperience
#AIFusionBuddyforBeginners,
#AIFusionBuddyBenefits,
#AIFusionBuddyComparison,
#AIFusionBuddyInstallation,
#AIFusionBuddyRefundPolicy,
#AIFusionBuddyDemo,
#AIFusionBuddyMaintenanceFees,
#AIFusionBuddyNewbieFriendly,
#WhatIsAIFusionBuddy?,
#HowDoesAIFusionBuddyWorks
Zoom is a comprehensive platform designed to connect individuals and teams efficiently. With its user-friendly interface and powerful features, Zoom has become a go-to solution for virtual communication and collaboration. It offers a range of tools, including virtual meetings, team chat, VoIP phone systems, online whiteboards, and AI companions, to streamline workflows and enhance productivity.
2. ANDROID - FROM ZERO TO HERO
WHO AM I?
▸ An alumnus of CITY College (BSc, MSc)
▸ One of the earliest adopters of Android, working with Android
professionally since day 1
▸ Teaching Mobile Development with Android at CITY College
▸ Building MVPs for Silicon Valley startups for the past couple of
years
▸ Mobile Game Developer in various Game Engines
▸ Gamer =)
2
4. ANDROID - FROM ZERO TO HERO
OUTLINE
▸ Challenges of Mobile Development
▸ History and versioning of Android
▸ Android Permission System and Mobile Ethics
▸ Introduction to the Android development environment
▸ Fundamental App components
▸ Basic UI Widgets
▸ Laying out UI components
4
5. ANDROID - FROM ZERO TO HERO
TRADITIONAL VS MOBILE DEVELOPMENT
▸ Consider context and user interaction
▸ Recognise the importance of user experience
▸ Understand the limitations of a touch-based interface
▸ Stick with platform best practices
▸ Pay attention to perceived speed
▸ Break away from long product release-cycles
▸ Bridge the gap between security and accessibility
5
6. ANDROID - FROM ZERO TO HERO
KEY MOBILE CHALLENGES
▸ Smartphone == small computer from the 90’s
▸ Low processing power
▸ Limited RAM
▸ Intermittent, low bandwidth, high latency data connections
▸ Impact on battery life
6
7. ANDROID - FROM ZERO TO HERO
WHAT IS ANDROID?
▸ Mobile operating system maintained by Google
▸ Originally purchased from Android, Inc. in 2005
▸ Runs on phones, tablets, watches, TVs, cars, cameras…
▸ Based on Java and Linux
▸ The #1 mobile OS worldwide, but also the #1 OS
worldwide
▸ Code is released periodically as open source
7
8. ANDROID - FROM ZERO TO HERO
ANDROID VERSION HISTORY
8
Code Name Version Number Release Date
Cupcake 1.5 April 27, 2009
Donut 1.6 September 15, 2009
Eclair 2.0 - 2.1 October 26, 2009
Froyo 2.2 - 2.2.3 May 20, 2010
Gingerbread 2.3 - 2.3.7 December 6, 2010
Honeycomb 3.0 - 3.2.6 February 22, 2011
Ice Cream Sandwich 4.0 - 4.0.4 October 18, 2011
Jelly Bean 4.1 - 4.3.1 July 9, 2012
Kit Kat 4.4 - 4.4.4 October 31, 2013
Lollipop 5.0 - 5.1.1 November 12, 2014
Marshmallow 6.0 - 6.0.1 October 5, 2015
13. ANDROID - FROM ZERO TO HERO
THE PERMISSION SYSTEM AND MOBILE ETHICS
▸ Android is a privilege-separated
operating system, in which each
application runs with a distinct
system identity
▸ Additional finer-grained security
features are provided through a
"permission" mechanism that
enforces restrictions on the specific
operations that a particular process
can perform
13
14. ANDROID - FROM ZERO TO HERO
ANDROID STUDIO
▸ The official IDE for Android application development
▸ replaces previous Eclipse-based environment
▸ based on IntelliJ IDEA
▸ free to download and use
14
15. ANDROID - FROM ZERO TO HERO
ANDROID VIRTUAL DEVICE (AVD)
▸ Allows to run apps in an emulator
▸ a software simulation of the entire Android tablet, phone,
watch…
▸ Must set up a virtual device first in Android Studio
▸ Alternative: install the app on an actual Android device!
▸ pro: app will run faster, better test of real execution
▸ con: requires an Android device to be plugged into the
development PC
15
17. ANDROID - FROM ZERO TO HERO
APP FUNDAMENTALS
▸ Every Android app is composed of exactly 3 parts
▸ Core framework components that define the app
▸ A manifest file in which components and required
device features are declared
▸ Resources that are separate from the code and allow the
app to gracefully handle different device configurations
17
18. ANDROID - FROM ZERO TO HERO
CORE FRAMEWORK COMPONENTS
▸ Activities - representing a single screen with a user
interface
▸ Services - run in the background to perform long-running
operations or perform work for remote processes
▸ Content Providers - manage a shared set of data
▸ Broadcast Receivers - respond to system-wide broadcast
announcements
18
19. ANDROID - FROM ZERO TO HERO
THE MANIFEST FILE
▸ Apps must declare all of their components in this file
▸ Identify any user permissions the app requires, such as Internet
access or read-access to the user's contacts
▸ Declare the minimum API Level required by the app, based on
which APIs the app uses
▸ Declare hardware and software features used or required by the
app, such as a camera, bluetooth services, or a multitouch screen
▸ API libraries the app needs to be linked against (other than the
Android framework APIs), such as the Google Maps library
19
20. ANDROID - FROM ZERO TO HERO
THE MANIFEST FILE - DECLARING ACTIVITIES
20
<?xml version="1.0" encoding="utf-8"?>
<manifest ... >
<application android:icon="@drawable/app_icon.png" ... >
<activity android:name="com.example.project.ExampleActivity"
android:label="@string/example_label" ... >
</activity>
...
</application>
</manifest>
21. ANDROID - FROM ZERO TO HERO
RESOURCES
▸ A good engineer will always
externalise application resources from
code as to increase maintainability
▸ An excellent engineer will also
provide different resources for
different device configurations
▸ Lucky for us Google is filled with
excellent engineers =)
21
22. ANDROID - FROM ZERO TO HERO
IMPORTANT RESOURCE FOLDERS (SO FAR)
22
Directory Resource Type
drawable/
Bitmap files (.png, .9.png, .jpg, .gif) or XML
files that are compiled into the available drawable
resource subtypes
layout/ XML files that define a user interface layout
menu/
XML files that define application menus, such as an
Options Menu, Context Menu, or Sub Menu
raw/ Arbitrary files to save in their raw form (sound)
values/
XML files that contain simple values, such as strings,
integers, and colors.
23. ANDROID - FROM ZERO TO HERO
ACCESSING RESOURCES
▸ In xml:
▸ @resource_type/id
▸ examples: @string/hello_word, @drawable/cat
▸ In code:
▸ Using the mysterious R.java class
▸ A static generated class which contains all the id’s of your resources
▸ R.resource_type.id
▸ examples: R.string.hello_world, R.drawable.cat
23
24. ANDROID - FROM ZERO TO HERO
BYE BYE PIXELS
▸ Your program will be run on a HUGE array of devices with
different hardware specifications including screen size
▸ Screens have densities (ranging from small amounts of
pixels to huge amounts of pixels)
▸ Using pixels will produce a different look depending on
the screen size of the device
24
25. ANDROID - FROM ZERO TO HERO
WELCOME DENSITY INDEPENDENT PIXELS
▸ DP is an abstract unit that is based on the physical density
of the screen rather than the actual pixels
▸ Scales to uniform dimensions on any screens
▸ When defining font sizes, scaled pixels (sp) are used
instead which also take the user’s font size preference into
consideration (think accessibility)
25
26. ANDROID - FROM ZERO TO HERO
ACTIVITY
▸ Each activity is given a window in which to draw its user
interface
▸ An application usually consists of multiple activities that
are loosely bound to each other
▸ There must be a “main” activity, the entry point of the app
▸ Each time a new activity starts, the previous activity is
stopped, but the system preserves the activity in a stack
(the "back stack")
26
27. ANDROID - FROM ZERO TO HERO
UI OVERVIEW
▸ All user interface elements in an Android app are built
using View and ViewGroup objects
▸ View - an object that draws something on the screen that
the user can interact with
▸ ViewGroup - an object that holds other View (and
ViewGroup) objects in order to define the layout of the
interface
▸ Can be declared either in XML layout resources or in code
27
29. ANDROID - FROM ZERO TO HERO
WRITING UI
▸ Declare UI elements in XML
▸ Better separation of presentation from the code that
controls its behaviour
▸ Instantiate UI elements from code at runtime
▸ Useful for when the UI is dynamic and not know before
hand
29
30. ANDROID - FROM ZERO TO HERO
TEXT VIEW
▸ An extremely simple view component which displays text
to the user
▸ Notable attribute “android:text”: defines the text to be
shown in the TextView
30
<TextView
android:id=“@+id/tv_hello_world”
android:layout_width=“match_parent"
android:layout_height="wrap_content"
android:text=“@string/hello_world” />
31. ANDROID - FROM ZERO TO HERO
EDIT TEXT
▸ Allows the user to type text into the app
▸ It can be either single line or multi-line
▸ Touching a text field places the cursor and automatically
displays the keyboard
▸ Allows for a variety of other activities, such as text
selection (cut, copy, paste) and data look-up via auto-
completion
31
32. ANDROID - FROM ZERO TO HERO
EDIT TEXT
32
<EditText
android:id="@+id/email_address"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:hint="@string/email_hint"
android:inputType="textEmailAddress" />
33. ANDROID - FROM ZERO TO HERO
EDIT TEXT
▸ Notable attributes:
▸ android:hint - defines a text to be shown when the
user has still not written any text as to hint the text fields
purpose
▸ android:inputType - defines the type of data being
placed in the text field
▸ text, textEmailAddress, textUri, number, phone
▸ textCapSentences, textCapWords, textPassword
33
34. ANDROID - FROM ZERO TO HERO
IMAGE VIEW
▸ Displays an arbitrary image such as an icon
▸ Notable attribute “android:src”: defines the image
resource to be shown in the ImageView
34
<ImageView
android:id=“@+id/img_splash"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:src="@drawable/android" />
35. ANDROID - FROM ZERO TO HERO
BUTTON
▸ A view consisting of text or an icon (or both text and an
icon) that communicates what action occurs when the user
touches it
▸ Notable attribute “android:text”: defines the text to be
shown in the Button
35
<Button android:id=“@+id/btn_set_alarm”
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@string/alarm"/>
36. ANDROID - FROM ZERO TO HERO
BUTTON
▸ Notable attribute “android:src”: defines the image
resource to be shown in the ImageButton
36
<ImageButton android:id=“@+id/btn_set_alarm”
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:src="@drawable/clock"/>
37. ANDROID - FROM ZERO TO HERO
BUTTON
▸ Notable attribute “android:drawableLeft”: defines the
image resource to be shown at the left edge of the
Button
37
<Button android:id=“@+id/btn_set_alarm”
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text=“@string/alarm"
android:drawableLeft=“@drawable/clock” />
38. ANDROID - FROM ZERO TO HERO
TOAST
▸ Provides simple feedback about an operation in a small
popup which disappears over time
▸ Should note be relied upon extensively for important info
▸ time - either Toast.LENGTH_SHORT or
Toast.LENGTH_LONG
38
Toast.makeText(context, “text”, time).show();
Toast.makeText(context, R.string.text, time).show();
39. ANDROID - FROM ZERO TO HERO
SETTING SCREEN LAYOUT AND RETRIEVING COMPONENTS
▸ Every activity must set its view hierarchy to render on the
screen
▸ setContentView(R.layout.welcome_screen);
▸ Every activity can retrieve any view from its view hierarchy
▸ findViewById(R.id.btn_alarm);
39
40. ANDROID - FROM ZERO TO HERO
EVENTS
▸ Event - an external stimulus that a program responds to
▸ Common kinds include:
▸ Mouse motion / screen tap, key press
▸ Timer expiring, network data available
▸ Event-driven programming - overall execution of a
program is largely dictated by user events
▸ GUI heavy programs are almost always event-driven
40
42. ANDROID - FROM ZERO TO HERO
BASIC EVENT LISTENERS
▸ An event listener is an interface in the View class that
contains a single callback method
▸ Called by the Android framework when the View to which
the listener has been registered is triggered by user
interaction (a classic example of an observer pattern)
▸ onClick(View) - called when the user touches the item
▸ onLongClick(View) - called when the user touches and
holds the item
42
43. ANDROID - FROM ZERO TO HERO
BUTTON CLICK LISTENERS
43
Button alarmButton = (Button) findViewById(R.id.btn_alarm);
alarmButton.setOnClickListener(new View.OnClickListener() {
public void onClick(View v) {
// I have been clicked;
}
});
alarmButton.setOnLongClickListener(new View.OnLongClickListener() {
public boolean onLongClick(View v) {
// I have been long clicked
return true;
}
});
44. ANDROID - FROM ZERO TO HERO
HOW DOES ONE SPECIFY WHERE COMPONENTS GO ON THE SCREEN
▸ Absolute positioning (C++, C#, others):
▸ Exactly specifying the position of the component on the screen
using pixels
▸ button.setPosition(75, 0);
▸ Layout Managers (Java, Android, others):
▸ Objects which decide the exact pixels of where a component
should be placed based on some rules
▸ More flexible and general, works well with different device
configurations
44
45. ANDROID - FROM ZERO TO HERO
LAYOUTS
▸ A layout (ViewGroup) defines the visual structure for a
user interface by providing placement rules for its children
(other ViewGroups or Views)
▸ Each layout file must contain exactly one root element,
which must be a View or ViewGroup object
▸ Add additional layout objects or widgets as child elements
to gradually build a View hierarchy
45
46. ANDROID - FROM ZERO TO HERO
COMMON LAYOUTS
46
Linear Layout Relative Layout
47. ANDROID - FROM ZERO TO HERO
LINEAR LAYOUT
▸ A view group that aligns all children in a single direction,
vertically or horizontally
▸ All children of a LinearLayout are stacked one after the
other, vertical orientation positions one child per row and
horizontal orientation positions all children in a single row
▸ Items do not wrap if they reach the end of the screen
▸ Supports complex layouts by using attributes called
gravity and weight
47
48. ANDROID - FROM ZERO TO HERO
LINEAR LAYOUT
▸ Notable attribute “android:orientation”: defines the
orientation in which the layout should position its children
▸ Possible values “vertical” or “horizontal” (default)
48
<LinearLayout
android:layout_width=“match_parent"
android:layout_height="wrap_content"
android:orientation=“vertical”>
.....
</LinearLayout>
50. ANDROID - FROM ZERO TO HERO
LET’S TALK ABOUT GRAVITY
▸ Alignment direction that widgets are pulled in
▸ top, bottom, left, right, center,
center_vertical, center_horizontal
▸ Combine gravity with the pipe operator |
▸ Set gravity on the layout to adjust all widgets
▸ Set layout_gravity on an individual widget
50
52. ANDROID - FROM ZERO TO HERO
LAYOUT WEIGHT
▸ Gives elements relative sizes by using integers
▸ Widget with weight W gets W/total fraction of total size
▸ Cooking analogy
▸ 2 parts flour, 1 part sugar
52
<Button android:id=“@+id/btn_set_alarm”
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text=“@string/alarm"
android:layout_weight=“1” />
53. ANDROID - FROM ZERO TO HERO
LAYOUT WEIGHT
53
<Button
…
android:layout_weight=“1” />
<Button
…
android:layout_weight=“1” />
<Button
…
android:layout_weight=“3” />
54. ANDROID - FROM ZERO TO HERO
SIZING AN INDIVIDUAL VIEW
▸ width and height of a view can be:
▸ wrap_content - exactly large enough to fit the view’s
content
▸ match_parent - as wide or tall as 100% of the layout it
resides in
▸ a specific fixed value - example 64dp (not usually
recommended)
54
55. ANDROID - FROM ZERO TO HERO
NESTED LAYOUTS
▸ To produce a more complicated appearance, layouts can
be nested
▸ Layout inside a layout
▸ Possible because all ViewGroups are also Views
55
56. ANDROID - FROM ZERO TO HERO
RELATIVE LAYOUT
▸ A view group that displays child views in relative positions,
either specified as relative to sibling elements or in
positions relative to the parent RelativeLayout area
▸ It eliminates nested view groups and keeps the layout
hierarchy flat which improves performance
▸ One RelativeLayout can replace using several nested
LinearLayout groups
56
57. ANDROID - FROM ZERO TO HERO
RELATIVE ANCHOR POINTS
▸ Properties for x and y relative to another view (provide
view id):
▸ layout_below, above, toLeftOf, toRightOf
▸ Properties for x and y relative to the parent container
(boolean values)
▸ layout_alignParentTop, Bottom, Left, Right
▸ layout_centerHorizontal, Vertical, InParent
57
59. ANDROID - FROM ZERO TO HERO
OUTLINE
▸ Adapter Layouts
▸ Adapter
▸ Handling Adapter Events
▸ Multi-screen Apps
▸ Intent
▸ Building Intents
▸ Keeping apps responsive
▸ Android process model
▸ Background operations with AsyncTasks
59
60. ANDROID - FROM ZERO TO HERO
BUILDING LAYOUTS WITH AN ADAPTER
▸ When the content of the layout is dynamic or not pre-
determined, one can use AdapterView to populate the
layout with views at runtime
▸ Using an Adapter to bind the data to the layout
▸ ListView - a view group that displays a list of scrollable
items
▸ GridView - a ViewGroup that displays items in a two-
dimensional, scrollable grid
60
61. ANDROID - FROM ZERO TO HERO
COMMON ADAPTER LAYOUTS
61
List View Grid View
62. ANDROID - FROM ZERO TO HERO
ADAPTER
▸ Behaves as a middleman between the data source and the
AdapterView layout (a classic example of an adapter
pattern)
▸ Provides access to the data items
▸ Responsible for making a View for each item in the data
set
▸ Also used by some UI components to provide their data
(eg. Spinner)
62
63. ANDROID - FROM ZERO TO HERO
COMMON ADAPTERS
▸ ArrayAdapter - backed by an array of arbitrary objects
▸ CursorAdapter - exposes data from a database Cursor
▸ SimpleCursorAdapter - an easy adapter to map
columns from a cursor to TextViews or ImageViews
63
ArrayAdapter<String> adapter = new
ArrayAdapter<String>(activity, layout, array);
listView.setAdapter(adapter);
64. ANDROID - FROM ZERO TO HERO
ADAPTER VIEW EVENTS
▸ setOnItemClickListener(AdapterView.OnItemClickList
ener)
▸ Called when an item has been clicked
▸ setOnItemLongClickListener(AdapterView.OnItemLongC
lickListener)
▸ Called when an item has been clicked and held
▸ setOnItemSelectedListener(AdapterView.OnItemSelect
edListener)
▸ Called when an item in the list has been selected
64
65. ANDROID - FROM ZERO TO HERO
ON ITEM CLICKED LISTENER
65
ListView listView = (ListView) findViewById(R.id.list);
listView.setOnItemClickedListener(
new AdapterView.OnItemClickedListener() {
@Override
public void onItemClick(AdapterView<?> list,
View row,
int index,
long rowId) {
// Code to run when the item is clicked
}
}
);
66. ANDROID - FROM ZERO TO HERO
CHANGES TO ADAPTER DATA
▸ If the data in the collection backing the adapter changes,
the adapter must be notified
66
ArrayList<String> items = …;
ArrayAdapter<String> adapter = …;
listView.setAdapter(adapter);
// change data
items.remove(0);
// notify the adapter
adapter.notifyDataSetChanged();
68. ANDROID - FROM ZERO TO HERO
CUSTOM ADAPTER LAYOUTS
▸ Provide the item layout in XML just like Activity layouts
▸ Either
▸ 1) Instruct the ArrayAdapter how to supply the item
text to each item
▸ 2) Build a custom adapter by extending BaseAdapter
68
69. ANDROID - FROM ZERO TO HERO
CUSTOM ARRAY ADAPTER
69
<LinearLayout android:orientation=“horizontal” …>
<ImageView … />
<TextView android:id=“@+id/tv_label” … />
</LinearLayout>
ArrayAdapter<String> adapter =
new ArrayAdapter<String>(
activity,
R.layout.item_layout,
R.id.tv_label,
data
);
item_layout.xml
70. ANDROID - FROM ZERO TO HERO
EXTENDING BASE ADAPTER
▸ Must implement four important methods of every adapter
▸ getCount() - return how many items are in total in the data set
▸ getItem(position) - return the item from the data set at the
specified position
▸ getItemId(position) - get the row id associated with the
specified position in the list
▸ getView(position, convertView, parent) - get a view
that displays the data at the specified position in the data set
70
71. ANDROID - FROM ZERO TO HERO
EXAMPLE BASE ADAPTER
71
public class Item {
public String name;
public int quantity;
}
<LinearLayout android:orientation=“horizontal” …>
<TextView android:id=“@+id/tv_name” … />
<TextView android:id=“@+id/tv_quantity” … />
</LinearLayout>
72. ANDROID - FROM ZERO TO HERO
EXAMPLE BASE ADAPTER
72
public class ItemAdapter extends BaseAdapter<Item> {
private List<Item> items = …;
@Override
public int getCount() {
return items.size();
}
@Override
public Object getItem(int position) {
return items.get(position);
}
@Override
public long getItemId(int position) {
return position;
}
}
73. ANDROID - FROM ZERO TO HERO
EXAMPLE BASE ADAPTER - THE HEAVY LIFTING
73
@Override
public View getView(int position, View convertView, ViewGroup parent) {
if (convertView == null) {
LayoutInflater inflater = LayoutInflater.from(context);
convertView = inflater.inflate(
R.layout.item_layout, parent, false);
}
Item item = (Item) this.getItem(position);
TextView nameTextView = (TextView)
convertView.findViewById(R.id.tv_name);
TextView quantityTextView = (TextView)
convertView.findViewById(R.id.tv_quantity);
nameTextView.setText(item.name);
quantityTextView(String.valueOf(item.quantity);
return convertView;
}
75. ANDROID - FROM ZERO TO HERO
MULTI-SCREEN APPS
▸ Many apps have multiple screens (activities)
▸ An activity A can launch another activity B in response to
an event
▸ Activity A can pass data to activity B
▸ Activity B can return data back to activity A
▸ Each activity has a Java class and an XML layout
▸ Remember: AndroidManifest should list all activities
75
77. ANDROID - FROM ZERO TO HERO
INTENT
▸ An object representing a desired action
▸ Used to request an action from another app component
▸ Three fundamental use cases
▸ Start an Activity - startActivity()
▸ Start a Service - startService()
▸ Deliver a broadcast - sendBroadcast()
77
78. ANDROID - FROM ZERO TO HERO
INTENT
▸ The component can be in the same app or another app
installed on the same device
▸ Can store extra data to pass to the component
78
79. ANDROID - FROM ZERO TO HERO
INTENT TYPES
▸ Explicit Intent
▸ Specifies the component to start explicitly by referring to
its fully-qualified class name
▸ Typically used for starting components which are part of the
same app
▸ When the system receives an explicit Intent it immediately
starts the app component specified in the Intent
▸ We will be using explicits Intents today!
79
80. ANDROID - FROM ZERO TO HERO
INTENT TYPES
▸ Implicit Intent
▸ Declare a general action to perform which allows all the
components on the device to handle it
▸ Typically used for communicating with components which offer
commonly present functionality in mobile devices (eg. Maps, Browser)
▸ When the system receives an implicit intent it consults with all the
declared IntentFilters in all the AndroidManifests on the device
▸ This is not important for this course but it is included here as a starting
point for further research!
80
81. ANDROID - FROM ZERO TO HERO
BUILDING AN INTENT
▸ Component name - mandatory for explicit intents, meaning that the
intent should be delivered only to the app component defined by it
▸ Action - mandatory for implicit intents, specifying the action to
perform (eg. view, pick, send…)
▸ Broadcast intents report the action which took place
▸ You can specify your custom actions for your own components
▸ Common actions include ACTION_VIEW / ACTION_SEND
▸ Custom actions should include the package name
81
final String ACTION_TIMETRAVEL = "com.example.action.TIMETRAVEL";
82. ANDROID - FROM ZERO TO HERO
BUILDING AN INTENT
▸ Data - the URI that references the data to be acted upon (eg. open THIS
image) or the MIME type of that data
▸ Category - a string containing additional info about the kind of
component to launch (eg. CATEGORY_BROWSABLE)
▸ Extras - key-value pairs that carry additional information required to
accomplish the requested action
▸ Components should define their own extras including the package
name
▸ Flags - metadata in the Intent which instruct the system on how to
launch an activity
82
83. ANDROID - FROM ZERO TO HERO
INTENT EXAMPLES
83
// Executed in an Activity, so 'this' is the Context
Intent intent = new Intent(this, GreetingActivity.class);
intent.putExtra(GreetingActivity.EXTRA_NAME, “Ivo”);
startActivity(intent);
84. ANDROID - FROM ZERO TO HERO
EXTRACTING INTENT INFO
84
public class GreetingActivity extends Activity {
...
public void onCreate(Bundle savedState) {
super.onCreate(savedState);
setContentView(...);
Intent intent = getIntent();
String name = intent.getStringExtra(EXTRA_NAME);
}
}
85. ANDROID - FROM ZERO TO HERO
GETTING RESULT FROM AN ACTIVITY
▸ Calling activity wants to get an answer from the called activity
▸ Use startActivityForResult(int requestCode)
instead of startActivity()
▸ The method returns immediately but later on when the called
activity finishes onActivityResult() will be called with
the answer from the called activity
▸ The called activity must set the answer before finishing
▸ Example: Starting the People app to select a contact
85
86. ANDROID - FROM ZERO TO HERO
STARTING AN ACTIVITY FOR A RESULT
86
static final int PICK_CONTACT_REQUEST = 1; // The request code
...
private void pickContact() {
Intent pickContactIntent = new Intent(Intent.ACTION_PICK,
Uri.parse(“content://contacts”));
// Show user only contacts w/ phone numbers
pickContactIntent.setType(Phone.CONTENT_TYPE);
startActivityForResult(pickContactIntent, PICK_CONTACT_REQUEST);
}
87. ANDROID - FROM ZERO TO HERO
WAITING FOR A RESULT
87
@Override
protected void onActivityResult(int requestCode, int resultCode,
Intent data) {
// Check which request it is that we're responding to
if (requestCode == PICK_CONTACT_REQUEST) {
// Make sure the request was successful
if (resultCode == RESULT_OK) {
// Get the URI that points to the selected contact
Uri contactUri = data.getData();
String stringExtra = data.getStringExtra(KEY);
// do something with the returned data...
// activities can return data in different format
// make sure you know what that format is
}
}
}
88. ANDROID - FROM ZERO TO HERO
SENDING BACK A RESULT
88
public class NameChooserActivity extends Activity {
...
public void onClick(View view) {
Intent intent = new Intent();
intent.putExtra(EXTRA_NAME);
setResult(RESULT_OK, intent);
finish(); // calls onDestroy
}
}
91. ANDROID - FROM ZERO TO HERO
KEEPING APPS RESPONSIVE
▸ Slow and sluggish performance is the #1 reason why your users
will uninstall your app
▸ The Android system has a built-in guard which protects the users
from non-responsive applications
▸ After an app is not responsive for a considerable amount of time
(a couple of secs) the system displays the dreadful Application
Not Responding (ANR) dialog
▸ No response to input in 5 secs
▸ A BroadcastReceiver taking more than 10 secs
91
93. ANDROID - FROM ZERO TO HERO
PERCEIVED SPEED RESEARCH
▸ 100 to 200ms is the threshold beyond which users will perceive
slowness in an app
▸ If an app is performing background work as a response to user
input, always show a progress dialog (ProgressBar)
▸ If an app has a time consuming start-up process (setting up initial
data, server communication etc) either:
▸ Show a splash screen with a progress indicator
▸ Render the main UI as fast as possible with a progress indicator
and filling in the new data asynchronously as it arrives
93
94. ANDROID - FROM ZERO TO HERO
KEEPING APPS RESPONSIVE
▸ All data persistence operations take time
▸ All network operations take time
▸ All graphic manipulation operations take time
▸ Need to delve deeper in the Android process model
94
95. ANDROID - FROM ZERO TO HERO
ANDROID PROCESS MODEL
▸ Android apps are single threaded apps
▸ UI thread is their main thread
▸ drawing UI elements, dispatching events
▸ Android’s single-threaded model has two rules
▸ 1) Do not block the UI thread
▸ 2) Do not access the Android toolkit from outside the UI
thread
95
96. ANDROID - FROM ZERO TO HERO
ANDROID PROCESS MODEL
96
public class ExampleActivity extends Activity {
...
public void onClick(View v) {
new Thread(new Runnable() {
public void run() {
Bitmap b = loadImageFromNetwork("http://example.com/image.png");
mImageView.setImageBitmap(b);
}
}).start();
}
}
public class ExampleActivity extends Activity {
...
public void onClick(View v) {
Bitmap b = loadImageFromNetwork("http://example.com/image.png");
mImageView.setImageBitmap(b);
}
}
BAD - RUNNING A LONG OPERATION ON THE UI THREAD
BAD - ACCESSING THE ANDROID UI TOOLKIT FROM AN OUTSIDE THREAD
97. ANDROID - FROM ZERO TO HERO
ANDROID PROCESS MODEL
97
public class ExampleActivity extends Activity {
...
public void onClick(View v) {
new Thread(new Runnable() {
public void run() {
final Bitmap b = loadImageFromNetwork("http://example.com/image.png");
mImageView.post(new Runnable() {
public void run() {
mImageView.setImageBitmap(bitmap);
}
});
}
}).start();
}
}
GOOD
98. ANDROID - FROM ZERO TO HERO
ASYNC TASK
▸ We need worker threads that are allowed to interact with the Android
UI Toolkit
▸ AsyncTask enables proper and easy use of the UI thread
▸ A utility that supports running operations in the background in a
worker thread and delivering the results on the UI thread without
having to manipulate threads and and handlers
▸ Useful for long running operations but one that span at most a minute
or max two
▸ All AsyncTasks in the system are executed sequentially on a single
worker thread (no parallelism)
98
99. ANDROID - FROM ZERO TO HERO 99
private class DownloadFilesTask extends AsyncTask<URL, Integer, Long> {
// Do the long-running work in here
// !!! Executed in background
protected Long doInBackground(URL... urls) {
long totalSize = 0;
for (int i = 0; i < urls.length; i++) {
totalSize += Downloader.downloadFile(urls[i]);
publishProgress((int) ((i / (float) count) * 100));
}
return totalSize;
}
// This is called each time you call publishProgress()
// !!! Executed on UI thread
protected void onProgressUpdate(Integer... progress) {
setProgressPercent(progress[0]);
}
// This is called when doInBackground() is finished
// !!! Executed on UI thread
protected void onPostExecute(Long result) {
showNotification("Downloaded " + result + " bytes");
}
}
new DownloadFilesTask().execute(url1, url2, url3);
101. 101URL url = new URL(CREATE_STUDENTS_URL);
HttpURLConnection conn = (HttpURLConnection) url.openConnection();
conn.setReadTimeout(10000 /* milliseconds */);
conn.setConnectTimeout(15000 /* milliseconds */);
conn.setRequestMethod("POST");
conn.setDoInput(true);
conn.setDoOutput(true);
conn.addRequestProperty("Content-Type", "application/json");
Student student = new Student();
student.setFirstName(firstName);
student.setLastName(lastName);
student.setAge(age);
String studentJson = new Gson().toJson(student);
BufferedWriter writer = new BufferedWriter(new
OutputStreamWriter(conn.getOutputStream(), "UTF-8"));
writer.write(studentJson);
writer.flush();
writer.close();
conn.getOutputStream().close();
// Starts the post
conn.connect();
int response = conn.getResponseCode();
102. ANDROID - FROM ZERO TO HERO
RETROFIT
▸ Retrofit turns our HTTP API into a Java interface
▸ Use annotations to describe the HTTP request:
▸ URL parameter replacement and query parameter
support
▸ Object conversion to request body (e.g., JSON)
▸ Calls can be executed either synchronously or
asynchronously
102
103. ANDROID - FROM ZERO TO HERO
ADDING RETROFIT TO A PROJECT
103
dependencies {
...
compile "com.squareup.retrofit2:retrofit:2.0.1"
compile "com.squareup.retrofit2:converter-gson:2.0.1"
...
}
-dontwarn retrofit2.**
-keep class retrofit2.** { *; }
-keepattributes Signature
-keepattributes Exceptions
app/build.gradle
proguard-rules.pro
<uses-permission android:name="android.permission.INTERNET" />
AndroidManifest.xml
104. ANDROID - FROM ZERO TO HERO
DEFINE YOUR API IN CODE
104
public interface StudentsApi {
static final String BASE_URL = "http://students-sdmdcity.rhcloud.com/rest/";
static final String STUDENTS_URL = "students";
@GET(STUDENTS_URL)
Call<List<Student>> getAllStudents();
@POST(STUDENTS_URL)
Call<Void> createStudent(@Body Student student);
}
105. ANDROID - FROM ZERO TO HERO
CREATE YOU API INSTANCE
105
Retrofit retrofit = new Retrofit.Builder()
.baseUrl(StudentsApi.BASE_URL)
// automatic JSON conversion using Googles Gson [so cool!]
.addConverterFactory(GsonConverterFactory.create())
.build();
StudentsApi studentsApi = retrofit.create(StudentsApi.class);
106. ANDROID - FROM ZERO TO HERO
FINALLY, EXECUTE THE CALL
106
// If using enqueue() - this is asynchronously executed on a background
// thread
studentsApi.createStudent(student).enqueue(new Callback<Void>() {
@Override
public void onResponse(Call<Void> call, Response<Void> response) {
int responseCode = response.code();
Void returnData = response.body();
}
@Override
public void onFailure(Call<Void> call, Throwable t) {
}
});
// If using execute() - this is synchronously executed on the calling
// thread
Response<Void> response = studentsApi.createStudent(student).execute();
107. ANDROID - FROM ZERO TO HERO
CONSUMING REST WEB SERVICES - GENERAL RULES
▸ HTTP defines methods (sometimes referred to as verbs) to
indicate the desired action to be performed on the
identified resource
▸ POST - most-often utilised to create new resources
▸ GET - used to read (or retrieve) a representation of a
resource
▸ PUT - most-often utilised for updating existing resources
▸ DELETE - used to delete a resource identified by a URI
107
108. ANDROID - FROM ZERO TO HERO
CONSUMING WEB SERVICES - HTTP STATUS CODES
▸ 200 OK - everything was fine with the request
▸ 204 No Content - everything was fine with the request, but the
server returned no content
▸ 400 Bad Request - the request to the server contains a syntax error
and was not understood by the server
▸ 403 Forbidden - the resource you are trying to access if forbidden
for the current authorised user
▸ 404 Not Found - the resource you are trying to access does not
exist on the server
108