This document provides details on the development of an Android application to display employee details. It consists of 11 pages describing the steps taken to build the app, including: setting up the basic layout; working with lists and a SQLite database; passing information between activities using intents; interacting with phone capabilities like calling and texting; and navigating the organizational chart. Code snippets are provided for key Java classes and XML layout files involved in implementing the various features at each step. The roles of team members are also listed.
The document discusses advanced structural modeling concepts in object-oriented software engineering, including advanced classes, relationships, interfaces, types and roles, packages, and object diagrams. It defines these concepts and provides examples to illustrate their usage and relationships.
Coupling refers to the interdependence between software modules. There are several types of coupling from loose to tight, with the tightest being content coupling where one module relies on the internal workings of another. Cohesion measures how strongly related the functionality within a module is, ranging from coincidental to functional cohesion which is the strongest. Tight coupling and low cohesion can make software harder to maintain and reuse modules.
Android Intents allow communication between app components and sharing of data. An Intent specifies an action and can contain data and extras. There are explicit intents, which target a specific component, and implicit intents, which specify an action that may be handled by multiple apps. Components declare intent filters in the manifest to receive implicit intents matching the filter's action, data, and category. When an implicit intent is received, the system resolves matching components by comparing the intent to intent filters.
This document discusses constructor overloading in Java. It defines constructors as special methods that initialize objects. There are two types of constructors: default (no-argument) constructors and parameterized constructors. Constructor overloading allows a class to have multiple constructors that differ in their parameter lists. This allows constructors to perform different initialization tasks depending on the arguments passed. The document provides examples of default, parameterized, and overloaded constructors.
Importance & Principles of Modeling from UML DesigningABHISHEK KUMAR
Object oriented analysis and design uses modeling to understand systems being developed. Models simplify systems at different abstraction levels to visualize structure and behavior, provide templates for building systems, and document decisions. Effective modeling requires choosing appropriate models that influence solutions, expressing models at different abstraction levels for different stakeholders, ensuring models are grounded in reality, and using multiple complementary models to solve complex systems.
The document discusses different layout managers in Java including BorderLayout, GridLayout, FlowLayout, CardLayout, and BoxLayout. BorderLayout arranges components in five regions (north, south, east, west, center) with one component per region. GridLayout arranges components in a rectangular grid with the same number of components per row. FlowLayout arranges components in a line, one after another. CardLayout displays one component at a time, treating each like a card. BoxLayout arranges components along an axis.
Objectives
What is Encapsulation?
What encapsulation or information hiding approach provide in Object Oriented ?
General 3 different ways to Encapsulate data.
Advantages of Encapsulation.
Fragments allow modularization of activities on larger screens like tablets. A fragment represents a behavior or UI portion and has its own lifecycle callbacks. Fragments can be placed in an activity layout via XML or added dynamically in code. Multiple fragments can be combined in a single activity to build a multi-pane UI. The activity lifecycle influences fragments, and fragments can be retained across configuration changes using setRetainInstance(true).
The document discusses advanced structural modeling concepts in object-oriented software engineering, including advanced classes, relationships, interfaces, types and roles, packages, and object diagrams. It defines these concepts and provides examples to illustrate their usage and relationships.
Coupling refers to the interdependence between software modules. There are several types of coupling from loose to tight, with the tightest being content coupling where one module relies on the internal workings of another. Cohesion measures how strongly related the functionality within a module is, ranging from coincidental to functional cohesion which is the strongest. Tight coupling and low cohesion can make software harder to maintain and reuse modules.
Android Intents allow communication between app components and sharing of data. An Intent specifies an action and can contain data and extras. There are explicit intents, which target a specific component, and implicit intents, which specify an action that may be handled by multiple apps. Components declare intent filters in the manifest to receive implicit intents matching the filter's action, data, and category. When an implicit intent is received, the system resolves matching components by comparing the intent to intent filters.
This document discusses constructor overloading in Java. It defines constructors as special methods that initialize objects. There are two types of constructors: default (no-argument) constructors and parameterized constructors. Constructor overloading allows a class to have multiple constructors that differ in their parameter lists. This allows constructors to perform different initialization tasks depending on the arguments passed. The document provides examples of default, parameterized, and overloaded constructors.
Importance & Principles of Modeling from UML DesigningABHISHEK KUMAR
Object oriented analysis and design uses modeling to understand systems being developed. Models simplify systems at different abstraction levels to visualize structure and behavior, provide templates for building systems, and document decisions. Effective modeling requires choosing appropriate models that influence solutions, expressing models at different abstraction levels for different stakeholders, ensuring models are grounded in reality, and using multiple complementary models to solve complex systems.
The document discusses different layout managers in Java including BorderLayout, GridLayout, FlowLayout, CardLayout, and BoxLayout. BorderLayout arranges components in five regions (north, south, east, west, center) with one component per region. GridLayout arranges components in a rectangular grid with the same number of components per row. FlowLayout arranges components in a line, one after another. CardLayout displays one component at a time, treating each like a card. BoxLayout arranges components along an axis.
Objectives
What is Encapsulation?
What encapsulation or information hiding approach provide in Object Oriented ?
General 3 different ways to Encapsulate data.
Advantages of Encapsulation.
Fragments allow modularization of activities on larger screens like tablets. A fragment represents a behavior or UI portion and has its own lifecycle callbacks. Fragments can be placed in an activity layout via XML or added dynamically in code. Multiple fragments can be combined in a single activity to build a multi-pane UI. The activity lifecycle influences fragments, and fragments can be retained across configuration changes using setRetainInstance(true).
An activity provides a screen for users to interact with an Android application. Activities are organized into a stack and have a lifecycle of states like resumed and paused. To create an activity, you subclass the Activity class and implement callback methods corresponding to lifecycle states like onCreate and onPause. Activities must be declared in the app manifest and can be started with an intent.
This document provides an overview of object-oriented programming (OOP) concepts. It defines OOP as a programming technique that uses objects and classes. Key concepts discussed include classes and objects, inheritance, data abstraction, encapsulation, and polymorphism. Benefits of OOP include reusability, extensibility, understandability and security. Inheritance allows reuse of existing classes, and can be single, multiple, public, protected or private. Data abstraction hides background details and provides essential information. Encapsulation binds data and functions that manipulate the data. Polymorphism enables different object types to respond to the same function name.
The Delphi technique was developed to gain expert consensus on estimates without group influence. It can be adapted for software cost estimation by having estimators provide anonymous estimates in rounds. A coordinator summarizes estimates between rounds and asks outliers to justify differences, iterating until consensus. A variation allows group discussion with the coordinator but maintains anonymous estimating to focus on variances. Additional information may be needed if consensus is not reached.
The objective is to explain how a software design may be represented as a set of interacting objects that manage their own state and operations and to introduce various models that describe an object-oriented design.
This document defines object-oriented programming and compares it to structured programming. It outlines the main principles of OOP including encapsulation, abstraction, inheritance, and polymorphism. Encapsulation binds code and data together for security and consistency. Abstraction hides implementation details and provides functionality. Inheritance allows classes to acquire properties from other classes in a hierarchy. Polymorphism enables different types to perform the same methods.
SDI allows each document to have its own independent window, while MDI allows multiple document windows to exist within a single parent window. The Visual Basic IDE can be viewed in SDI mode, with separate windows for each component, or MDI mode, with components nested within a single IDE window. To create an MDI application, add an MDI Form as the parent container and additional Forms set as MDI Children.
This document discusses implementation of inheritance in Java and C#. It covers key inheritance concepts like simple, multilevel, and hierarchical inheritance. It provides examples of inheritance in Java using keywords like extends, super, this. Interfaces are discussed as a way to achieve multiple inheritance in Java. The document also discusses implementation of inheritance in C# using concepts like calling base class constructors and defining virtual methods.
The document discusses access specifiers in C++ classes. There are three access specifiers: public, private, and protected. Private restricts access to class members to only within the class, public allows access from anywhere, and protected is used for inheritance but not discussed here. By default, members are private. Public members can be accessed from outside the class, while private members can only be accessed within class functions. Access specifiers control the scope and accessibility of class members.
Object-oriented analysis and design (OOAD) is a popular approach for analyzing, designing, and developing applications using the object-oriented paradigm. It involves modeling a system as a group of interacting objects at various levels of abstraction. Key concepts in OOAD include objects, classes, attributes, methods, encapsulation, inheritance, polymorphism, and relationships like association, aggregation, and composition. Common OOAD techniques include use case diagrams, which show interactions between actors and the system, and class diagrams, which describe the structure and behavior of system objects and their relationships.
In this core java training session, you will learn Collections – Lists, Sets. Topics covered in this session are:
• List – ArrayList, LinkedList
• Set – HashSet, LinkedHashSet, TreeSet
For more information about this course visit on this link: https://www.mindsmapped.com/courses/software-development/learn-java-fundamentals-hands-on-training-on-core-java-concepts/
This document discusses classes and objects in object-oriented analysis and design. It defines objects as having state, behavior, and identity, with similar objects defined by common classes. Classes represent groups of objects with similar behavior and structures. The relationships between classes and objects are explored, including generalization, aggregation, and association. Identification of classes and objects in analysis is discussed through various approaches like use case analysis and CRC cards. The importance of proper classification and key abstractions and mechanisms are also covered.
UML deployment diagrams show the physical deployment of software components across hardware infrastructure. They depict the hardware elements like processors and devices, the software installed on each processor, and how the components connect. Deployment diagrams are created during system implementation to layout the physical architecture and are useful for embedded, client-server, and distributed systems to distinguish interfaces from data and host multiple software versions across servers.
This document discusses class diagrams and object diagrams. Class diagrams model the static design of a system by describing classes and their attributes/methods. Object diagrams show instances of classes at a specific time by depicting objects and their relationships. Key differences are that class diagrams define types while object diagrams show state, and class diagrams are blueprints while object diagrams capture snapshots.
Encapsulation involves making fields in a class private and providing access to them via public methods. This creates a protective barrier preventing random access from external code, and allows modification of internal implementation without breaking existing code. Encapsulation makes code more maintainable, flexible and extensible by hiding implementation details and controlling access to class fields and methods.
This document discusses inheritance in object-oriented programming. It defines inheritance as establishing a link between classes that allows sharing and accessing properties. There are three types of inheritance: single, multilevel, and hierarchical. Single inheritance involves one parent and one child class, multilevel inheritance adds intermediate classes, and hierarchical inheritance has one parent and multiple child classes. The document provides examples of inheritance code in Java and demonstrates a program using inheritance with interfaces. It notes some limitations of inheritance in Java.
This document discusses inter-thread communication methods like wait() and notify() that allow threads to synchronize access to shared resources. It describes the producer-consumer problem that can occur when threads access a shared buffer without synchronization. It provides examples of incorrect and correct implementations of the producer-consumer pattern using wait(), notify(), and synchronization to allow a producer thread to add items to a buffer while a consumer thread removes items.
This document discusses interfaces in Java. It defines an interface as a blueprint of a class that defines static constants and abstract methods. Interfaces are used to achieve abstraction and multiple inheritance in Java. They represent an "is-a" relationship. There are three main reasons to use interfaces - for abstraction, to support multiple inheritance functionality, and to achieve loose coupling. The document provides examples of interfaces, such as a Printable interface and implementations in different classes. It also demonstrates multiple inheritance using interfaces and interface inheritance.
Computer Graphics - Bresenham's line drawing algorithm & Mid Point Circle alg...Saikrishna Tanguturu
The document discusses algorithms for drawing lines and circles on a digital display. It describes Bresenham's line drawing algorithm which plots discrete points along a line to approximate it on the pixel grid. It uses decision parameters to determine whether to increment the x or y coordinate to best fit the line. For circles, it explains using the midpoint circle algorithm which calculates decision parameters based on the distance of pixel midpoints to the circle boundary to iteratively plot points. The document provides pseudocode to implement Bresenham's circle algorithm. It also lists the initial values and decision parameter updates required.
Bressenham’s Midpoint Circle Drawing AlgorithmMrinmoy Dalal
This document explains Bresenham's midpoint circle drawing algorithm. It defines a circle as all points equidistant from a center point. The algorithm uses integer arithmetic to iteratively determine the next pixel on the circle circumference. It starts at an initial point and calculates a decision parameter P to determine if the next point is above or below along the y-axis. It tabulates an example of drawing a circle of radius 10 centered at the origin to demonstrate how P is used to progress around the circle octant by octant.
An activity provides a screen for users to interact with an Android application. Activities are organized into a stack and have a lifecycle of states like resumed and paused. To create an activity, you subclass the Activity class and implement callback methods corresponding to lifecycle states like onCreate and onPause. Activities must be declared in the app manifest and can be started with an intent.
This document provides an overview of object-oriented programming (OOP) concepts. It defines OOP as a programming technique that uses objects and classes. Key concepts discussed include classes and objects, inheritance, data abstraction, encapsulation, and polymorphism. Benefits of OOP include reusability, extensibility, understandability and security. Inheritance allows reuse of existing classes, and can be single, multiple, public, protected or private. Data abstraction hides background details and provides essential information. Encapsulation binds data and functions that manipulate the data. Polymorphism enables different object types to respond to the same function name.
The Delphi technique was developed to gain expert consensus on estimates without group influence. It can be adapted for software cost estimation by having estimators provide anonymous estimates in rounds. A coordinator summarizes estimates between rounds and asks outliers to justify differences, iterating until consensus. A variation allows group discussion with the coordinator but maintains anonymous estimating to focus on variances. Additional information may be needed if consensus is not reached.
The objective is to explain how a software design may be represented as a set of interacting objects that manage their own state and operations and to introduce various models that describe an object-oriented design.
This document defines object-oriented programming and compares it to structured programming. It outlines the main principles of OOP including encapsulation, abstraction, inheritance, and polymorphism. Encapsulation binds code and data together for security and consistency. Abstraction hides implementation details and provides functionality. Inheritance allows classes to acquire properties from other classes in a hierarchy. Polymorphism enables different types to perform the same methods.
SDI allows each document to have its own independent window, while MDI allows multiple document windows to exist within a single parent window. The Visual Basic IDE can be viewed in SDI mode, with separate windows for each component, or MDI mode, with components nested within a single IDE window. To create an MDI application, add an MDI Form as the parent container and additional Forms set as MDI Children.
This document discusses implementation of inheritance in Java and C#. It covers key inheritance concepts like simple, multilevel, and hierarchical inheritance. It provides examples of inheritance in Java using keywords like extends, super, this. Interfaces are discussed as a way to achieve multiple inheritance in Java. The document also discusses implementation of inheritance in C# using concepts like calling base class constructors and defining virtual methods.
The document discusses access specifiers in C++ classes. There are three access specifiers: public, private, and protected. Private restricts access to class members to only within the class, public allows access from anywhere, and protected is used for inheritance but not discussed here. By default, members are private. Public members can be accessed from outside the class, while private members can only be accessed within class functions. Access specifiers control the scope and accessibility of class members.
Object-oriented analysis and design (OOAD) is a popular approach for analyzing, designing, and developing applications using the object-oriented paradigm. It involves modeling a system as a group of interacting objects at various levels of abstraction. Key concepts in OOAD include objects, classes, attributes, methods, encapsulation, inheritance, polymorphism, and relationships like association, aggregation, and composition. Common OOAD techniques include use case diagrams, which show interactions between actors and the system, and class diagrams, which describe the structure and behavior of system objects and their relationships.
In this core java training session, you will learn Collections – Lists, Sets. Topics covered in this session are:
• List – ArrayList, LinkedList
• Set – HashSet, LinkedHashSet, TreeSet
For more information about this course visit on this link: https://www.mindsmapped.com/courses/software-development/learn-java-fundamentals-hands-on-training-on-core-java-concepts/
This document discusses classes and objects in object-oriented analysis and design. It defines objects as having state, behavior, and identity, with similar objects defined by common classes. Classes represent groups of objects with similar behavior and structures. The relationships between classes and objects are explored, including generalization, aggregation, and association. Identification of classes and objects in analysis is discussed through various approaches like use case analysis and CRC cards. The importance of proper classification and key abstractions and mechanisms are also covered.
UML deployment diagrams show the physical deployment of software components across hardware infrastructure. They depict the hardware elements like processors and devices, the software installed on each processor, and how the components connect. Deployment diagrams are created during system implementation to layout the physical architecture and are useful for embedded, client-server, and distributed systems to distinguish interfaces from data and host multiple software versions across servers.
This document discusses class diagrams and object diagrams. Class diagrams model the static design of a system by describing classes and their attributes/methods. Object diagrams show instances of classes at a specific time by depicting objects and their relationships. Key differences are that class diagrams define types while object diagrams show state, and class diagrams are blueprints while object diagrams capture snapshots.
Encapsulation involves making fields in a class private and providing access to them via public methods. This creates a protective barrier preventing random access from external code, and allows modification of internal implementation without breaking existing code. Encapsulation makes code more maintainable, flexible and extensible by hiding implementation details and controlling access to class fields and methods.
This document discusses inheritance in object-oriented programming. It defines inheritance as establishing a link between classes that allows sharing and accessing properties. There are three types of inheritance: single, multilevel, and hierarchical. Single inheritance involves one parent and one child class, multilevel inheritance adds intermediate classes, and hierarchical inheritance has one parent and multiple child classes. The document provides examples of inheritance code in Java and demonstrates a program using inheritance with interfaces. It notes some limitations of inheritance in Java.
This document discusses inter-thread communication methods like wait() and notify() that allow threads to synchronize access to shared resources. It describes the producer-consumer problem that can occur when threads access a shared buffer without synchronization. It provides examples of incorrect and correct implementations of the producer-consumer pattern using wait(), notify(), and synchronization to allow a producer thread to add items to a buffer while a consumer thread removes items.
This document discusses interfaces in Java. It defines an interface as a blueprint of a class that defines static constants and abstract methods. Interfaces are used to achieve abstraction and multiple inheritance in Java. They represent an "is-a" relationship. There are three main reasons to use interfaces - for abstraction, to support multiple inheritance functionality, and to achieve loose coupling. The document provides examples of interfaces, such as a Printable interface and implementations in different classes. It also demonstrates multiple inheritance using interfaces and interface inheritance.
Computer Graphics - Bresenham's line drawing algorithm & Mid Point Circle alg...Saikrishna Tanguturu
The document discusses algorithms for drawing lines and circles on a digital display. It describes Bresenham's line drawing algorithm which plots discrete points along a line to approximate it on the pixel grid. It uses decision parameters to determine whether to increment the x or y coordinate to best fit the line. For circles, it explains using the midpoint circle algorithm which calculates decision parameters based on the distance of pixel midpoints to the circle boundary to iteratively plot points. The document provides pseudocode to implement Bresenham's circle algorithm. It also lists the initial values and decision parameter updates required.
Bressenham’s Midpoint Circle Drawing AlgorithmMrinmoy Dalal
This document explains Bresenham's midpoint circle drawing algorithm. It defines a circle as all points equidistant from a center point. The algorithm uses integer arithmetic to iteratively determine the next pixel on the circle circumference. It starts at an initial point and calculates a decision parameter P to determine if the next point is above or below along the y-axis. It tabulates an example of drawing a circle of radius 10 centered at the origin to demonstrate how P is used to progress around the circle octant by octant.
Bresenham's line algorithm is an efficient method for drawing lines on a discrete grid such as a display. It works by calculating the next pixel to plot along the line based on the difference between the true and discrete slopes. It starts at the initial point and calculates a decision variable di to determine whether to plot the next point horizontally or diagonally. This variable is updated using the slope to continually track the closest path to the true line.
(1) An ellipse is defined by the equation (x-h)2/a2 + (y-k)2/b2 = 1, where (h,k) is the center and a and b are the lengths of the major and minor axes.
(2) There are two methods to scan convert an ellipse - the polynomial method and trigonometric method.
(3) The midpoint ellipse algorithm uses a decision parameter p to recursively scan convert the ellipse pixel by pixel in a manner similar to the midpoint circle algorithm.
The document describes Bresenham's circle generation algorithm. It explains that circles have 8-point symmetry that can be exploited to only calculate a quarter circle. It derives the algorithm by interpolating discrete pixels along a small arc and choosing the pixel with minimum error. It determines the initial decision parameter and the recurrence relation to calculate the next decision parameter in the algorithm. The full pseudocode of the algorithm is also provided.
This document outlines the requirements for an electronic health record (EHR) system, including an overall description, specific requirements, diagrams, and a prototype demonstration. It discusses the problem-oriented medical record model and how problem lists have evolved in EHRs. The document also provides details on the proposed project timeline, technology requirements, basic EHR concepts and terminology, and a literature review on EHR adoption.
This document is a seminar report submitted by Ganesh Waghmare on the topic of Android OS. It contains chapters covering features of the Android OS, its architecture, application framework, libraries, runtime, kernel and more. The report was submitted to fulfill degree requirements at MAEER's MIT College of Engineering, Pune, under the guidance of Prof. Sukhada Bhingarkar. It includes an acknowledgment, table of contents, and glossary related to Android OS.
The Bresenham algorithm is another incremental scan conversion algorithm. It is useful alternative for the DDA
The big advantage of this algorithm is that it uses only integer calculations
The midpoint circle algorithm is similar to Bresenham's circle algorithm and uses the midpoint between pixels to determine whether the pixel is inside or outside a circle. It defines a decision parameter pi based on the midpoint and updates pi by integer amounts at each step to determine the next pixel along the circle. The initial value of pi is set to 5/4 - r when r is an integer to determine the first pixel.
Scan conversion is the process of representing continuous graphics objects as discrete pixels. It involves converting geometric primitives like lines and circles, defined by parameters, into a set of pixels that make up the primitive in an image. This involves mapping real-valued coordinates to integer pixel coordinates. One approach is to take the floor of the x and y values, while another is to take the floor of x+0.5 and y+0.5 to center the coordinate system at the pixel grid.
The document discusses line drawing algorithms in computer graphics. It defines a line segment and provides equations to determine the slope and y-intercept of a line given two endpoints. It then introduces the Digital Differential Analyzer (DDA) algorithm, an incremental scan conversion method that calculates the next point on the line based on the previous point's coordinates and the line's slope. The algorithm involves less floating point computation than directly using the line equation at each step. An example demonstrates applying DDA to scan convert a line between two points. Limitations of DDA include the processing costs of rounding and floating point arithmetic as well as accumulated round-off error over long line segments.
This document is a lecture outline for an introduction to computer graphics course. It outlines the course information and administrative details, provides an overview of topics to be covered including graphics systems, techniques, operations and a mathematical review. It also defines computer graphics, discusses image processing and analysis, and explains why computer graphics is an important field due to advances in computing power, visualization, and interaction capabilities.
The document describes the DDA line algorithm, a method for drawing lines on a digital display. It involves calculating the slope of the line between the starting and ending x,y coordinates, then using that slope to determine how much to increment the x and y values in each step until reaching the endpoint. Pixels are plotted at each x,y coordinate pair using the PutPixel function.
My Project Report Documentation with Abstract & SnapshotsUsman Sait
This document describes a restaurant finder application developed for Android phones. It includes snapshots and discussions of the application's key activities. The application allows users to search for restaurants by location and cuisine type. It then displays lists of matching restaurants along with ratings and reviews. Users can view more details about a selected restaurant, including getting directions, viewing the full review online, and calling the restaurant directly from the application.
This document provides an overview of an Android application development session that covers the Android framework, Android layouts, and basic UI widgets. The session will discuss the main components of the Android framework - activities, services, broadcast receivers, and content providers. It will explain how to design screens using linear, relative and list views in Android layouts. It will also demonstrate how to add basic widgets like text boxes, buttons, checkboxes and radio buttons to a user interface. Code examples are provided to illustrate how to set up activities, initialize views, and retrieve widget values.
This document provides an overview of intents, activities, broadcast receivers, and services in Android mobile application development. It defines intents as actions that can be performed, such as starting an activity or service. It describes the two types of intents - implicit and explicit. It also covers the lifecycles of activities and broadcast receivers, and distinguishes between started and bound services. Examples are provided for creating applications that use intents, activities, broadcast receivers, and services.
The action bar provides consistency across Android apps and allows adding navigation features, search, and other actions. It displays the activity title and app icon. To add an action bar, activities must extend ActionBarActivity if supporting older Android versions, or set the theme if supporting API 11+. Action buttons and menu items are defined in XML and inflated into the action bar. Clicking items calls onOptionsItemSelected() to handle the action. The up button navigates to the parent activity.
MAD-Lec8 Spinner Adapater and Intents (1).pptAnsarAhmad57
The document discusses Spinners (drop-down lists) in Android application development. It provides two ways to create Spinners - using an XML array or programmatically with an Adapter. It also includes code samples to define a Spinner in XML, create an Adapter, populate the Spinner, and handle item selection events.
Day 15: Content Provider: Using Contacts APIAhsanul Karim
This document discusses content providers in Android application development. It explains that content providers allow applications to share data by making application data available to other apps. A content provider is a class that implements methods to store and retrieve the type of data it handles. It also describes how to query, modify, and add data to content providers. Examples are provided of querying contact data from the device's contacts content provider and updating contact details by modifying the content provider data.
The document provides instructions for creating an Android application to demonstrate the activity lifecycle and passing data between activities. It involves creating multiple activities and linking them together. The main activity displays buttons to launch a second activity, select a contact, and change the background color. Methods are added to each activity to log lifecycle events to the logcat. When changing color or selecting contact, data is passed back to the main activity using startActivityForResult and onActivityResult. This allows the main activity to update the UI based on the result from other activities.
The document provides instructions for creating an Android application to demonstrate the activity lifecycle and passing data between activities. It involves creating multiple activities and linking them together. The main activity displays buttons to launch a second activity, select a contact, and change the background color. Methods are added to each activity to log lifecycle events to the logcat. When changing color or selecting contact, data is passed back to the main activity using startActivityForResult and onActivityResult. This allows the main activity to update the UI based on the result from other activities.
1. The document discusses Android activities, which provide interactive screens for users to perform tasks. Activities are created by subclassing the Activity base class and implementing callback methods like onCreate.
2. The document also discusses how to navigate between activities using intents, and how activities transition through various lifecycle states like onStart and onStop. An example app with registration and login activities is provided to demonstrate navigation between activities.
3. The document explains how to use shared preferences to store persistent data in Android applications. Shared preferences can be accessed via the PreferenceManager and values can be read and written by getting and putting values with keys. An example demonstrates reading a value set in a previous app session.
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.
The Content helps those who wish to program mobile applications using android platform. The content has been used to conduct mobile application boot camps using android platform on different regions in Tanzania
Multiple Activity and Navigation PrimerAhsanul Karim
The document discusses Android application development using activities and intents. It describes that an activity provides an interactive screen for a user to perform tasks like making calls or viewing maps. Applications typically contain multiple activities, with one specified as the main launch activity. Activities are created by subclassing the Activity base class and implementing callback methods like onCreate. Activities can transition between each other using intents passed to the startActivity() method. The document provides an example exercise to create registration and login activities with navigation between them. It also outlines the activity lifecycle in Android.
Day 3: Getting Active Through ActivitiesAhsanul Karim
The document discusses Android application development and activities. It describes how an Android application is structured with packages like src, res, assets etc. It explains what an activity is, how it provides the user interface, and how it loads views from XML layouts. It also provides an example of creating a simple project with an activity that displays the current time when a button is pressed to demonstrate the basic concepts.
Day 3: Getting Active Through ActivitiesAhsanul Karim
The document discusses Android application development and activities. It covers the anatomy of an Android application including activities, services, content providers, and broadcast receivers. It also discusses the lifecycle of activities and how to create activities that load layouts and handle user interactions through callbacks like onCreate(). An example is provided of building an app with an activity to display the current time when a button is pressed to demonstrate designing user interfaces and adding interactivity.
The document provides information about creating user interface elements like TextView, Button, and Spinner dynamically in Kotlin code. It explains how to define the elements in XML layout files and access them in Kotlin activities to set onClickListeners and other functionality. Key steps include modifying layout XML files, strings resources, and accessing elements and adding functionality in Kotlin files.
Mobile Application Development -Lecture 09 & 10.pdfAbdullahMunir32
This document discusses several key concepts in mobile application development for Android, including:
- Intents allow communication between application components and activities. They can start new activities explicitly by class or implicitly by requested action.
- Adapters bind data like arrays or cursors to views in a list. The ArrayAdapter and SimpleCursorAdapter are common choices.
- Dialogs present transient messages and allow user input. They can be created from Dialog classes, with a dialog theme, or as Toasts.
- Internet access requires the INTERNET permission. URLs can be opened to get input streams for processing web resources.
This post will walk you through Android ListView Tutorial for building simple and customized ListView using different Android adapters.
List is one of the most common UI patterns, which is being used extensively to display the collection of data elements in rows. In android ListView is a view group that displays a list of scrollable items. The list items are automatically inserted to the list using an Adapter that pulls content from a source such as an array.
Similar to Android App To Display Employee Details (20)
Supermarket Management System Project Report.pdfKamal Acharya
Supermarket management is a stand-alone J2EE using Eclipse Juno program.
This project contains all the necessary required information about maintaining
the supermarket billing system.
The core idea of this project to minimize the paper work and centralize the
data. Here all the communication is taken in secure manner. That is, in this
application the information will be stored in client itself. For further security the
data base is stored in the back-end oracle and so no intruders can access it.
Optimizing Gradle Builds - Gradle DPE Tour Berlin 2024Sinan KOZAK
Sinan from the Delivery Hero mobile infrastructure engineering team shares a deep dive into performance acceleration with Gradle build cache optimizations. Sinan shares their journey into solving complex build-cache problems that affect Gradle builds. By understanding the challenges and solutions found in our journey, we aim to demonstrate the possibilities for faster builds. The case study reveals how overlapping outputs and cache misconfigurations led to significant increases in build times, especially as the project scaled up with numerous modules using Paparazzi tests. The journey from diagnosing to defeating cache issues offers invaluable lessons on maintaining cache integrity without sacrificing functionality.
Prediction of Electrical Energy Efficiency Using Information on Consumer's Ac...PriyankaKilaniya
Energy efficiency has been important since the latter part of the last century. The main object of this survey is to determine the energy efficiency knowledge among consumers. Two separate districts in Bangladesh are selected to conduct the survey on households and showrooms about the energy and seller also. The survey uses the data to find some regression equations from which it is easy to predict energy efficiency knowledge. The data is analyzed and calculated based on five important criteria. The initial target was to find some factors that help predict a person's energy efficiency knowledge. From the survey, it is found that the energy efficiency awareness among the people of our country is very low. Relationships between household energy use behaviors are estimated using a unique dataset of about 40 households and 20 showrooms in Bangladesh's Chapainawabganj and Bagerhat districts. Knowledge of energy consumption and energy efficiency technology options is found to be associated with household use of energy conservation practices. Household characteristics also influence household energy use behavior. Younger household cohorts are more likely to adopt energy-efficient technologies and energy conservation practices and place primary importance on energy saving for environmental reasons. Education also influences attitudes toward energy conservation in Bangladesh. Low-education households indicate they primarily save electricity for the environment while high-education households indicate they are motivated by environmental concerns.
Blood finder application project report (1).pdfKamal Acharya
Blood Finder is an emergency time app where a user can search for the blood banks as
well as the registered blood donors around Mumbai. This application also provide an
opportunity for the user of this application to become a registered donor for this user have
to enroll for the donor request from the application itself. If the admin wish to make user
a registered donor, with some of the formalities with the organization it can be done.
Specialization of this application is that the user will not have to register on sign-in for
searching the blood banks and blood donors it can be just done by installing the
application to the mobile.
The purpose of making this application is to save the user’s time for searching blood of
needed blood group during the time of the emergency.
This is an android application developed in Java and XML with the connectivity of
SQLite database. This application will provide most of basic functionality required for an
emergency time application. All the details of Blood banks and Blood donors are stored
in the database i.e. SQLite.
This application allowed the user to get all the information regarding blood banks and
blood donors such as Name, Number, Address, Blood Group, rather than searching it on
the different websites and wasting the precious time. This application is effective and
user friendly.
Discover the latest insights on Data Driven Maintenance with our comprehensive webinar presentation. Learn about traditional maintenance challenges, the right approach to utilizing data, and the benefits of adopting a Data Driven Maintenance strategy. Explore real-world examples, industry best practices, and innovative solutions like FMECA and the D3M model. This presentation, led by expert Jules Oudmans, is essential for asset owners looking to optimize their maintenance processes and leverage digital technologies for improved efficiency and performance. Download now to stay ahead in the evolving maintenance landscape.
Build the Next Generation of Apps with the Einstein 1 Platform.
Rejoignez Philippe Ozil pour une session de workshops qui vous guidera à travers les détails de la plateforme Einstein 1, l'importance des données pour la création d'applications d'intelligence artificielle et les différents outils et technologies que Salesforce propose pour vous apporter tous les bénéfices de l'IA.
Tools & Techniques for Commissioning and Maintaining PV Systems W-Animations ...Transcat
Join us for this solutions-based webinar on the tools and techniques for commissioning and maintaining PV Systems. In this session, we'll review the process of building and maintaining a solar array, starting with installation and commissioning, then reviewing operations and maintenance of the system. This course will review insulation resistance testing, I-V curve testing, earth-bond continuity, ground resistance testing, performance tests, visual inspections, ground and arc fault testing procedures, and power quality analysis.
Fluke Solar Application Specialist Will White is presenting on this engaging topic:
Will has worked in the renewable energy industry since 2005, first as an installer for a small east coast solar integrator before adding sales, design, and project management to his skillset. In 2022, Will joined Fluke as a solar application specialist, where he supports their renewable energy testing equipment like IV-curve tracers, electrical meters, and thermal imaging cameras. Experienced in wind power, solar thermal, energy storage, and all scales of PV, Will has primarily focused on residential and small commercial systems. He is passionate about implementing high-quality, code-compliant installation techniques.
Digital Twins Computer Networking Paper Presentation.pptxaryanpankaj78
A Digital Twin in computer networking is a virtual representation of a physical network, used to simulate, analyze, and optimize network performance and reliability. It leverages real-time data to enhance network management, predict issues, and improve decision-making processes.
Accident detection system project report.pdfKamal Acharya
The Rapid growth of technology and infrastructure has made our lives easier. The
advent of technology has also increased the traffic hazards and the road accidents take place
frequently which causes huge loss of life and property because of the poor emergency facilities.
Many lives could have been saved if emergency service could get accident information and
reach in time. Our project will provide an optimum solution to this draw back. A piezo electric
sensor can be used as a crash or rollover detector of the vehicle during and after a crash. With
signals from a piezo electric sensor, a severe accident can be recognized. According to this
project when a vehicle meets with an accident immediately piezo electric sensor will detect the
signal or if a car rolls over. Then with the help of GSM module and GPS module, the location
will be sent to the emergency contact. Then after conforming the location necessary action will
be taken. If the person meets with a small accident or if there is no serious threat to anyone’s
life, then the alert message can be terminated by the driver by a switch provided in order to
avoid wasting the valuable time of the medical rescue team.
Software Engineering and Project Management - Software Testing + Agile Method...Prakhyath Rai
Software Testing: A Strategic Approach to Software Testing, Strategic Issues, Test Strategies for Conventional Software, Test Strategies for Object -Oriented Software, Validation Testing, System Testing, The Art of Debugging.
Agile Methodology: Before Agile – Waterfall, Agile Development.
Height and depth gauge linear metrology.pdfq30122000
Height gauges may also be used to measure the height of an object by using the underside of the scriber as the datum. The datum may be permanently fixed or the height gauge may have provision to adjust the scale, this is done by sliding the scale vertically along the body of the height gauge by turning a fine feed screw at the top of the gauge; then with the scriber set to the same level as the base, the scale can be matched to it. This adjustment allows different scribers or probes to be used, as well as adjusting for any errors in a damaged or resharpened probe.
1. Android Application Development
Android app to display employee details – Group 1 Page 1
Version 2.2 (Froyo)
A Project Report
On
“Android app to display Employee details
For Android Phones”
Assigned by:
Ganesh Kumar
2. Android Application Development
Android app to display employee details – Group 1 Page 2
Self-Declaration
All the below information has been provided to the best of our knowledge as part of the
Application development for the documentation purpose only for the demonstration.
Group – 1 Detail:
Index
S.No Content Information
1 Introductionof Application
2 Dependencies /Limitations
3 Application Design
4 Application Output
5 Output file
3. Android Application Development
Android app to display employee details – Group 1 Page 3
Roles of our Team:
MEMBER: ROLE:
SAIKRISHNA TANGUTURU Project Lead
TINNALURI V N PRASANTH Dev Lead
SHENBAGAMOORTHY A Developer
PRANOB JYOTI KALITA Developer
RAYAPU MOSES Developer
ANURUPA K C Test Lead
KONDALA SUMATHI Tester
DASIKA KRISHNA Tester
ARUNJUNAISELVAM P Tester
SHEIK SANAVULLA Support
4. Android Application Development
Android app to display employee details – Group 1 Page 4
1. Introduction of Application:
This Application displays the employee details of a Particular employee. It will use the following
technique to search the details for the particular employee:-
By matching the employee names.
After fetching the employee from the list we can use the application to call or text
message(SMS) and Email.
This application will work on 2.2(Froyo) & higher versions.
Step 1 Basic Layout:
In this first step, we define the user interface for searching employees.
Code highlights:
EmployeeList.java: The default Activity of the application. setContentView() is used to set the layout to
main.xml.
main.xml: the layout for the default activity of the application.
5. Android Application Development
Android app to display employee details – Group 1 Page 5
Go To Index
Step: 2 Working with Lists
In this second step, we add a ListView component that will be used (in the following step) to display the
list of employees matching the search criteria. In this step, we just use an ArrayAdapter to display
sample data in the list.
Code highlights:
main.xml: The updated layout with the ListView.
EmployeeList.java: An ArrayAdapter is used to populate the ListView.
6. Android Application Development
Android app to display employee details – Group 1 Page 6
Go To Index
Step 3: Working with a SQLite Database
In this third step, we use a SQLite database to persist the employees. When the user clicks the Search
button, we query the database, and populate the list with the employees matching the search criteria.
Code highlights:
EmployeeList.java:
In onCreate(), we use the DatabaseHelper class to open the database.
In search(), we use a Cursor to query the database. We then use a SimpleCursorAdapter to bind the
ListView to the Cursor using a custom layout (employee_list_item) to display each item in the list.
DatabaseHelper.java: We extend SQLiteOpenHelper to manage the access to our database: If the
database doesn’t yet exist, we create the employee table and populate it with sample data.
employee_list_item.xml: Layout to display each item in the list.
Step 4: Using Intents and passing information between Activities
In this fourth step, we create an Activity to display the details of the employee selected in the list. We
start the EmployeeDetails activity by creating an Intent.
7. Android Application Development
Android app to display employee details – Group 1 Page 7
Go To Index
Code highlights:
EmployeeList.java: in onListItemClick, we create a new Intent for the EmployeeDetails class, add the
employee id to the intent using intent.putExtra(), and start a new Activity.
EmployeeDetails.java: The Employee details activity. We retrieve the id of the employee using
getIntent().getIntExtra(). We then use a Cursor to retrieve the employee details.
employee_details.xml: A simple layout to display the details of an employee.
Go To Index
8. Android Application Development
Android app to display employee details – Group 1 Page 8
Step 5: Calling, Emailing, and Texting an Employee
In this fifth step, we interact with some of the built-in capabilities of our phone. We use Intents to allow
the user to call, email, or text an employee. We reuse the EmployeeDetails Activity to allow the user to
display the details of the manager of the selected employee.
Code highlights:
EmployeeDetails.java:
In onCreate(), we build an array of actions (call, email, sms, view manager) available to the user
depending on the information available for the displayed employee (for example, we only create a “Call
mobile” action if the employee’s mobile phone number is available in the database).
EmployeeActionAdapter is a custom list adapter that binds each action in the actions array to the
action_list_item layout.
In onListItemClick(), we create an Intent corresponding to the action selected by the user, and start a
new activity with that intent.
action_list_item.xml: Layout for each action in the actions list.
employee_details.xml: Updated employee details layout.
9. Android Application Development
Android app to display employee details – Group 1 Page 9
Go To Index
Step 6: Navigating Up and Down the Org Chart
Code highlights:
DirectReports.java: A new Activity to display the direct reports of a specific employee.
direct_reports.xml: The layout for the DirectReports Activity.
EmployeeDetails.java: “View direct reports” is added to the list of actions. When the user selects that
action, a new Intent is created for the DirectReports Activity, and a new Activity is started using that
Intent.
DatabaseHelper.java: Instead of populating the database with hardcoded sample data, the employee
table is now created and populated from an XML file (sql.xml).
sql.xml: The xml file used to create and populate the employee table.
11. Android Application Development
Android app to display employee details – Group 1 Page 11
CODE:
Main.xml
The layout for the default activity of the application.
<?xml version="1.0" encoding="utf-8"?>
<LinearLayoutxmlns:android="http://schemas.android.com/apk/res/android"
android:orientation="vertical"
android:layout_width="fill_parent"
android:layout_height="fill_parent">
<LinearLayout
android:orientation="horizontal"
android:layout_width="fill_parent"
android:layout_height="wrap_content">
<EditText
android:id="@+id/searchText"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_weight="1"/>
<Button
android:id="@+id/searchButton"
android:text="Search"
android:layout_width="wrap_content"
android:layout_height="wrap_content"/>
</LinearLayout>
<ListView
12. Android Application Development
Android app to display employee details – Group 1 Page 12
android:id="@+id/list"
android:layout_width="fill_parent"
android:layout_height="fill_parent"/>
</LinearLayout>
EmployeeList.java:
The default Activity of the application.setContentView() is used to set the layout to main.xml.
In onCreate(), we use the DatabaseHelper class to open the database.
In search(), we use a Cursor to query the database. We then use a SimpleCursorAdapter to bind
the ListView to the Cursor using a custom layout (employee_list_item) to display each item in
the list.
packagesamples.employeedirectory;
import android.app.ListActivity;
import android.content.Intent;
import android.database.Cursor;
import android.database.sqlite.SQLiteDatabase;
import android.os.Bundle;
import android.view.View;
import android.widget.EditText;
import android.widget.ListAdapter;
import android.widget.ListView;
import android.widget.SimpleCursorAdapter;
public class EmployeeList extends ListActivity {
protectedEditTextsearchText;
protectedSQLiteDatabasedb;
protected Cursor cursor;
protectedListAdapter adapter;
/** Called when the activity is first created. */
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
13. Android Application Development
Android app to display employee details – Group 1 Page 13
setContentView(R.layout.main);
db = (new DatabaseHelper(this)).getWritableDatabase();
searchText = (EditText) findViewById (R.id.searchText);
}
public void search(View view) {
// || is the concatenation operation in SQLite
cursor = db.rawQuery("SELECT _id, firstName, lastName, title FROM employee WHERE
firstName || ' ' || lastName LIKE ?",
new String[]{"%" + searchText.getText().toString() + "%"});
adapter = new SimpleCursorAdapter(
this,
R.layout.employee_list_item,
cursor,
new String[] {"firstName", "lastName", "title"},
newint[] {R.id.firstName, R.id.lastName, R.id.title});
setListAdapter(adapter);
}
public void onListItemClick(ListView parent, View view, int position, long id) {
Intent intent = new Intent(this, EmployeeDetails.class);
Cursor cursor = (Cursor) adapter.getItem(position);
intent.putExtra("EMPLOYEE_ID", cursor.getInt(cursor.getColumnIndex("_id")));
startActivity(intent);
}
}
14. Android Application Development
Android app to display employee details – Group 1 Page 14
DatabaseHelper.java
We extend SQLiteOpenHelper to manage the access to our database: If the database
doesn’t yet exist, we create the employee table and populate it with sample data.
packagesamples.employeedirectory;
import android.content.ContentValues;
import android.content.Context;
import android.database.sqlite.SQLiteDatabase;
import android.database.sqlite.SQLiteOpenHelper;
public class DatabaseHelper extends SQLiteOpenHelper {
public static final String DATABASE_NAME = "employee_directory";
publicDatabaseHelper(Context context) {
super(context, DATABASE_NAME, null, 1);
}
@Override
public void onCreate(SQLiteDatabasedb) {
/*
* Create the employee table and populate it with sample data.
* In step 6, we will move these hardcoded statements to an XML document.
*/
String sql = "CREATE TABLE IF NOT EXISTS employee (" +
"_id INTEGER PRIMARY KEY AUTOINCREMENT, " +
"firstName TEXT, " +
"lastName TEXT, " +
"title TEXT, " +
"officePhone TEXT, " +
"cellPhone TEXT, " +
"email TEXT, " +
"managerId INTEGER)";
db.execSQL(sql);
ContentValues values = new ContentValues();
values.put("firstName", "John");
values.put("lastName", "Smith");
17. Android Application Development
Android app to display employee details – Group 1 Page 17
EmployeeDetails.java
In onCreate(), we build an array of actions (call, email, sms, view manager) available to
the user depending on the information available for the displayed employee (for
example, we only create a “Call mobile” action if the employee’s mobile phone number
is available in the database).
EmployeeActionAdapter is a custom list adapter that binds each action in the actions
array to the action_list_item layout.
In onListItemClick(), we create an Intent corresponding to the action selected by the
user, and start a new activity with that intent.
packagesamples.employeedirectory;
import java.util.ArrayList;
import java.util.List;
import android.app.ListActivity;
import android.content.Intent;
import android.database.Cursor;
import android.database.sqlite.SQLiteDatabase;
import android.net.Uri;
import android.os.Bundle;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.ArrayAdapter;
import android.widget.ListView;
import android.widget.TextView;
public class EmployeeDetails extends ListActivity {
protectedTextViewemployeeName;
protectedTextViewemployeeTitle;
protectedTextViewofficePhone;
protectedTextViewcellPhone;
protectedTextView email;
protectedintemployeeId;
18. Android Application Development
Android app to display employee details – Group 1 Page 18
protectedintmanagerId;
protected List<EmployeeAction> actions;
protectedEmployeeActionAdapter adapter;
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.employee_details);
employeeId = getIntent().getIntExtra("EMPLOYEE_ID", 0);
SQLiteDatabasedb = (new DatabaseHelper(this)).getWritableDatabase();
Cursor cursor = db.rawQuery("SELECT emp._id, emp.firstName, emp.lastName,
emp.title, emp.officePhone, emp.cellPhone, emp.email, emp.managerId,
mgr.firstNamemanagerFirstName, mgr.lastNamemanagerLastName FROM employee
emp LEFT OUTER JOIN employee mgr ON emp.managerId = mgr._id WHERE emp._id =
?",
new String[]{""+employeeId});
if (cursor.getCount() == 1)
{
cursor.moveToFirst();
employeeName = (TextView) findViewById(R.id.employeeName);
employeeName.setText(cursor.getString(cursor.getColumnIndex("firstName")) + " " +
cursor.getString(cursor.getColumnIndex("lastName")));
employeeTitle = (TextView) findViewById(R.id.title);
employeeTitle.setText(cursor.getString(cursor.getColumnIndex("title")));
actions = new ArrayList<EmployeeAction>();
String officePhone = cursor.getString(cursor.getColumnIndex("officePhone"));
if (officePhone != null) {
actions.add(new EmployeeAction("Call office", officePhone,
EmployeeAction.ACTION_CALL));
}
19. Android Application Development
Android app to display employee details – Group 1 Page 19
String cellPhone = cursor.getString(cursor.getColumnIndex("cellPhone"));
if (cellPhone != null) {
actions.add(new EmployeeAction("Call mobile", cellPhone,
EmployeeAction.ACTION_CALL));
actions.add(new EmployeeAction("SMS", cellPhone, EmployeeAction.ACTION_SMS));
}
String email = cursor.getString(cursor.getColumnIndex("email"));
if (email != null) {
actions.add(new EmployeeAction("Email", email, EmployeeAction.ACTION_EMAIL));
}
managerId = cursor.getInt(cursor.getColumnIndex("managerId"));
if (managerId>0) {
actions.add(new EmployeeAction("View manager",
cursor.getString(cursor.getColumnIndex("managerFirstName")) + " " +
cursor.getString(cursor.getColumnIndex("managerLastName")),
EmployeeAction.ACTION_VIEW));
}
adapter = new EmployeeActionAdapter();
setListAdapter(adapter);
}
}
public void onListItemClick(ListView parent, View view, int position, long id) {
EmployeeAction action = actions.get(position);
Intent intent;
switch (action.getType()) {
caseEmployeeAction.ACTION_CALL:
Uri callUri = Uri.parse("tel:" + action.getData());
intent = new Intent(Intent.ACTION_CALL, callUri);
startActivity(intent);
20. Android Application Development
Android app to display employee details – Group 1 Page 20
break;
caseEmployeeAction.ACTION_EMAIL:
intent = new Intent(Intent.ACTION_SEND);
intent.setType("plain/text");
intent.putExtra(Intent.EXTRA_EMAIL, new String[]{action.getData()});
startActivity(intent);
break;
caseEmployeeAction.ACTION_SMS:
Uri smsUri = Uri.parse("sms:" + action.getData());
intent = new Intent(Intent.ACTION_VIEW, smsUri);
startActivity(intent);
break;
caseEmployeeAction.ACTION_VIEW:
intent = new Intent(this, EmployeeDetails.class);
intent.putExtra("EMPLOYEE_ID", managerId);
startActivity(intent);
break;
}
}
classEmployeeActionAdapter extends ArrayAdapter<EmployeeAction> {
EmployeeActionAdapter() {
super(EmployeeDetails.this, R.layout.action_list_item, actions);
}
@Override
public View getView(int position, View convertView, ViewGroup parent) {
EmployeeAction action = actions.get(position);
LayoutInflaterinflater = getLayoutInflater();
View view = inflater.inflate(R.layout.action_list_item, parent, false);
TextView label = (TextView) view.findViewById(R.id.label);
label.setText(action.getLabel());
TextView data = (TextView) view.findViewById(R.id.data);
data.setText(action.getData());
21. Android Application Development
Android app to display employee details – Group 1 Page 21
return view;
}
}
}
DirectReports.java
A new Activity to display the direct reports of a specific employee.
packagesamples.employeedirectory;
import android.app.ListActivity;
import android.content.Intent;
import android.database.Cursor;
import android.database.sqlite.SQLiteDatabase;
import android.os.Bundle;
import android.view.View;
import android.widget.ListAdapter;
import android.widget.SimpleCursorAdapter;
import android.widget.ListView;
import android.widget.TextView;
public class DirectReports extends ListActivity {
protected Cursor cursor=null;
protectedListAdapter adapter;
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.direct_reports);
SQLiteDatabasedb = (new DatabaseHelper(this)).getWritableDatabase();
22. Android Application Development
Android app to display employee details – Group 1 Page 22
intemployeeId = getIntent().getIntExtra("EMPLOYEE_ID", 0);
Cursor cursor = db.rawQuery("SELECT _id, firstName, lastName, title FROM
employee WHERE _id = ?",
new String[]{""+employeeId});
if (cursor.getCount() != 1)
{
return;
}
cursor.moveToFirst();
TextViewemployeeNameText = (TextView) findViewById(R.id.employeeName);
employeeNameText.setText(cursor.getString(cursor.getColumnIndex("firstName")) + " "
+ cursor.getString(cursor.getColumnIndex("lastName")));
TextViewtitleText = (TextView) findViewById(R.id.title);
titleText.setText(cursor.getString(cursor.getColumnIndex("title")));
cursor = db.rawQuery("SELECT _id, firstName, lastName, title, officePhone, cellPhone,
email FROM employee WHERE managerId = ?",
new String[]{""+employeeId});
adapter = new SimpleCursorAdapter(
this,
R.layout.employee_list_item,
cursor,
new String[] {"firstName", "lastName", "title"},
newint[] {R.id.firstName, R.id.lastName, R.id.title});
setListAdapter(adapter);
}
public void onListItemClick(ListView parent, View view, int position, long id) {
Intent intent = new Intent(this, EmployeeDetails.class);
Cursor cursor = (Cursor) adapter.getItem(position);
intent.putExtra("EMPLOYEE_ID", cursor.getInt(cursor.getColumnIndex("_id")));
startActivity(intent);
}
23. Android Application Development
Android app to display employee details – Group 1 Page 23
}
2. Dependencies /Limitations:
This Application will work only on Android based Platforms such as mobile devices. It will not
work on Windows Platforms (which devices are using windows OS such as Windows Phone or
Computers).
24. Android Application Development
Android app to display employee details – Group 1 Page 24
3. Application Design
employee_list_item.xml
Layout to display each item in the list
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayoutxmlns:android="http://schemas.android.com/apk/res/android"
android:orientation="horizontal"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:padding="8px">
<TextView
android:id="@+id/firstName"
android:layout_width="wrap_content"
android:layout_height="wrap_content"/>
<TextView
android:id="@+id/lastName"
android:layout_marginLeft="6px"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_toRightOf="@id/firstName"/>
<TextView
android:id="@+id/title"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_below="@id/firstName"/>
</RelativeLayout>
25. Android Application Development
Android app to display employee details – Group 1 Page 25
action_list_item.xml
Layout for each action in the actions list.
<?xml version="1.0" encoding="utf-8"?>
<LinearLayoutxmlns:android="http://schemas.android.com/apk/res/android"
android:orientation="vertical"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:padding="8px">
<!--
<ImageView
android:id="@+id/icon"
android:layout_width="22px"
android:layout_height="wrap_content"
android:src="@drawable/icon"/>
-->
<TextView
android:id="@+id/label"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textColor="#FFFFFF"/>
<TextView
android:id="@+id/data"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textSize="16px"/>
</LinearLayout>
27. Android Application Development
Android app to display employee details – Group 1 Page 27
direct_reports.xml
The layout for the DirectReports Activity.
<?xml version="1.0" encoding="utf-8"?>
<LinearLayoutxmlns:android="http://schemas.android.com/apk/res/android"
android:orientation="vertical"
android:layout_width="fill_parent"
android:layout_height="fill_parent">
<LinearLayout
android:orientation="vertical"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:background="#505050"
android:padding="8px">
<TextView
android:id="@+id/employeeName"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textColor="#FFFFFF"/>
<TextView
android:id="@+id/title"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textColor="#FFFFFF"/>
</LinearLayout>
<ListView
android:id="@android:id/list"
android:layout_width="fill_parent"
android:layout_height="fill_parent"/>
</LinearLayout>
Go To Index
28. Android Application Development
Android app to display employee details – Group 1 Page 28
sql.xml
The xml file used to create and populate the employee table.
<sql>
<statement>
CREATE TABLE IF NOT EXISTS employee (
_id INTEGER PRIMARY KEY AUTOINCREMENT,
firstName VARCHAR(50),
lastName VARCHAR(50),
title VARCHAR(50),
department VARCHAR(50),
managerId INTEGER,
city VARCHAR(50),
officePhone VARCHAR(30),
cellPhone VARCHAR(30),
email VARCHAR(30),
picture VARCHAR(200))
</statement>
<statement>INSERT INTO employee VALUES(1,'Ryan','Howard','Vice President, North East',
'Management', NULL, 'Scranton','570-999-8888','570-999-
8887','ryan@dundermifflin.com','howard.jpg')</statement>
<statement>INSERT INTO employee VALUES(2,'Michael','Scott','Regional
Manager','Management',1,'Scranton','570-888-9999','570-222-
3333','michael@dundermifflin.com','scott.jpg')</statement>
<statement>INSERT INTO employee VALUES(3,'Dwight','Schrute','Assistant Regional
Manager','Management',2,'Scranton','570-444-4444','570-333-
3333','dwight@dundermifflin.com','schrute.jpg')</statement>
<statement>INSERT INTO employee VALUES(4,'Jim','Halpert','Assistant Regional
Manager','Manage',2,'Scranton','570-222-2121','570-999-
1212','jim@dundermifflin.com','halpert.jpg')</statement>
<statement>INSERT INTO employee
VALUES(5,'Pamela','Beesly','Receptionist','',2,'Scranton','570-999-5555','570-999-
7474','pam@dundermifflin.com','beesly.jpg')</statement>
<statement>INSERT INTO employee VALUES(6,'Angela','Martin','Senior
Accountant','Accounting',2,'Scranton','570-555-9696','570-999-
3232','angela@dundermifflin.com','martin.jpg')</statement>
<statement>INSERT INTO employee
VALUES(7,'Kevin','Malone','Accountant','Accounting',6,'Scranton','570-777-9696','570-111-
2525','kmalone@dundermifflin.com','malone.jpg')</statement>
29. Android Application Development
Android app to display employee details – Group 1 Page 29
<statement>INSERT INTO employee
VALUES(8,'Oscar','Martinez','Accountant','Accounting',6,'Scranton','570-321-9999','570-585-
3333','oscar@dundermifflin.com','martinez.jpg')</statement>
<statement>INSERT INTO employee VALUES(9,'Creed','Bratton','Quality
Assurance','Customer Services',2,'Scranton','570-222-6666','333-
8585','creed@dundermifflin.com','bratton.jpg')</statement>
<statement>INSERT INTO employee VALUES(10,'Andy','Bernard','Sales
Director','Sales',2,'Scranton','570-555-0000','570-546-
9999','andy@dundermifflin.com','bernard.jpg')</statement>
<statement>INSERT INTO employee VALUES(11,'Phyllis','Lapin','Sales
Representative','Sales',10,'Scranton','570-141-3333','570-888-
6666','phyllis@dundermifflin.com','lapin.jpg')</statement>
<statement>INSERT INTO employee VALUES(12,'Stanley','Hudson','Sales
Representative','Sales',10,'Scranton','570-700-6666','570-777-
6666','shudson@dundermifflin.com','hudson.jpg')</statement>
<statement>INSERT INTO employee VALUES(13,'Meredith','Palmer','Supplier
Relations','Customer Services',2,'Scranton','570-555-8888','570-777-
2222','meredith@dundermifflin.com','palmer.jpg')</statement>
<statement>INSERT INTO employee VALUES(14,'Kelly','Kapoor','Customer Service
Rep.','Customer Services',2,'Scranton','570-123-9654','570-125-
3666','kelly@dundermifflin.com','kapoor.jpg')</statement>
</sql>
Go To Index