Documente Academic
Documente Profesional
Documente Cultură
Supervised by
Ahmed Adel El-Emam Azam Amr Salah Rashed El-behedy Amr Mohamed Mohamed El-shamy Mohamed Elsaeid Elsaeid Eissa Mohamed Saad Taher Nada Mohamed Mohamed Aiad Omar Mohamed Belal Shaban
TO OUR NATION
Table of Contents
Preface: About GPS Technology Receiver Clock Error __________________________________________________ 1 Geometry to the rescue! _______________________________________________ 2 System Accuracy ____________________________________________________ 2 Differential GPS ______________________________________________________3 Single-Frequency Operation ____________________________________________ 3 Everyone on the dock will have one soon _________________________________4 Chapter 1:Team Building, Mission Zero and Project Selection _____________ 6 1.1. Team Buildin___________________________________________________ 6 1.2.Project Selection ________________________________________________ 6 Chapter 2:Abstract __________________________________________________ 9 2.1. Problem Definition _______________________________________________ 9 2.2. Problem Solution (project added-value) ______________________________9 2.3.Customers needs as interpreted from the market research _____________ 10 2.4.Business Objectives of the Project _________________________________ 11 2.5. Market and Competitons__________________________________________ 11 2.6. Breakdown Structure ____________________________________________ 12 Chapter 3:Market Research ___________________________________________15 3.1.Product Planning ________________________________________________ 15 3.2. Identifying Opportunities _________________________________________ 15
3.3.2. Market Segmenta on _________________________________________________ 16 3.3.3. Product Pla orm Planning ______________________________________________ 17 3.4.Allocate Pre-Project Resources and Time Planning____________________ 17 3.4.1.Resource Alloca on ___________________________________________________ 17 3.4.2.Time Planning ________________________________________________________ 18 3.5.Complete Pre-Project Planning_____________________________________ 18 3.5.1.Mission Statement ____________________________________________________ 18 3.6.Identifying Customer needs _______________________________________ 19 3.6.1.Organize the needs into a hierarchy _______________________________________ 19 3.7. Software and Hardware Tools ____________________________________ 20 3.7.1. Hardware Components ________________________________________________ 20 3.7.2.So ware components: _________________________________________________ 20 Chapter 4: Vision Scope and Project Plan ______________________________ 22 4.1 Solution Concept _______________________________________________ 22 4.1.1.Usage Analysis _______________________________________________________ 22 4.1.2. Usage Scenarios ______________________________________________________22 4.2.Scope _________________________________________________________ 24 4.2.1.Feature / Func on List _________________________________________________ 24 4.2.2.Out of Scope _________________________________________________________ 24 4.2.3.Acceptance Criteria ____________________________________________________ 25
4.2.4.Opera onal Criteria ___________________________________________________ 25 4.3.Schedule Planning ____________________________________________ 26 4.3.1.Schedule Summary ____________________________________________________ 26 4.3.2.Team Working Time table ______________________________________________ 26 4.4.Risk Identification/Statements____________________________________ 27 4.4.1.Risk Analysis _________________________________________________________ 28 4.4.2.Risk Plan ____________________________________________________________ 38 Chapter 5: Detailed Design of the Project _____________________________ 31 5.1.Software Requirements Specification (SRS) ________________________ 31 5.1.1.Overall Descrip on ____________________________________________________ 31 5.1.2.Product Perspec ve ___________________________________________________ 31 5.1.3.System Interfaces _____________________________________________________ 31 5.1.4.User Interfaces _______________________________________________________ 31 5.1.5.Hardware Interfaces ___________________________________________________ 32 5.1.6.So ware Interfaces ___________________________________________________ 32 5.1.7.Communica on Protocols ______________________________________________ 32 5.1.8.Assump ons and Dependencies __________________________________________ 32 5.1.9.Appor oning of Requirements ___________________________________________ 33 5.1.10.Specic Requirements ________________________________________________ 33 5.1.11.Func onal Requirements ______________________________________________ 33 5.1.12.Logical database Requirements _________________________________________ 34 5.1.13. Design Constraints ___________________________________________________ 35
5.1.14.Other Requirements __________________________________________________ 35 5.1.15.Priori za on of Requirements and Dependencies between them ______________ 35 5.2.System Requirements Specifications (SyRS) __________________________ 36 5.2.1.General System Descrip on _____________________________________________ 36 5.2.2.System context _______________________________________________________ 36 5.2.3.System modes and states _______________________________________________ 37 5.2.4.Major System capabili es _______________________________________________ 38 5.2.5.Major System Constraints ______________________________________________ 40 5.2.6.System Interfaces _____________________________________________________ 40 5.3.Software High Level Design Description ______________________________ 41 5.3.2.Typical Use Scenarios __________________________________________________ 41 5.3.3. Use Cases ___________________________________________________________ 43 5.4.Conceptual Design _______________________________________________ 46 5.4.1 Major System Components _____________________________________________ 46 Chapter 6: OCS navigation algorithm ___________________________________ 49 6.1 what is meaning of algorithm _______________________________________49 6.2 Dijkstra algorithm _________________________________________________49 6.2.1 Dijkstra Engine ________________________________________________________ 50 6.2.2 what it does __________________________________________________________ 50 6.2.3 how it work ___________________________________________________________ 50 6.2.4 Detailed example ______________________________________________________ 50 6.3: OCS navigation algorithm _________________________________________ 57 Chapter 7: Hardware Platform _________________________________________ 60
7.1.Introduction _____________________________________________________ 60 7.2.Requirements ____________________________________________________ 60 7.3.Solution _________________________________________________________60 7.4.Architecture _____________________________________________________ 61 7.4.1.CPU ________________________________________________________________ 62 7.4.2.GPS Receiver _________________________________________________________ 66 7.4.2.1.SiRF chipset ________________________________________________ 66 7.4.2.2.NMEA standard _____________________________________________ 67 7.4.3.Interfaces ___________________________________________________________ 69 7.4.4.Power Supply ________________________________________________________ 69 7.5. Prototype ______________________________________________________ 74 7.5.1. Selec on criteria: ___________________________________________________ 74 7.5.2. Selected Evalua on Kit for Prototyping __________________________________ 76 7.5.3. Selected GPS Receiver for Prototyping __________________________________ 79
Chapter 8: Operating System Porting __________________________________ 83 8.1. Introduction ___________________________________________________ 83 8.2.Android _______________________________________________________ 85 8.3. Android features _______________________________________________ 86 8.4. Android Architecture ___________________________________________ 89 8.5. initializing a build Environment ___________________________________ 96 8.6. Getting Linux Kernel Source Code ________________________________ 97 8.7. Configuring and Building Linux Kernel ____________________________ 98
8.8. Getting Android Source Code ____________________________________ 100 8.9. Android Build System __________________________________________ 101 8.10. Building the Android File System ________________________________ 106 8.11. U-Boot image generation _______________________________________ 108 8.12.X-loader image generation_______________________________________ 108 8.14 android system demonstration ___________________________________109 Chapter 9 : Online Cars System________________________________________114 PART A :Android programming________________________________________114 9.A.1.Android Develop tools___________________________________________114 9.A.2 Essential Command line tools ____________________________________115 9.A.3 other third-party development tools_______________________________117 9.A.4 Managing projects______________________________________________121 9.A.5 Library projects________________________________________________124 9.A.6 Development tools considerations ________________________________126 9.A.7 test projects___________________________________________________128 9.A.8 testing a library project__________________________________________129 9.A.9 building and running ___________________________________________130 9.A.10 detailed look at build project____________________________________131 9.A.11 Debugging___________________________________________________133 9.A.12 Google Maps_________________________________________________135 9.A.13 parsing the xml response ______________________________________145 PART B :Server Programming ________________________________________148 9.B.1-collecting feedback from the cars for each road _____________________148
9.B.2-Analyzing feedbacks and Sending the status for any road when requested from a car _______________________________________________________149 9.B.3-Selecting the best route between a source & destination and sending it when requested from a car _________________________________________149 Chapter 10: Documentation _________________________________________ 154 10.1. Reporting system _____________________________________________ 154 10.1.1. Project proposal __________________________________________________ 154 10.1.2 MOMs ___________________________________________________________ 155 Appendix A: Sample Documents ______________________________________ 157 A.1. Online forms used in information gathering _________________________ 157 A.2. Survey used in organizing needs into a hierarchy ____________________ 158 A.3. An Example of a proposal ________________________________________ 162 Appendix B: Source Code____________________________________________ 157 About Team members _______________________________________________ 204 References _____________________________________________________ 207
Ten years ago, it would have been hard to believe that you could buy a device capable of using the most advanced satellite technology to provide your precise location anywhere on the globe, and even harder to believe that it would be smaller than a frozen waffle and cost less than a TV set. In just a few years, though, I suspect that these technological marvels will be just about everywhere, and even cheaper. There are terrific handheld units with basic course plo ers selling for under $500, and the prices keep going down.
Chapter 2:Abstract
2.1. Problem Definition
That one of the most serious problems that we face every day is the problem of traffic congestion , Daily individuals need to move from region to region and from city to city, everyone wants to go to work and children to school, and this is often at the same time each day, leading to traffic congestion. Traffic congestion has many risks, which have a negative impact on the individual and on society. Traffic congestion affects the health of the individual because of car exhaust, and it does not affect the drivers only, but affects the residential areas around the busy roads .And thus affect the overall health of the community and the average age of the society individuals . Another serious problem, a waste of time as a result of standing for hours in crowded roads, and thus be late every day about the performance of the work required and be late for access to work schedules .Which also adversely affects the society in general. Also wasting huge amounts of fuel while standing in the crowded roads, costing the country a lot of money wasted without benefit .after solve this problem we can save these funds and use them in the form of services help the individual and society and affect it positively 2.2. Problem Solution (project added-value)
we intended to develop a system which help to solve the traffic problems . we use two main factors in our project . 1- GPS technology 2- users Feedback about the roads GPS:
The Opportunity Statement describes the customers current situation that creates the need for the project. It may contain a statement of the customers opportunity and the impact of capitalizing on that opportunity (product innovation, revenue enhancement, cost avoidance, operational streamlining, and leveraging knowledge). It may contain a statement of the customers problem and the impact of solving the problem (revenue protection, cost reduction, regulatory compliance, alignment of strategy and technology).
- A GPS device that performs basic GPS functions. - An application (not specified) that makes use of GPS and performs some action (mostly in control field). - Real time application that provide instantaneous and dynamic updates .
3.3.2.Target Market
-we designed our platform to be fit to car drivers needs (regular car owners or professional drivers). -Government (ambulances, police patrols, etc).
3.4.2.Time Planning
- Timing of product introductions: The prototype of the project is expected to be completed upon the graduation project presenta on in July 2013 . - Technology readiness: o The technology of GPS has been introduced to the world markets in the 1980s and proved to be reliable. o Android as the operating system is a reliable efficient open source operating system and has been deployed to a number of embedded systems such as smart phones.
3.5.2.Mission Statement
Product Description Key Business Goals Primary market Make Egyptian device can solve traffic problems and low cost . - Introduce the made in Egypt GPS device which everyone need to use it - Egyptian market. - Drivers . - First introduction - July 2013.
Stakeholders
1 1 1 1 1
3.7.2.Software components:
Components description Components name Number of required items Company Price
1 1 1
Scenario 2 Using OCS Accessories : 1. Ahmed want to play a song or a video. 2. Ahmed select mp3 player and select his song or video . Scenario 3 -Weather checking: 1. Ahmed clicks a bu on on the Main Screen to get Current City. 2. Device connects via Internet to a dedicated server. 3. Device gets the weather, and shows on GUI.
Scenario 2 using CAN bus : CAN bus (for controller area network) is a vehicle bus standard designed to allow microcontrollers and devices to communicate with each other within a vehicle without a host computer. CAN bus is a message-based protocol, designed specifically for automotive applications but now also used in other areas such as aerospace, industrial automation and medical equipment. 1. Ahmed want to send his feedback 2. Automatically OCS used CAN bus to send feedback to the server based on cars speed.
4.2.Scope
The Scope places a boundary around the solution by detailing the range of features and functions, by defining what is out of scope, and by discussing the criteria by which the solution will be accepted by users and operations. The Scope clearly delineates what stakeholders expect the solution to do, thus making it a basis for defining project scope and for performing many types of project and operations planning.
4.2.2.Out of Scope
- The Out of Scope section lists and defines a limited set of features and functions
4.2.3.Acceptance Criteria
Acceptance Criteria define the metrics that must be met in order for the customer to understand that the solution meets the requirements. Acceptance Criteria communicates the terms and conditions under which the customer will accept the solution to the project team. - Availability on time of competition for the prototype. - Accurate working of all functions. - Elegancy, smartness and handheld shape. - Ease of operating. - Re-chargeability by more than one method (electrical ports, car batteries). - Reliability. - Reduced development cost. - Ease of use.
4.2.4.Operational Criteria
Operational Criteria define the conditions and circumstances by which the customers operations team judges the solution readiness to deploy into the production environment. Once deployed, the customer takes ownership of the solution. Operational Criteria communicate to the project team the terms and conditions under which the customer will allow deployment and ultimately sign off on the project. This information provides a framework for planning the solutions deployment. - Available budget. - Required function of the device (many combinations can be made due to the modularity).
4.3.Schedule Planning
The Project Scope section defines the tasks, deliverables, resources, and schedule necessary to deliver the customers solution. The tasks are expressed in the Master Project Approach, the Milestone Approach, the Project Estimates, and the Project Schedule. These multiple views allow the customer and project team to look at the project from different perspectives and to analyze how the work is organized. The tasks, deliverables, resources, and schedule exist at a high level of detail. These Project Scope statements provide the context for more detailed planning during follow-on project phases.
4.3.1.Schedule Summary
The Schedule Summary section identifies and compiles the collective work tasks and their calendar dates into a complete project schedule that identifies its beginning and end dates. Each major Project Milestone is identified and assigned a targeted completion date. The schedule is a consolidated schedule it includes the work and dates of all project teams. The scheduling process is iterative. During the envisioning phase, the projects Major Milestones anchor the schedule. During the planning phase, the schedule will become more granular as the work tasks are broken down. The Schedule provides the basis for the customer and/or the sponsor to verify timelines and for the project team to produce a constrained master plan from which it can validate proposed budgets, resources, and timescales.
4.3.2.Team Working Time table This section illustrates the number of hours that our team practically worked on the project from the beginning till the finals. 3 hours/day
4.4.Risk Identification/Statements
The Risk and Issue Assessment section identifies and quantifies all the risks and issues that have become apparent through the envisioning phase. This section should be developed early in the phase and be updated as more information is gathered. At the close of the envisioning phase, this section should contain all risks and issues that exist at that point in time. The section includes the following: Risk Identification/Statements: a list of project risks and the conditions and consequences of each of the risks. Risk Analysis: the objective assessment of any risks significance; the calculation of risk exposure by assessing probability and impact for each item on the list of risks. Risk Plan: the actions that will prevent and minimize risks and provide a course of action if risks occur. Risk Priorities: the top x risks the project should focus on Risk identification Legality issues with GPS and tracking applications Consequence(s) The project can be banned from the market. Required components cant be Imported - No financial support for the team. - No technical support for the team. More time required for studying in the field of embedded systems. - Selection of the required components will take long time
There might be some difficulties in sponsorship deals. some technical difficulties related to working with embedded systems
4.4.1.Risk Analysis
Each risk statement/identification will take a number from one to 5 where one is the least risky and 5 is the most. Risk identification Legality issues with GPS and tracking applications. There might be some difficulties in sponsorship deals. Some technical difficulties related to working with Embedded Systems. Allowed time may not be sufficient Risk analysis and prioritization 4 1 3
4.4.2.Risk Plan
Risk identification Legality issues with GPS and tracking applications. There might be some difficulties in sponsorship deals. Risk analysis and prioritization - Guarantees of academic usage to the authorities. 1. Sucient informa on about the project must be provided in the proposals sent to the potential sponsors. 2. Contac ng organiza ons and companies who provide sponsorships to universities such as ITIDA. 3. Project supervisor and professors can
Some technical difficulties related to working with Embedded Systems. Allowed time may not be sufficient
5.1.2.Product Perspective
This subsection of the SRS puts the product into perspective with other related products and describes the context and origin of the system. - The modularity in our system will be an improvement to the existing GPS devices, which are usually un-customizable and targeted to specific applications. - Using open-source OS and applications to encourage the development and increase the space of customizability
5.1.3.System Interfaces
This lists each system interface and identifies the functionality of the software to accomplish the system requirement and the interface description to match the system. Our system will be variant depending on application needs, it may be - Touch screen friendly GUI. - Device push buttons. - Voice Recognition. - Narrator.
5.1.4.User Interfaces
There will be various interfaces depending on the application needs like: - Touch-screen-friendly GUI. - Device push buttons. - Voice recognition. - Narrator/Speakers.
5.1.6.Software Interfaces
- Google Android API v.7 - revision 1 - android.location - android.database.sqlite - android.voice - Open Street Map. - Google Weather APIs.
5.1.7.Communication Protocols
The platform will have the following communication protocols to fetch information, maps, and add-ons: - CDMA2000 via 3G module to get connected to the Internet. - NMEA 0182 via GPS module to get connected to GPS satellite.
5.1.9.Apportioning of Requirements
This subsection of the SRS identifies requirements that may be delayed until future versions of the system. These future requirements can be: - Communication with car computer CAN bus - Voice recognition
5.1.10.Specific Requirements
This section of the SRS contains all of the software requirements to a level of detail sufficient to enable designers to design a system that can satisfy those requirements, and testers to test that the system satisfies those requirements. Throughout this section, every stated requirement should be externally perceivable by users, operators, or other external systems. These requirements should include at minimum a description of every input (stimulus) into the system, every output (response) from the system, and all functions performed by the system in response to an input or in support of an output.
5.1.11.Functional Requirements
This section of the SRS contains all of the software requirements to a level of detail sufficient to enable designers to design a system to satisfy those requirements, and testers to test that the system satisfies those requirements. A functional requirement does not define the inner workings of the proposed system; it does not include the specification how the system function will be implemented. Instead, it focuses on what various outside agents (people using the program, computer peripherals, or other computers, for example) might "observe" when interacting with the system. - Downloadable on-demand data about the locations and services. - Downloadable on-demand data about the traffic.
5.1.14.Other Requirements
- Low price - Efficiency - Usability (driving friendly interface) - Interoperability - Extensibility - Performances
5.2.2.System context
Appropriate diagrams and narrative are included in this sub clause, to provide an overview of the context of the system, defining all significant interfaces crossing the systems boundaries plus the actors (users and/or external services) that interact with the proposed system (System interaction with the environment is also shown). The Device will interact with user with a Touch screen to ease the accessibility especially with the Maps navigation program. User may also interact through microphone so he/she can use while being busy for example while driving.
The main system software will allow extensibility with allowing other programs to be installed and run on the device, and then interact with the system to add more functionality to the system according to user needs. New hardware can be connected using USB to allow extensions to add even more functions to the device when used by extensions based upon this new Hardware. The full-fledged installment will contain networking capabilities: - GPS module to get connected to GPS satellite. - 3G : allows connec vity to the internet to send or receive feedback and consume very important services on the web; like finding important places around you like restaurants, parking areas, cinemas ...etc.
Functions: - Feedback updates - Position logging - Memory extensibility. - Basic location detection - Map navigation - Best device usage experience. - Services updates. - Weather and Traffic data. - Real time location tracking. - Storing offline maps.
5.2.7.System Interfaces
- USB connections: user can connect new hardware through using USB. - Internet or GSM: the device can access the internet with the provided 3G module. - User can add new data and port them on SD cards and plugging them into the device. - Mainly GPS module will be used to get location but if the user chosen a better accurate location can be calculated through GSM connection. - Most of our used protocols will be handled by Android, so it's out of our scope of interest. -serial port for purposes of debugging
2. Go to a restaurant?
3. His only need is to see his current location to check the map around him.
<Use-case 2: Selecting a new destination> Name Description Actors Preconditions Actions Selecting a new destination. user selects a place to navigate to User Navigation application is running - User search/navigate map, till he finds his destination. - Mark the location, and selects navigate to.
<Use-case 3: Get short path driving instructions> Name Description Actors Preconditions Actions Postconditions Get short path driving instructions User gets the shortest path to his destination User User selects destination Device executes an algorithm and calculates the shortest path User get instruction on screen or from narrator
<Use-case 5: Adding a place bookmark> Name Description Actors Preconditions Actions Adding a place bookmark Select destination in the Navigation program to save for further access User Navigation extension is running - User Navigates to specific location - User Selects the Saving option - User types a name for this location The Location is saved into device memory
Postconditions
<Use-case 6: Activating sound recognition> Name Description Actors Preconditions Actions Postconditions Activating sound recognition Makes device listen for a voice command User Device is powered on User press a button on GUI or makes a gesture Desired command is run
<Use-case 7: Playing media> Name Description Playing media Play media, using existing car sound system
<Use-case 8: Check traffic> Name Description Actors Preconditions Actions Check traffic Checks traffic of a selected street User Navigation Application is running - User selects a location (saved or navigated to) - User select to Check traffic - Device connects via Internet to a dedicated server - OCS gets the traffic (feedback of users ), and shows on GUI
Check weather Checks weather of a selected city User - Navigation Application is running - Or Just Device is powered on - User Selects a City or use GPS to get your current city - click to get the weather - Device connects via Internet to a dedicated server - OCS gets the weather, and shows on GUI
Postconditions
6.2.1.DijkstraEngine: Dijkstra's algorithm is probably the best-known and thus most implemented shortest path algorithm. It is simple, easy to understand and implement, yet impressively efficient. By getting familiar with such a sharp tool, a developer can solve efficiently and elegantly problems that would be considered impossibly hard otherwise. 6.2.2.What It Does : Dijkstra's algorithm, when applied to a graph, quickly finds the shortest path from a chosen source to a given destination. In fact, the algorithm is so powerful that it finds all shortest paths from the source to all destinations! This is known as the single-source shortest paths problem. 6.2.3.How It Works : First let's start by defining the entities we use. The graph is made of vertices (or nodes, I'll use both words interchangeably), and edges which link vertices together. Edges are directed and have an associated distance, sometimes called the weight or the cost. The distance between the vertex u and the vertex v is noted [u, v] and is always positive.
Dijkstra's algorithm partitions vertices in two distinct sets, the set of unsettled vertices and the set of settled vertices. Initially all vertices are unsettled, and the algorithm ends once all vertices are in the settled set. A vertex is considered settled, and moved from the unsettled set to the settled set, once its shortest distance from the source has been found.
6.2.4.Detailed example :
The goal is to find a path of minimum total weight (cost) from s to t .
Initially we put all the vertices in the uncolored (black) set T and set up a possible cost function on the vertices. We set (s) = 0 which indicates that we have found a path from s to s of total weight 0 (the path with no edges). For any other vertex v we set (v) = since we havent even veri ied that an s v path exists. Lets add the -values to the picture.
The smallest -value is (s) = 0, we remove s from T, indicating that (s) = 0 represents the smallest possible total weight of a path from s to s :
We examine the edges that leave s. The edge sa gives us a path of cost 18 from s to a so we change on a to (a) = 18. Likewise, we change (c) from to the smaller value 15 :
The edge ca has weight 6, tells us we can get from s to a for a cost of (a) + (ca) = 15 + 6 = 21, which is more than 18. We leave (a) at 18. The edge cb has weight 14, tells us we can getfrom s to b for a cost of (c) + (cb) = 15 + 14 = 29, which is less than , so we change on b so that (b) = 29. The edge cd has weight 14, tellsus we can get from s to d for a cost of (d) + (cd) = 15 + 7 = 22, than so which is less , so we change on d that (d) = 22.
Recalculate (t)
Now starting at t, find edges vw where (v) + (vw) = (w) and mark them with an arrow from v to w : since 27 + 28 = 55
In this case, the cheapest path from s to t is unique, and has total cost 55
this simple example for Dijeksra algorithm demonstration explain in detail how DA works and all the concepts related to it .
step 1: client send his source and destination to the server step 2: the server identify nodes , which is the the main points between source and destination - these points stored in the database step 3 : the server calculate the cost to be used in Dijkstra algorithm by this equation
step 4 : run Dijektra algorithm as stated previously step 5 : send the best rout to the user to be used
7.2.Requirements
- Fast CPU - Suitable Memory RAM, NAND Flash - High performance - Small and light-weight - Provide long periods of operation and standby from a single battery charge - Cost-efficient - Scalability. - Ability of integration with other H.W - Provide various types of connectivity i.e. wire/wireless, Ethernet/Can bus, USB. GPS receiver. - Extension Ports or General Purpose I/O
7.3.Solution
The underlying silicon solution is essential to meet our system design requirements. The solution must provide specialized processing and dedicated engines to achieve the communications and multimedia tasks. To keep board size and manufacturing expense under control, the processor must offer (SoC) integration that includes multiple processing cores, ample memory and all necessary system peripherals. The manufacturing process and circuit design must enable the greatest performance-per-unit of power consumed during active operation and negligible leakage during standby periods.
7.4.Architecture
Our architectural design vision is to build modular system, which provides the modularity from applications side of view. The next block diagram will illustrate OCS H.W. components:
Figure (7-1): OCS Hardware Block Diagram. Our design is to separate the hardware into two categories: - OCS H.W. Core. - Extensions. Mainly for our project, we will focus on the main parts of OCS or what we called OCS H.W. core.
7.4.1.CPU
As a high-performance processor for enhanced digital media, DM37x/AM37xemploys TI 45nm advanced industrial technology; this architecture has the advantage of low power consumption at the same time of being designed for ARM and graphical demonstration. The Texas Instruments DM3730 DaVinci digital media processor is powered by up to 1-GHz (also supports 300, 600, and 800-MHz operation) ARM CortexA8 and 800-MHz (also supports 250, 520 and 660-MHz operation) C64x+ DSP core, and has integrated 3D graphics processor, imaging and video accelerator (IVA), USB 2.0, MMC/SD memory card, UART and many more. DaVinci DM3730 video processor is pin-to-pin compatible with Sitara AM37x devices and software compatible with the OMAP35x processors. The C64x+ DSP and hardware video accelerator enable audio and HD 720p video decoding and encoding independent of the ARM processor. The programmable DSP engine allows multiple signal processing tasks such as image processing and analysis, digital filtering, and math functions. DaVinci DM3730 video processor is suitable for 720p HD (High De inition) video applications which require large amount of data processing.
Reset The functionof reset is decided by the SYS_NRESPWRON signal on the CPU, Reset is enabled when LOW levelsignal (high to low) is given. General-Purpose Interface The general-purpose interface combines six general-purpose input/output (GPIO) banks. Each GPIO bank provides 32 dedicated general-purpose pins with input and output capabilities; thus, it supports up to 192 (6 x 32) general-purpose interface pins. These pins can be configured for the following applications: Data input (capture)/output (drive) Keyboard interface with a debounce cell Interrupt generation in active mode when external events are detected. Display Subsystem The display subsystem provides the logic to display a video frame from the memory frame buffer (either SDRAM or SRAM) on a liquid-crystal display (LCD) panel or a TV set. The display subsystem integrates the following elements: Display controller (DISPC) module Remote frame buffer interface (RFBI) module Display serial interface (DSI) complex I/O module and a DSI protocol engine DSI PLL controller that drives a DSI PLL and high-speed (HS) divider. NTSC/PAL video encoder
Figure 7-2 The SGX graphics accelerator can simultaneously process various multimedia data types: Pixel data Vertex data Video data General-purpose processing This is achieved through a multithreaded architecture using two levels of scheduling and data partitioning enabling zero-overhead task switching.
7.4.2.1.SiRF chipset
SiRFstarII makes it easy and economical to add high-performance SiRFstarII technology to systems that are based on many popular processors and operating systems. The SiRF starII solution allows GPS function to be added at minimal cost in components and circuit board area, by sharing the host system's processor and memory resources. The chipset acquires and tracks satellites, then sends raw measurements to the host processor running the SiRFNav software in parallel with the host applications. <<The SiRFNav software module computes position time and velocity. For enhanced accuracy and navigation reliability, WAAS corrections can be applied or GPS measurements can be combined with dead reckoning data and processed by SiRFDRive software.>>
Figure (7-3): SiRF Chipset Block Diagram The chipset consists of the GSP2t highly integrated digital chip, GRF2i integrated RF receiver. The SiRFstarII is designed to be embedded into large volume applications that use multi-thread processors and real time operating systems. The SiRFstarII hardware can be added to the host Motherboard is within an area as small as two square centimeters, and with minimal increment in bill of material. The accurate positioning and built in dead reckoning support provide optimum performance for automotive navigation and entertainment systems. Small size and low cost also make the SiRFstarII the solution for portable devices such as hand-held navigators and Personal Digital Assistants where space and cost are critical. One part that all GPS receivers have in common is the antenna, whose jobs to receive the signal from the satellites and pass that signal on for processing. The signal the antenna picks up is a UHF signal with a frequency of 1575.2MHz (this is the civilian, unencrypted frequency; the military sign uses 1227.6 MHz).This frequency offers all-weather navigation capability but is blocked by walls, ceilings and even trees.
7.4.2.2.NMEA standard
The National Marine Electronics Association (NMEA) developed a standard over 20 years ago that defnes the interface between various pieces of marine electronic equipment and navigational computers, allowing them to talk together and share vital information.
7.4.3.Interfaces This point is the most vital point in the OCS which can provide the sense of modularity and the ability of connecting multiple hardware extensions. The serial interfaces is the most appropriate solution for this issue also considered the mandatory interfaces for OCS - HDQ - I2C - SmartReflex - McBSP LP - McSPI S - McSPI - UARTs - USB OCS also provide some peripherals as: Video Interfaces TV - Video Interfaces DSS Signals - Video Interfaces RFBI Audio Interfaces Test interfaces - JTAG - SDTI "Serial data out (System Trace)" - HWDBG "Hardware Debug Signal" Removable Media Interfaces - MMC/SDIO MULTIMEDIA MEMORY CARD/SECURE DIGITAL IO
7.4.4.Power Supply
400 mA
270 mA 4 mA 17 mA 80 mA 60 mA 1 mA 20 m
7.5. Prototype
It is mandatory to have a development hardware kit to make a reality development on your platform neither then emulation and simulation. In other words it will add the practical sense. For our system we put this criteis when we think about the development kit. It is the answer for the question which is meet our needs.
Texas Instrument
DM3730
Memory
Audio/Vide o Interfaces
TSC2046
Serial port
MAX3218
USB port
ISP1504
NXP Semiconductor s
SD/MMC port
Etherne
DM9000A
McSPI
McBSP interface
SN74LVC2G07
Texas Instrument
DVI
tfp410
Texas Instruments
1. X-Loader: is the first level bootstrap program. After the system start-up, the ROM inside the CPU will copy the x-loader to internal RAM and perform work. Its main function is to initialize the CPU, copy the u-boot into the memory and give the control power to u-boot. 2. U-Boot: (Universal-Bootloader) is the second bootstrap program for a number of different architectures. Though there are quite a few other boot-loaders, U-Boot is arguably the richest, most flexible, and most actively developed open source bootloader. U-Boot is used for interacting with users and updating images and leading the kernel.
3. Kernel: Linux kernel 2.6.32 employed and customized based on Devkit8500. Android needs the Linux kernel to interact and handle the variant hardware devices. Linux Kernel is an Open Source Project started by Linus Torvalds in 1991 and released under GNU/GPLv2 license.
4. Roo s: (Root File System) is Android Root File System customized based on Devkit8500 too. We discuss the kernel and rootfs in the following sections. * As platform developers we will mainly focus in this chapter on:
8.2:Android :
Android is described as a mobile operating system, initially developed by Android Inc. Android was sold to Google in 2005. Android is based on a modied Linux 2.6 kernel. Google, as well as other members of the Open Handset Alliance (OHA) collaborated on Android (design, development, distribution). Currently, the Android Open Source Project (AOSP) is governing the Android maintenance and development cycle . To reiterate, the Android opera ng system is based on a modied Linux 2.6 kernel . Compared to a Linux 2.6 environment though, several drivers and libraries have been either modified or newly developed to allow Android to run as efficiently and as effectively as possible on mobile devices (such as smart phones or internet tablets). Some of these libraries have their roots in open source projects. Due to some licensing issues, the Android community decided to implement their own c library (Bionic), and to develop an Android specific Java runtime engine (Dalvik Virtual Machine DVM). With Android, the focus has always been on optimizing the infrastructure based on the limited resources available on mobile devices . To complement the operating environment, an Android specific application framework was designed and implemented. Therefore, Android can best be described as a complete solution stack, incorporating the OS, middlewear components, and
Web browser The web browser available in Android is based on the open-source WebKit layout engine, coupled with Chrome's V8 JavaScript engine. The browser scores 100/100 on the Acid3 test on Android 4.0. Java support While most Android applications are written in Java, there is no Java Virtual Machine in the platform and Java byte code is not executed. Java classes are compiled into Dalvik executables and run on Dalvik, a specialized virtual machine designed specifically for Android and optimized for battery-powered mobile devices with limited memory and CPU. J2ME support can be provided via thirdparty applications. Media support Android supports the following audio/video/s ll media formats: WebM, H.263, H.264, AAC, HE-AAC (in 3GP or MP4 container), MPEG-4 SP, AMR, AMR-WB (in 3GP container), MP3, MIDI, Ogg Vorbis, FLAC, WAV, JPEG, PNG, GIF, BMP, WebP. Streaming media support RTP/RTSP streaming (3GPP PSS, ISMA), HTML progressive download (HTML5 <video> tag). Adobe Flash Streaming (RTMP) and HTTP Dynamic Streaming are supported by the Flash plug-in. Apple HTTP Live Streaming is supported by RealPlayer for Android ,and by the opera ng system in Android 3.0 (Honeycomb). Additional hardware support Android can use video/still cameras, touchscreens, GPS, accelerometers, gyroscopes, barometers, magnetometers, dedicated gaming controls, proximity and pressure sensors, thermometers, accelerated 2D bit blits (with hardware orienta on, scaling, pixel format conversion) and accelerated 3D graphics. Multi-touch
Figure 1: Android Architecture Note: Figure 1 courtesy of the OHA The application framework houses the API interface. In this layer, the activity manager governs the application life cycle. The content providers enable applications to either access data from other applications or to share their own data. The resource manager provides access to non-code resources (such as graphics), while the notification manager enables applications to display custom alerts. On top of the application framework are the built-in, as well as the user applications, respectively. It has to be pointed out that a user application can replace a built-in application, and that each Android application runs in its own process space, within its own DVM instance. Most of these major Android components are further discussed (in more detail) in the next few sections of this report.
alarm driver (provides timers to wakeup devices) shared memory driver (ashmem) binder (for inter-process communication), power management (which takes a more aggressive approach than the Linux PM solution) low memory killer kernel debugger and logger
6. Power Management
In the mobile device arena, power management is obviously paramount. That does not imply though that power management should be neglected on any other system. Hence, power management in any IT system, with any operating system, is considered a necessity due to the ever increasing power demand of todays computer systems. To illustrate, to reduce and manage power consumption, Linux based systems provide power-saving features such as clock gating, voltage scaling, activating sleep modes, or disabling memory cache. Each of these features reduces the system's power consumption (normally at the expense of an increased latency behavior) . Most Linux based systems manage power consumption via the Advanced Configuration and Power Interface (ACPI). Android based systems provide their own power management infrastructure (labeled Power Manager) that was designed based on the premise that a processor should not consume any power if no applications or services actually require power. Android demands that applications and services request CPU resources via wake locks through the Android application
Now you will have the Linux kernel source code in kernel folder. The same instructions apply if you want to download the Linux Kernel from another source. Just replace the <git-repository> in the second command with the git repository of the Linux Kernel and the <branch-name> with the branch you want to check as follows:
$ cd .. $ git clone <git-repository>
If an error occurs in the system when make menuconfig is input, it is necessary to install ncurse in the Ubuntu system; ncurse library is a character graphic library, used for make menuconfig of kernel; the specific installation instruction is:
$ sudo apt-get install ncurses-dev
Enter the kernel customize menu now, enter PANEL_TYPE according to the following pointing paths:
After determining PANEL_TYPE, jump to parent directory, select Exit to exit, until the following picture appears, then select Yes:
After configuring the kernel you may build it using the following commands:
$ make ARCH=arm CROSS_COMPILE=<tool-chain-path>/bin/arm-android-eabi- uImage $ make ARCH=arm CROSS_COMPILE=<tool-chain-path>/bin/arm-android-eabi- modules
The <tool-chain-path> in the previous commands have to be replaced with the path of the toolchain The toolchain contains a cross compiler, a linker to
Of course, you will replace the <branch> in the command with the name of the branch you want to check out, which is FROYO in our project.
If you don't have version 3.80 or greater, you will need to upgrade your version of make
3. Files: Determine which les your applica on depends upon (LOCAL_SRC_FILES := main.c). 4. Tags: Define tags, as necessary (LOCAL_MODULE_TAGS := eng development). 5. Libraries: Dene whether your applica on links with other libraries
2. Create a products directory beneath the company directory you created in step 1.
$ mkdir device/partner/<company_name>/products/
3. Create a product-specific make file, called device/partner/<company_name>/products/<first_produ ct_name>.mk, that includes the following code:
$(call inherit-product, target/product/generic.mk) # # Overrides PRODUCT_NAME := <first_product_name> PRODUCT_DEVICE := <board_name>
5. Create a board-specific directory beneath your company directory that matches the PRODUCT_DEVICE variable <board_name> referenced in the product-specific make file above. This will include a make file that gets accessed by any product using this board.
$ mkdir device/partner/<company_name>/<board_name>
6. Create a product_config.mk file in the directory created in the previous step(device/partner/<company_name>/<board_name>).If this directory does not include a product_config.mk file, the build will fail. # These definitions override the defaultsin config/config.make for <board_name>
# # TARGET_NO_BOOTLOADER := false # TARGET_HARDWARE_3D := false # TARGET_USE_GENERIC_AUDIO := true
7. If you wish to modify system properties, create asystem.prop file in your <board_name> directory(device/partner/<company_name>/<board_name>).
# system.prop for # This overrides settings in the products/generic/system.prop file # # rild.libpath=/system/lib/libreference-ril.so
within
must
# make file for new hardware from # LOCAL_PATH := $(call my-dir) # # this is here to use the pre-built kernel ifeq ($(TARGET_PREBUILT_KERNEL),) TARGET_PREBUILT_KERNEL := $(LOCAL_PATH)/kernel endif # file := $(INSTALLED_KERNEL_TARGET) ALL_PREBUILT += $(file) $(file): $(TARGET_PREBUILT_KERNEL) | $(ACP) $(transform-prebuilt-to-target) # # no boot loader, so we don't need any of that stuff.. # LOCAL_PATH := partner/<company_name>/<board_name> # include $(CLEAR_VARS) # # include more board specific stuff here? Such as Audio parameters. #
10. To create a second product for the same board, create a second product-specific make file called device/partner/company_name/products/<second_product_name>.m k that includes:
$(call inherit-product, partner/google/products/generic.mk) # # Overrides PRODUCT_NAME := <second_product_name> PRODUCT_DEVICE := <board_name>
By now, you should have two new products, called <first_product_name> and <second_product_name> associated with <company_name>. To verify that a
You should find new build device/out/target/product/<board_name>. New Product File Tree
binaries
located
in
The file tree below illustrates what your own system should look like after completing the steps above.
The commands simply overwrite the file buildspec.mk and write the following settings in it:
TARGET_PRODUCT := devkit8500
Finally, as expected you will build the source code using the command
$ make
It will take a while to get the source code compiled. If you have a multi-core processor, you may use the command as
$ make -jN
where N is twice the number of cores you have. That will let you compile the source code faster. You may use this option while building the Linux Kernel too. After the building process finish successfully, the generated root file system could be found here: out/target/product/devkit8500/root/ out/target/product/devkit8500/system/ Also, a UBI file system image -for NAND flash- could be found in the following directory: out/target/product/devkit8500/system.img We will discuss later how to flash the UBIFS image to the NAND flash of our development kit Devkit8500
OR
You can simply execute the following :
cd $HOME/work sudo $HOME/tools/mkfs.ubifs -r rootfs -m 2048 -e 129024 -c 1996 -o ubifs.img sudo $HOME/tools/ubinize -o ubi.img -m 2048 -p 128KiB -s 512
$HOME/tools/ubinize.cfg
When the above steps are finished, the current directory will generate the file uboot.bin which we need.
When the above steps are finished, the current directory will generate the file MLO which we need.
When the above steps are finished, the current directory will generate the file x-load.bin.ift_for_NAND which we need.
Out: serial Err: serial DevKit8500 xM Rev A Die ID #3a7e00229e3800000168263d0402302f NAND erase: device 0 whole chip Erasing at 0x1e0000 -- 100% complete. OK mmc1 is available
Setup During this phase you install and set up your development environment. You also create Android Virtual Devices (AVDs) and connect hardware devices on which you can install your applications. During this phase you set up and develop your Android project, which contains all of the source code and resource files for your application. Debugging and Testing
A hardware profile: Defines the hardware features of the virtual device. For example, you can define whether the device has a camera, whether it uses a physical QWERTY keyboard or a dialing pad, how much memory it has, and so on. A mapping to a system image: You can define what version of the Android platform will run on the virtual device. You can choose a version of the standard Android platform or the system image packaged with an SDK addon. Other options: You can specify the emulator skin you want to use with the AVD, which lets you control the screen dimensions, appearance, and so on. You can also specify the emulated SD card to use with the AVD.
A dedicated storage area on your development machine: the device's user data (installed applications, settings, and so on) and emulated SD card are stored in this area. You can create as many AVDs as you need, based on the types of device you want to model. To thoroughly test your application, you should create an AVD for each general device configuration (for example, different screen sizes and platform versions) with which your application is compatible and test your application on each one. Keep these points in mind when you are selecting a system image target for your AVD:
The API Level of the target is important, because your application will not be able to run on a system image whose API Level is less than that required by your application, as specified in the minSdkVersion attribute of the application's manifest file. For more information about the relationship between system API Level and application minSdkVersion, see Specifying Minimum System API Version. You should create at least one AVD that uses a target whose API Level is greater than that required by your application, because it allows you to test the forward-compatibility of your application. Forward-compatibility testing ensures that, when users who have downloaded your application receive a system update, your application will continue to function normally. If your application declares a uses-library element in its manifest file, the application can only run on a system image in which that external library is present. If you want to run your application on an emulator, create an AVD that includes the required library. Usually, you must create such an AVD using an Add-on component for the AVD's platform (for example, the Google APIs Add-on contains the Google Maps library).
To learn how to manage AVDs using a graphical tool, read Managing AVDs with AVD Manager. To learn how to manage AVDs on the command line, read Managing AVDs from the Command Line.
9.A.4Managing Projects
Projects act as containers for storing things such as code and resource files. The SDK tools expect your projects to follow a specific structure so it can compile and package your application correctly, so it is highly recommended that you create them with Eclipse and ADT or with the android tool on the command line. There are three types of projects, and they all share the same general structure but differ in function: Android Projects An Android project is the container for your application's source code, resource files, and files such as the Ant build and Android Manifest file. An application project is the main type of project and the contents are eventually built into an .apk file that you install on a device. Test Projects These projects contain code to test your application projects and are built into applications that run on a device. Library Projects These projects contain shareable Android source code and resources that you can reference in Android projects. This is useful when you have common code that you want to reuse. Library projects cannot be installed onto a device, however, they are pulled into the .apk file at build time. When you use the Android development tools to create a new project, the essential files and folders will be created for you. There are only a handful of files and folders generated for you, and some of them depend on whether you use the Eclipse plugin or the android tool to generate your project. As your application grows in complexity, you might require new kinds of resources, directories, and files.
Android Projects
Android projects are the projects that eventually get built into an .apk file that you install onto a device. They contain things such as application source code and resource files. Some are generated for you by default, while others should be created if required. The following directories and files comprise an Android project: src/ Contains your stub Activity file, which is stored at src/your/package/namespace/ActivityName.java. All other source code files (such as .java or .aidl files) go here as well. bin/ Output directory of the build. This is where you can find the final .apk file and other compiled resources. jni/ Contains native code sources developed using the Android NDK. For more information, see the Android NDK documentation. gen/ Contains the Java files generated by ADT, such as your R.java file and interfaces created from AIDL files. assets/ This is empty. You can use it to store raw asset files. Files that you save here are compiled into an .apk file as-is, and the original filename is preserved. You can navigate this directory in the same way as a typical file system using URIs and read files as a stream of bytes using the AssetManager. For example, this is a good location for textures and game data. res/ Contains application resources, such as drawable files, layout files, and string values. See Application Resources for more information.
9.A.5.Library Projects
If you are developing multiple related applications that use some of the same components, you move the redundant components out of their respective application projects and create a single, reuseable set of the same components in a library project. If you are creating an application that exists in both free and paid versions. You move the part of the application that is common to both versions into a library project. The two dependent projects, with their different package names, will reference the library project and provide only the difference between the two application versions. Structurally, a library project is similar to a standard Android application project. For example, it includes a manifest file at the project root, as well as src/, res/ and similar directories. The project can contain the same types of source code and resources as a standard Android project, stored in the same way. For example, source code in the library project can access its own resources through its R class.
However, a library project differs from a standard Android application project in that you cannot compile it directly to its own .apk and run it on an Android device. Similarly, you cannot export the library project to a self-contained JAR file, as you would do for a true library. Instead, you must compile the library indirectly, by referencing the library in the dependent application and building that application.
When you build an application that depends on a library project, the SDK tools compile the library into a temporary JAR file and uses it in the main project, then uses the result to generate the .apk. In cases where a resource ID is defined in both the application and the library, the tools ensure that the resource declared in the application gets priority and that the resource in the library project is not compiled into the application .apk. This gives your application the flexibility to either use or redefine any resource behaviors or values that are defined in any library. To organize your code further, your application can add references to multiple library projects, then specify the relative priority of the resources in each library. This lets you build up the resources actually used in your application in a cumulative manner. When two libraries referenced from an application define the same resource ID, the tools select the resource from the library with higher priority and discard the other. Once you have added references to library projects to your Android project, you can set their relative priority. At build time, the libraries are merged with the application one at a time, starting from the lowest priority to the highest. Library projects can reference other library projects and can import an external library (JAR) in the normal way.
9.A.6Development considerations
As you develop your library project and dependent applications, keep the points listed below in mind:
Resource conflicts Since the tools merge the resources of a library project with those of a dependent application project, a given resource ID might be defined in both projects. In this case, the tools select the resource from the application, or the library with highest priority, and discard the other resource. As you develop your applications, be aware that common resource IDs are likely to be defined in more than one project and will be merged, with the resource from the application or highest-priority library taking precedence.
Use prefixes to avoid resource conflicts To avoid resource conflicts for common resource IDs, consider using a prefix or other consistent naming scheme that is unique to the project (or is unique across all projects). You cannot export a library project to a JAR file A library cannot be distributed as a binary file (such as a JAR file). This will be added in a future version of the SDK Tools. A library project can include a JAR library You can develop a library project that itself includes a JAR library, however you need to manually edit the dependent application project's build path and add a path to the JAR file. A library project can depend on an external JAR library You can develop a library project that depends on an external library (for example, the Maps external library). In this case, the dependent application must build against a target that includes the external library (for example, the Google APIs Add-On). Note also that both the library project and the dependent application must declare the external library in their manifest files, in a <uses-library> element. Library projects cannot include raw assets The tools do not support the use of raw asset files (saved in the assets/ directory) in a library project. Any asset resources used by an application must be stored in the assets/ directory of the application project itself. However, resource files saved in the res/ directory are supported. Platform version must be lower than or equal to the Android project A library is compiled as part of the dependent application project, so the API used in the library project must be compatible with the version of the Android library used to compile the application project. In general, the library project should use an API level that is the same as or lower than that used by the application. If the library project uses an API level that is higher than that of the application, the application project will not compile. It is perfectly acceptable to have a library that uses the Android 1.5 API (API level 3) and that is used in an Android 1.6 (API level 4) or Android 2.1 (API level 7) project, for instance. No restriction on library package names There is no requirement for the package name of a library to be the same as that of applications that use it.
Each library project creates its own R class When you build the dependent application project, library projects are compiled and merged with the application project. Each library has its own R class, named according to the library's package name. The R class generated from main project and the library project is created in all the packages that are needed including the main project's package and the libraries' packages. Library project storage location There are no specific requirements on where you should store a library project, relative to a dependent application project, as long as the application project can reference the library project by a relative link. What is important is that the main project can reference the library project through a relative link.
9.A.7.Test Projects
Test projects contain Android applications that you write using the Testing and Instrumentation framework. The framework is an extension of the JUnit test framework and adds access to Android system objects. The file structure of a test project is the same as an Android project. src/ Includes your test source files. Test projects do not require an Activity .java file, but can include one. gen/ This contains the Java files generated by ADT, such as your R.java file and interfaces created from AIDL files. assets/ This is empty. You can use it to store raw asset files. res/ A folder for your application resources, such as drawable files, layout files, string values, etc. See Application Resources. AndroidManifest.xml
You can set up a test project that instruments an application project that depends on the library project. You can then add tests to the project for library-specific features.
You can set up a standard application project that depends on the library and put the instrumentation in that project. This lets you create a selfcontained project that contains both the tests/instrumentations and the code to test.
Figure 1 shows how the various debugging tools work together in a typical debugging environment.
Additional Debugging Tools In addition to the main debugging tools, the Android SDK provides additional tools to help you debug and profile your applications:
While debugging, keep these helpful tips in mind to help you figure out common problems with your applications: Dump the stack trace To obtain a stack dump from emulator, you can log in with adb shell, use ps to find the process you want, and thenkill -3. The stack trace appears in the log file. Display useful info on the emulator screen The device can display useful information such as CPU usage or highlights around redrawn areas. Turn these features on and off in the developer settings window as described in Debugging with the Dev Tools App. Get application and system state information from the emulator You can access dumpstate information from the adb shell commands. See dumpsys and dumpstate on the adb topic page. Get wireless connectivity information You can get information about wireless connectivity using DDMS. From the Device menu, select Dump radio state. Log trace data You can log method calls and other tracing data in an activity by calling startMethodTracing(). See Profiling with Traceview and dmtracedump for details. Log radio data By default, radio information is not logged to the system (it is a lot of data). However, you can enable radio logging using the following commands:
9.A.12.Google Maps
Maps View It is responsible for viewing the map, move controllers and zoom controllers. It also has an option for displaying bookmarks at their locations on the currently viewed map. Classes related to the Map View There is one class Map View. Google provides via Google play a library for using Google Maps in your application. The following description is based on the Google Maps Android API v1 which provides signi icant improvements to the older API version.
We have provided latitude = 30 and longitude = 71, zooming level =7. The map will center at the provided coordinates at the provided zooming level. I may have forgotten to explain some details so i am attaching the complete code the 3 main iles for this project.
9.A.12.1Location Services
Android gives your applications access to the location services supported by the device through classes in theandroid.location package. The central component of the location framework is the LocationManagersystem service, which provides APIs to determine location and bearing of the underlying device (if available). As with other system services, you do not instantiate a LocationManager directly. Rather, you request an instance from the system by calling getSystemService(Context.LOCATION_SERVICE). The method returns a handle to a new LocationManager instance. Once your application has a LocationManager, your application is able to do three things:
Query for the list of all LocationProviders for the last known user location. Register/unregister for periodic updates of the user's current location from a location provider (specified either by criteria or name). Register/unregister for a given Intent to be fired if the device comes within a given proximity (specified by radius in meters) of a given lat/long.
Flow for obtaining user location Here's the typical flow of procedures for obtaining the user location: 1. Start application. 2. Sometime later, start listening for updates from desired location providers. 3. Maintain a "current best estimate" of location by filtering out new, but less accurate fixes. 4. Stop listening for location updates. 5. Take advantage of the last best location estimate.
A timeline representing the window in which an application listens for location updates.
This model of a windowduring which location updates are received frames many of the decisions you need to make when adding location-based services to your application.
You might want to start listening for location updates as soon as your application starts, or only after users activate a certain feature. Be aware that long windows of listening for location fixes can consume a lot of battery power, but short periods might not allow for sufficient accuracy. As demonstrated above, you can begin listening for updates by calling requestLocationUpdates(): String locationProvider = LocationManager.NETWORK_PROVIDER; // Or, use GPS location data: // String locationProvider = LocationManager.GPS_PROVIDER; locationManager.requestLocationUpdates(locationProvider, 0, 0, locationListener);
Using the "geo" command in the emulator console To send mock location data from the command line: 1. Launch your application in the Android emulator and open a terminal/console in your SDK's /toolsdirectory. 2. Connect to the emulator console: telnet localhost <console-port> 3. Send the location data: o geo fix to send a fixed geo-location. This command accepts a longitude and latitude in decimal degrees, and an optional altitude in meters. For example: geo fix -121.45356 46.51119 4392
o
geo nmea to send an NMEA 0183 sentence. This command accepts a single NMEA sentence of type '$GPGGA' (fix data) or '$GPRMC' (transit data). For example: geo nmea $GPRMC,081836,A,3751.65,S,14507.36,E,000.0,360.0,130998,011.3,E*62
For information about how to connect to the emulator console, see Using the Emulator Console.
OS SPECIFIC ROOT: ~/.titanium or /opt/titanium OS CODE: linux Windows - XP >Note: You can always search your drive using dir /s/b titanium from the root of your C drive.
OS SPECIFIC ROOT: C:ProgramDataTitanium OS CODE: win32 SDK VERSION is usually a string like 0.8.0. The Keystore Password The password for the development key is android The Key Alias The alias for the development key is android; Obtaining the Key <pre>keytool -list -keystore PATH_TO/dev_keystore -alias tidev storepasstirocks</pre> Keytool will output a few lines. The important one is: <pre> Certi icate ingerprint (MD5): <b>66:5E:D1:7F:C4:2C:B9:73:AD:7F:4D:DD:29:12:56:56</b></pre>
Google's form wants the information shown in bold, (i.e. just the fingerprint).
Obtaining a Key From Google Once you have the MD5 ingerprint, log in with your Google(Gmail) account and visit the Maps API Key Signup form.
Paste in your fingerprint and agree to the terms then press Generate API Key. You should see a result similar to the image below.
Verify your AVD Target Google Maps are an add-on and are not part of the open source platform. Most Android devices have shipped with some proprietary Google applications like Maps. However, there are no requirements that a device manufacturer ship a Google Phone. If you do want to run on a non-Google device or emulator system image, you will need to have a different version of your app that doesn't require maps. >Note: The current, 0.8.0, Android mobilesdk ships with embedded Map support. You will need a Google capable device and AVD until we complete the modularization of the SDK. >Note: If you're still on the old Android SDK 1.5 or 1.6 instead of the SDK Kit, you should move up to the new tooling. Future documentation will feature the tools. Specifically the android GUI. Open a command window or terminal and run the following command android list avd The result is a list of all of your AVDs. Titanium Developer uses the AVD named titanium. Look for it in the list.
Create a document or spreadsheet where you maintain a list of applications, their certi icate hash (MD5) with the corresponding API key. If you decided not to, Google will return you the same API key for the same certificate hash. The MD5 ingerprint of the debug key is the same, you can just copy the following MD5 ingerprint and use it on the form. The resulting API Key can be used during development for all of your projects. <pre> Certi icate ingerprint (MD5): <b>66:5E:D1:7F:C4:2C:B9:73:AD:7F:4D:DD:29:12:56:56</b></pre>
9.B.2-Analyzing feedbacks and Sending the status for any road when requested from a car:
When a user requests the status of a road,we calculate the average status for all feedbacks stored for this road.In addition to that we calculate the standard deviation for these feedback values and hence we can decide either the average value is a right indication for the status of the road or not.This is performed by selecting a threshold value for the standard deviation,if the standard deviation is less than the threshold value, the average is accepted otherwise it will be refused.finally,we respond to the user with the average value which represents the status of the road.
9.B.3-Selecting the best route between a source & destination and sending it when requested from a car:
Address: Damietta Telephone: 010 xxxxxxx Type of user: traveler Question Are you suffering from traffic congestion ? Whats hurting you as a result of this ?
After illustrating our solution , do you think our device will help you ? What is the average price you can pay per unit?
Faculty Of Engineering
Communication and Electronics Dep.
Online Cars
Presented By:
1-Mohamed Nada 2-Mohamed Eissa 3-Ahmed El-Emam 4-Amr salah 5-Mohamed Aiad 6-Omar belal 7-Amr El-shame Under Supervision of: Dr. Elsaed Marzouk
Introduction (Problem definition)
Nowadays, technology helps in solving the most complicated problems ever existed in the world helping people to communicate and collaborate. One of the useful technologies that can serve in many applications is the GPS technology. GPS devices can be used in vehicles, navigation, tracking, guiding people, military applications ... etc
GPS Module. o GPRS/GSM Module. o Android OS -Google OS for mobile platforms-. System interfaces, inputs and outputs: o o o o USB. 6.4 Touch Screen. Keypad. Voice Recognition.
Software/Hardware Development Tools Components Components Number of Description name required items Development Devkit8500D 1 kit GPS module GPS8000-S 1 3G module CDMA800-U 1 Touch screen N/A 1 SD card N/A 1 Components Components Number of Description name required items Operating Android 1 System SDK Android SDK 1 IDE Eclipse IDE 1 Company Embest Embest Embest Embest Embest Price US$329 US$59 US$79 Included Included
saxParserno.parse(urlConnection.getInputStream(), handlerno);
} catch (Exception e) { Toast t = Toast.makeText(getApplicationContext(),"Not Supported !!!", Toast.LENGTH_LONG); t.show(); overlist.clear(); overlist.add(movly); } } privatevoidParsingXml(String url, finalintnumint, finaldoubletimed,finaldoublet_distd, finalGeoPoint sP1, finalGeoPoint eP1) { HttpURLConnectionurlConnection = null; double slat = sP1.getLatitudeE6() / 1E6; doubleslng = sP1.getLongitudeE6() / 1E6; doubledlat = eP1.getLatitudeE6() / 1E6; doubledlng = eP1.getLongitudeE6() / 1E6; try { overlist.clear(); overlist.add(movly); String data = "src_lat=" + slng + "&src_lng=" + slat + "&dst_lat=" + dlng + "&dst_lng=" + dlat;
saxParser.parse(urlConnection.getInputStream(), handler); } catch (Exception e) { e.printStackTrace(); } } privateintgetTrafficColor(intspdint) { if (spdint<= 10) { returnColor.rgb(0, 0, 0); } elseif (spdint> 10 &&spdint<= 40) {
Main activity
package com.onlinecars.aiad;
importandroid.content.Intent; importandroid.location.Location; importandroid.location.LocationManager; importandroid.os.Bundle; importandroid.view.Menu; importandroid.view.View; importandroid.view.View.OnClickListener; importandroid.widget.Button; importandroid.widget.TextView; importcom.google.android.maps.GeoPoint; importcom.google.android.maps.MapActivity; importcom.google.android.maps.MapController; importcom.google.android.maps.MapView;
publicclassMainActivityextendsMapActivityimplementsOnCl ickListener { GeoPoint x; Button buttonfb; intuo ; MapControllercon ; privateLocationManagermyLocationManager; TextView text;
@Override protectedvoidonCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_main); MapView map =(MapView) findViewById(R.id.mapView); map.setBuiltInZoomControls(true); map.setClickable(true); map.getController().setZoom(12); MapController con =map.getController(); x = newGeoPoint((int) (31.25485869712114 * 1E6), (int) (31.65892816378453 * 1E6)); con.animateTo(x); //Button fbButton = (Button) findViewById(R.id.button1); //fbButton.setOnClickListener(this); }
@Override publicbooleanonCreateOptionsMenu(Menu menu) { // Inflate the menu; this adds items to the action bar if it is present. getMenuInflater().inflate(R.menu.main, menu); returntrue; } @Override protectedbooleanisRouteDisplayed() { // TODO Auto-generated method stub returnfalse; }
} publicvoid location(GeoPointmylocation){ Location initLocation=myLocationManager.getLastKnownLocation(Loc ationManager.GPS_PROVIDER); if(initLocation != null) { GeoPointinitGeoPoint = newGeoPoint( (int)(initLocation.getLatitude()*1000000), (int)(initLocation.getLongitude()*1000000)); } }
@Override publicvoidonCheckedChanged(RadioGroup arg0, int arg1) { // TODO Auto-generated method stub switch(arg1){ caseR.id.za7ma:
Android Mainfaist
<uses-permission android:name="android.permission.INTERNET" /> <usespermissionandroid:name="android.permission.ACCESS_COARS E_LOCATION"/> <usespermissionandroid:name="android.permission.ACCESS_FINE_ LOCATION"/> <application android:allowBackup="true" android:icon="@drawable/ic_launcher" android:label="@string/app_name" android:theme="@style/AppTheme" > <uses-library android:name="com.google.android.maps" /> <activity android:name="com.onlinecars.aiad.MainActivity" android:label="@string/app_name" > <intent-filter> <action android:name="android.intent.action.MAIN" /> <category android:name="android.intent.category.LAUNCHER" /> </intent-filter> </activity> <activity android:name="com.onlinecars.aiad.Radio" android:label="@string/app_name" > <intent-filter> <action android:name="com.onlinecars.aiad.Radio" />
Activity_main
<RelativeLayoutxmlns:android="http://schemas.android.co m/apk/res/android" xmlns:tools="http://schemas.android.com/tools" android:layout_width="match_parent" android:layout_height="match_parent" tools:context=".MainActivity"> <com.google.android.maps.MapView android:id="@+id/mapView" android:layout_width="fill_parent" android:layout_height="fill_parent" android:apiKey="0qr9OrCyW4vbBZTUXTwHjAKMMXffN59z59KJuQ" android:clickable="true" android:enabled="true" />
</RelativeLayout>
Radio xml
<?xml version="1.0" encoding="utf-8"?>
$query11 = 'SELECT * FROM dijkstra '; $result11 = mysql_query($query11); while($row11=mysql_fetch_assoc($result11)){ $source=$row11["from"]; $destination=$row11["to"];
$row1 =mysql_fetch_array(mysql_query("SELECT AVG(status) FROM status WHERE source = '$source' and destination = '$destination'")); //echo $row1['result']; //echo "<hr>";
AS result
$row2 =mysql_fetch_array(mysql_query("SELECT STDDEV(status) FROM status WHERE source = '$source' and destination = '$destination'")); //echo $row2['result'];
AS result
$query = "SELECT * FROM `roadlength` WHERE `from` = '$source' and `to` = '$destination' "; $result = mysql_query($query); $row=mysql_fetch_assoc($result); $len=$row["length"]; echo "$len"; echo"<hr>";
$query = "UPDATE `dijkstra` SET `weight`= '$weight' WHERE `from`= '$source' and `to` = '$destination' " ; $mmm = mysql_query($query);
$query11 = 'SELECT * FROM coordinates '; $result11 = mysql_query($query11); while($row11=mysql_fetch_assoc($result11)){ $i=$row11["point"]; $$i=new DijkstraNode ("$i"); } /* //
// check for required fields if (isset($_POST['srclong']) && isset($_POST['srclat']) && isset($_POST['dstlong']) && isset($_POST['dstlat'])) { $srclong = $_POST['srclong']; $srclat = $_POST['srclat']; $dstlong = $_POST['dstlong']; $dstlat = $_POST['dstlat'];
} * * */
31.031553;
$query = "SELECT * FROM `coordinates` WHERE `long` = and `lat` = $srclat "; $result = mysql_query($query); $row=mysql_fetch_assoc($result); $src=$row["point"];
$srclong
$query1 = "SELECT * FROM coordinates WHERE `long` =$dstlong and `lat` = $dstlat"; $result1 = mysql_query($query1); $row1=mysql_fetch_assoc($result1); $dst=$row1["point"];
$query2="SELECT * FROM dijkstra"; $result2=mysql_query($query2); while($row2=mysql_fetch_assoc($result2)){ $X=$row2["from"]; $Y=$row2["to"]; $Z=$row2["weight"]; $$X->addNeighbour($$Y,$Z); } $nodes = DijkstraNode::getNodes(); $dijkstra = Dijkstra::findRoute($nodes,$$src); // This contains an array which has as key the id of the nodes and for value // the predecessor of the node in the shortest path to the source $paths = $dijkstra['paths']; // This contains the shortest path cost foreach node (indexed by node id) $pathsCosts = $dijkstra['pathsCosts']; foreach($paths as $nodeId => $nodePred) { $pred = $nodePred; $cPath = array($nodeId); while($pred) { $cPath[] = $pred; $pred = $paths[$pred]; } $cPath = array_reverse($cPath);
Amr El-shamy
Project Participations Android Developing. GUI Programming Academic Achievements Last grade: Good. Non-Academic Achievements IEEE Member. Trainings CCNA GSM
Refrences:
- Android Porting Guide,(2012),http://pdk.android.com,accessed Oct 2012 Android Source, (2012),http://source.android.com, accessed Oct 2012 - Android the OS Wikipedia http://en.wikipedia.org/wiki/Android_(operating_system), (2012) accessed - Dalvik VM Wikipedia,(2012): (http://en.wikipedia.org/wiki/Dalvik_(software accessed - Apress - Pro Android 2, ISBN-13/EAN: 9781430226598 - by Sayed Y. Hashimi Satya Komatineni and Dave MacLean. - DevKit8500 Manuals - JENKOV, (2010), http://tutorials.jenkov.com/java-reflection/dynamicclassloading-reloading.html, accessed February 2013. - Dijekstra Algorithm, (2013) http://en.wikipedia.org/wiki/ Dijekstra_Algorithm - Apress.Android.Essentials By Chris Haseman - Product Design and Development - third edition by Karl T. Ulrich Steven D Eppinge - Beginning Android by Mark Murphy - RENAULD WALDURA, (2007), /http://renaud.waldura.com/doc/java/dijkstra and
- Java How to Program, 6th Ed 2004 By H. M. Deitel - Deitel & Associates, Inc., P. J . Deitel - Deitel & Associates, Inc. - PANYAM, (2008), http://panyam.wordpress.com/2008/03/07/androidhackparcellable-in-eclipse/, accessed Dec 2009 - Android developers Guide, (2013),http://developer.android.com/reference - Android developers Group,(2013), http://groups.google.com/group/androiddevelopers - writing c code for android,(2010),http://www.linuxmag.com/id/7697,accessed Modular GPS Platform 2010 by - Android gestures http://developer.android.com/reference/android/gesture/package summary.html - "android-serial port API",(2013),"http://code.google.com/p/androidserialportapi/" - Beginning Android 2 by By Mark L Murphy - Professional Android programming by Reto Meier - Java, XML, and JAXP by Arthur Griffith - Android Application Development By Rick Rogers, John Lombardo, Zigurd