470 likes | 1.17k Views
Unit 4. Marking System. Unit IV (10 questions ) 8 questions one mark (Theory) 2 questions two marks (Code snippets) Total Marks : 12. Introduction to Android.
E N D
Marking System Unit IV (10 questions ) 8 questions one mark (Theory) 2 questions two marks (Code snippets) Total Marks : 12
Introduction to Android • Android is an open source and Linux-based operating system for mobile devices such as smart phones and tablet computers. • Android was developed by the Open Handset Alliance, led by Google, and other companies.
Android - Environment Setup Operating System • Microsoft Windows XP or later version. • Mac OS X 10.5.8 or later version with Intel chip. • Linux including GNU C Library 2.7 or later. Android IDEs There are so many sophisticated Technologies are available to develop android applications, the familiar technologies, which are predominantly using tools as follows • Android Studio • Eclipse IDE(Deprecated)
Android operating system is a stack of software components which is divided into fivesections and four main layers as shown below in the architecture diagram. Android Applications Android Framework Libraries Dalvik Runtime Linux Kernel
Linux kernel • It take care he core system operations such as process management, power management, memory management, Device driver and networking. • This provides a level of abstraction between the device hardware and it contains all the essential hardware drivers like camera, keypad, display etc.
Android Libraries • This category encompasses those Java-based libraries that are specific to Android development. • This category include the application framework libraries in addition to those that facilitate user interface building, graphics drawing and database access.
android.app − Provides access to the application model and is the cornerstone of all Android applications. android.content − Facilitates content access, publishing and messaging between applications and application components. android.database− Used to access data published by content providers and includes SQLite database management classes. android.opengl − A Java interface to the OpenGL ES 3D graphics rendering API. android.os − Provides applications with access to standard operating system services including messages, system services and inter-process communication. android.text− Used to render and manipulate text on a device display. android.view− The fundamental building blocks of application user interfaces. android.widget− A rich collection of pre-built user interface components such as buttons, labels, list views, layout managers, radio buttons etc. android.webkit − A set of classes intended to allow web-browsing capabilities to be built into applications.
Android Runtime • DalvikVirtual Machineis a kind of Java Virtual Machine specially designed and optimized for Android. • The Dalvik VM makes use of Linux core features like memory management and multi-threading. • The Dalvik VM enables every Android application to run in its own process, with its own instance of the Dalvik virtual machine. • The Dex compiler converts the class files into the .dex file that run on the DalvikVM
Android Framework Layer The Application Framework layer provides many higher-level services to applications in the form of Java classes. Application developers are allowed to make use of these services in their applications. Activity Manager − Manage activity life cycle of application. Content Providers − Allows applications to publish and share data with other applications(Data Sharing) Resource Manager − Provides resources such as strings, color settings and user interface layouts. Notifications Manager − Allows applications to display alerts and notifications to the user. Telephony System− Manage all voice call.
Android Applications Layer • This layer responsible to holding users application. Such as home, Phone contacts browser etc. • Developer can replaces any existing application.
What is Embedded System • System • A system is an arrangement in which all its unit assemble work together according to a set of rules. • Embedded System • An embedded system is a microcontroller or microprocessor based system which is designed to perform a specific task. • For example, a fire alarm is an embedded system; it will sense only smoke.
Characteristics of an Embedded System • Single-functioned • Tightly constrained • Reactive and Real time • Microprocessors based • Memory • HW-SW systems
Advantages • Easily Customizable • Low power consumption • Low cost • Enhanced performance • Disadvantages • High development effort • Larger time to market
Sensor− It measures the physical quantity and converts it to an electrical signal which can be read by an observer or by any electronic instrument like an A2D converter. • A-D Converter − An analog-to-digital converter converts the analog signal sent by the sensor into a digital signal. • Processor & ASICs (application-specific integrated circuit) − Processors process the data to measure the output and store it to the memory. • D-A Converter − A digital-to-analog converter converts the digital data fed by the processor to analog data • Actuator − An actuator compares the output given by the D-A Converter to the actual (expected) output stored in it and stores the approved output.
Processors in a System A processor has two essential units − • Program Flow Control Unit (CU) • The CU includes a fetch unit for fetching instructions from the memory. • Execution Unit (EU) • The EU has circuits that implement the instructions pertaining to data transfer operation and data conversion from one form to another. The EU includes the Arithmetic and Logical Unit (ALU) and also the circuits that execute instructions for a program control task such as interrupt, or jump to another set of instructions.
Types of Processors Processors can be of the following categories − • General Purpose Processor (GPP) • Microprocessor • Microcontroller • Embedded Processor • Digital Signal Processor • Media Processor • Application Specific System Processor (ASSP) • Application Specific Instruction Processors (ASIPs) • GPP core(s) or ASIP core(s) on either an Application Specific Integrated Circuit (ASIC) or a Very Large Scale Integration (VLSI) circuit.
Processors in a System • Microprocessor • A microprocessor is a single VLSI chip having a CPU, having RAM, ROM, I/O ports and Timer. • Microcontroller • A microcontroller is a single-chip VLSI unit (also called microcomputer) having limited but integrated computational capabilities, possesses enhanced input/output capability and a number of on-chip functional units.
Features of 8051 Microcontroller • 64K bytes on-chip program memory (ROM) • 128 bytes on-chip data memory (RAM) • Four register banks • 128 user defined software flags • 8-bit bidirectional data bus • 16-bit unidirectional address bus • 32 general purpose registers each of 8-bit • 16 bit Timers (usually 2, but may have more or less) • Three internal and two external Interrupts • Four 8-bit ports,(short model have two 8-bit ports) • 16-bit program counter and data pointer • 8051 may also have a number of special features such as UARTs, ADC, Op-amp, etc.
What is Embedded ‘C’ Whenever the conventional ‘C’ language and its extensions are used for programming embedded system, it is referred to as “Embedded C” programming .
Sample Embedded C program #include “16F877A.h” void main() { int x; x=input _A(); output_B(x); } Input from Port A Out data x to Port B
Sample Embedded C program #include “16F877A.h” void main() { int x; for(x=1;x<=10;x++) { output_B(x); delay_ms(100); } } Delay for 100 milliseconds
Interfacing Stepper Motor with 8051 • A Stepper Motor is a brushless, synchronous DC Motor. • There are two types of stepper motors Unipolar and Bipolar. • Motors can be easily interfaced with a microcontroller using driver ICs such as L293D or ULN2003.
Keil C Code for Full Drive #include<reg52.h> #include<stdio.h> void delay(int); void main() { do { P2 = 0x03; //0011 delay(1000); P2 = 0x06; //0110 delay(1000); P2 = 0x0C; //1100 delay(1000); P2 = 0x09; //1001 delay(1000); } while(1); } void delay(int k) { inti,j; for(i=0;i<k;i++) { for(j=0;j<100;j++) {} } }