Beruflich Dokumente
Kultur Dokumente
_______________
_______________
In Partial Fulfillment of the Requirements for the Degree Master of Science in Computer Science
_______________
iii
iv
TABLE OF CONTENTS
PAGE ABSTRACT............................................................................................................................. iv LIST OF FIGURES ................................................................................................................ vii ACKNOWLEDGEMENTS ..................................................................................................... ix CHAPTER 1 2 3 4 INTRODUCTION .........................................................................................................1 HISTORY ......................................................................................................................2 BASIC POSITION DETERMINATION WITH GPS...................................................4 DEVICE PERSPECTIVE OF A GPS .........................................................................10 4.1 Basic Units .......................................................................................................10 4.2 Sports/Training Units .......................................................................................10 4.3 Portable Units...................................................................................................10 4.4 Car GPS Systems .............................................................................................11 4.5 Double DIN Systems .......................................................................................11 4.6 PDA Based Systems ........................................................................................11 4.7 Laptop Based Systems .....................................................................................12 4.8 Phones with GPS..............................................................................................12 4.9 Mobile Phones with GPS Capability ...............................................................12 4.10 GPS-Enabled Cell Phones..............................................................................13 4.11 Location-Based Services (LBS) .....................................................................13 4.11.1 Accutracking ........................................................................................ 14 4.11.2 Google Latitude ................................................................................... 14 4.11.3 MapQuest Find Me .............................................................................. 14 4.11.4 Sprints Mobile Locator ....................................................................... 14 4.11.5 Wherify Wireless ................................................................................. 14 4.12 Permissions and Privacy ................................................................................14 4.13 Tracking Application Persistence ...............................................................15 5 PROPOSED PROJECT AND ITS ADVANCEMENTS ............................................16
vi 6 7 SYSTEM REQUIREMENTS ......................................................................................18 SOFTWARE COMPONENT INSTALLATION AND IMPLEMENTATION..........19 7.1 Installing the Android SDK .............................................................................19 7.2 Android Eclipse Plug-In (ADT).......................................................................21 7.3 Updating the ADT Plug-In...............................................................................23 7.4 How to Use Eclipse to Develop Android Applications ...................................27 7.4.1 Creating a New Android Project ............................................................ 27 7.4.2 Creating a Launch Configuration for Eclipse ........................................ 28 7.5 Running and Debugging an Eclipse Application .............................................30 7.5.1 Developing Android Applications with Other IDEs and Tools ............. 31 7.5.2 Creating an Android Project .................................................................. 32 7.5.3 How to Build an Android Application ................................................... 33 7.5.4 How to Run an Android Application ..................................................... 34 7.5.5 How to Attach a Debugger to Your Application ................................... 34 7.5.6 How to Configure Your IDE to Attach to the Debugging Port ............. 35 7.5.7 Debugging Android ............................................................................... 35 7.5.8 Debug and Test Settings on the Device ................................................. 36 8 CLIENT-END SOFTWARE IMPLEMENTATION ..................................................38 8.1 Setting Up of IIS 7 Server ................................................................................38 8.2 Install IIS 7.......................................................................................................39 8.3 Installing Server ...............................................................................................40 8.3.1 How to Install Server ............................................................................. 42 8.3.2 How to Configure Management Service................................................ 50 9 CLIENT SIDE IMPLEMENTATION .........................................................................54 10 SERVER SIDE IMPLEMENTATION........................................................................61 11 CONCLUSION AND OBSTACLES ..........................................................................65 12 FUTURE WORK .........................................................................................................66 BIBLIOGRAPHY ....................................................................................................................67
vii
LIST OF FIGURES
PAGE Figure 3.1. Position determination with two satellites (in a 2-dimensional world). ..................6 Figure 3.2. 2D position determination with two satellites and clock error. ...............................7 Figure 3.3. 2D position determination with three satellites and corrected clock error. .............8 Figure 7.1. Android SDK 1.0. ..................................................................................................19 Figure 7.2. Start installing SDK. ..............................................................................................20 Figure 7.3. Environment variable creation. .............................................................................21 Figure 7.4. Software update. ....................................................................................................22 Figure 7.5. Additional plug-ins. ...............................................................................................23 Figure 7.6. Add website for plug-ins. ......................................................................................23 Figure 7.7. Install the plug-ins. ................................................................................................24 Figure 7.8. Continue installation of plug-ins. ..........................................................................24 Figure 7.9. Accept and continue the installation of plug-ins. ..................................................25 Figure 7.10. Continue installing plug-ins. ...............................................................................25 Figure 7.11. Restart after installing plug-ins. ..........................................................................26 Figure 7.12. Finish installation of plug-ins. .............................................................................26 Figure 7.13. Creating new project............................................................................................28 Figure 7.14. Selecting Android to create Android Project.......................................................29 Figure 7.15. Provide name and location of new Android Project. ...........................................30 Figure 7.16. Run configuration. ...............................................................................................31 Figure 7.17. Location for Launch. ...........................................................................................31 Figure 7.18. Output of Android Project. ..................................................................................32 Figure 8.1. Run as administrator. .............................................................................................39 Figure 8.2. Open control panel. ...............................................................................................40 Figure 8.3. Open program. .......................................................................................................41 Figure 8.4. Open on/off Windows features. .............................................................................41 Figure 8.5. Administrator permission. .....................................................................................42 Figure 8.6. Install IIS from Windows feature. .........................................................................42
viii Figure 8.7. Web management tools service. ............................................................................43 Figure 8.8. WWW services. .....................................................................................................43 Figure 8.9. Installing the change made on Windows services. ................................................44 Figure 8.10. IIS installation finished........................................................................................44 Figure 8.11. Open IIS on Internet Explorer. ............................................................................45 Figure 8.12. Turn on/off server. ...............................................................................................45 Figure 8.13. Computer properties. ...........................................................................................46 Figure 8.14. Service pack for Microsoft Windows editions. ...................................................46 Figure 8.15. Turn on/off Windows features.............................................................................47 Figure 8.16. Installing IIS 6 Manager. .....................................................................................47 Figure 8.17. Continue installing. .............................................................................................48 Figure 8.18. Agree the license to continue installation............................................................48 Figure 8.19. Location to install. ...............................................................................................49 Figure 8.20. Install all the settings. ..........................................................................................49 Figure 8.21. Finish the installation. .........................................................................................50 Figure 8.22. Opening IIS 6 Manager. ......................................................................................51 Figure 8.23. Management tool installation. .............................................................................51 Figure 8.24. Open management service. ..................................................................................52 Figure 8.25. Start the server. ....................................................................................................53 Figure 9.1. Homepage of the GPS status application. .............................................................54 Figure 9.2. Turn on wifi settings..............................................................................................56 Figure 9.3. Add unique tracking ID. ........................................................................................57 Figure 9.4. Choose from previously added tracking ID. .........................................................58 Figure 9.5. Start tracking system. ............................................................................................60 Figure 10.1. Homepage of GPS solution website. ...................................................................61 Figure 10.2. Providing wrong tracking ID. ..............................................................................62 Figure 10.3. Tracking map. ......................................................................................................63 Figure 10.4. Satellite version of map. ......................................................................................64 Figure 10.5. Exact time and date. ............................................................................................64
ix
ACKNOWLEDGEMENTS
Thank you, Prof. Nenad, Prof. Eckberg, and Prof. Richard, for giving eloquent and clear voice to the ideas so many of us feel but do not always know how to express. Thank you for being an example of the difference one person with deep convictions can make. Thank you for always telling us that we, too, could make that difference. And thank you for always pushing us to dream of what is possible, rather than settling for what is.
CHAPTER 1 INTRODUCTION
Global Positioning System (GPS) has become a term of vivid usage in peoples dayto-day lives, whether it is in the commercial arena, Security forces or even exploration basis. In recent years with the improvement of technologies we are in constant contact with Satellites orbiting in Space, which is the sole source of a GPS. GPS is a space-based global navigation satellite system (GNSS) that provides reliable location and time information in all weather and at all times and anywhere on or near the Earth, when and where there is an unobstructed line of sight to four or more GPS satellites. It is maintained by the United States government and is freely accessible by anyone with a GPS receiver [1]. The objective of this application is to make complete use of GPS technology and locate from anywhere, anytime the exact position of the mobile device on the earth with respect to its latitude and longitude. The main requirements to implement this application are that the mobile device must have assisted GPS and internet connectivity. This application will run in background on the mobile device when started and it will send the last known latitudes and longitudes to the server. By using this application we can project the current location of the mobile device, in a selected time frame we can even see the path of the mobile device followed This whole information we can see on a Google map as well as in form of longitude and latitude with tag id. Moving forward to Chapters 2 and 3 we will discuss about History of GPS and how we obtain the actual Position on earth using satellite. Chapter 4 describes the area where GPS is used in day to day life. Chapter 5 is about GPS tracking system project. Chapters 6, 7, 8 is mainly about installation and requirements to run this project on your mobile and computer. Chapter 9 and 10 shows the exact flow of the proposed project. Going forward in next chapter we will see the future enhancement.
CHAPTER 2 HISTORY
In the 1960s, the Global Positioning System emerged as a radical new way to provide precise navigation for U.S. armed forces across the globe. Early work at The Aerospace Corporation helped get the program off the ground. Many people are unaware of the fact that this revolutionary advance in navigational science was conceived, in part, through studies conducted at The Aerospace Corporation in the early 1960s. In addition, two of the men most responsible for its success have direct ties to Aerospace: Ivan Getting, the foremost initial advocate for GPS, was the corporations founding president, and Bradford Parkinson, who headed the first GPS Joint Program Office, is chair of The Aerospace Corporation board of trustees. During the first half of the 20th century, researchers at various organizations were separately developing the technologies that would eventually be used to create GPS. By 1960, much of this work had coalesced in a manner that would place Aerospace at the heart of GPS research [1]. Indeed, the development of satellite technology was a crucial precursor for GPS, and the systems key navigational concept was discovered as a result of the Sputnik launch on October 4, 1957. Sputnik was little more than an orbiting radio transmitter, but it captured the attention of scientists across the globe. Two scientists at the Johns Hopkins University Applied Physics Laboratory (APL), George Wieffenbach and William Guier, realized as they listened to Sputniks signal that they could determine its orbit from the Doppler frequency shift detected as it passed overhead. Their measurements were subsequently confirmed by findings from other tracking sites. From this observation, Frank T. McClure at APL reasoned that, conversely, if the orbit of a satellite were known, then Doppler-shift measurements could also be used to determine any ground position on Earth [1]. Only a few months after the formation of Aerospace in the summer of 1960, much of the knowledge base that was pivotal to the development of GPS was already taking shape. The principal mission of Aerospace was to aid the United States Air Force in applying the full resources of modern science and technology to the problem of achieving those
3 continuing advances in ballistic missiles and military space systems which are basic to national security. to that end, Aerospace initiated a series of studies in areas where the application of space systems might prove most valuable. One of the earliest of these studies dealt with navigation. The ultimate implementation of GPS would not have been possible without concurrent advances in other fields. Over the next 15 years, GPS development proceeded at a rapid pace. Much of the work in Phase I (concept validation) consisted of testing the many potential types of user equipment. Many of these experiments occurred at the Yuma Proving Ground in Arizona using ground-based transmitters in lieu of orbiting satellites. Extensive testing was also done with the position determination of a wide variety of vehicles, aircraft, and troops with GPS receivers. Between 1977 and 1979, more than 700 tests were conducted, and all of them confirmed the systems extraordinary accuracy. The Department of Defense (DOD) approved Phase II of the program in 1979 which was intended to provide global two-dimensional coverage for a select group of users. In 1985, Phase III (the production and development phase) began, and the first operational GPS Block II satellite was launched in February 1989. GPS was unexpectedly able to validate its worth following the Iraqi invasion of Kuwait in 1990, when the system provided invaluable navigational information to airborne, ground, and naval units of the allied forces. During and after the Persian Gulf War, the medias coverage of GPS helped stimulate a surge of civilian interest. By the time GPS was declared fully operational in 1995, its future success was virtually guaranteed.
5 satellites are taken into account, the present position can be calculated by trilateration (meaning the determination of a distance from three points). This means that at least three satellites are required to determine the position of the GPS receiver on the earth surface. The calculation of a position from three satellite signals is called 2D-position fix (2-dimensional position determination). It is only two dimensional because the receiver has to assume that it is located on the earth surface (on a plane two-dimensional surface). By means of four or more satellites, an absolute position in a three dimensional space can be determined. A 3Dposition fix also gives the height above the earth surface as a result. Simplified, the position determination by means of a GPS works on the sample principle as the distance of thunderstorms can be judged: the time is measured between lightning and the following thunder. The speed of light is so high that the delay between the time where the flash hits the ground and the time the observer sees the flash can be neglected. The speed of sound in the earths atmosphere is approximately 340 m/s. This means that for example a difference of 3 seconds between lightning and thunder corresponds to approximately 1 km distance to the thunderstorm. However, this procedure is not yet a determination of a position, but only a determination of a distance. If different people on fixed positions would determine the time span between lightning and thunder, this would allow the determination of the position where the flash hit the ground! In Figure 3.1 an explanation is given, how the position determination by GPS works. For simplification, in the first step we assume that the earth is a two-dimensional disk. This allows us to do some understandable sketches for illustration. The principle can then be transferred to the model of a three-dimensional globe. In the example on the left in Figure 3.1, the time needed by a signal to travel from the first of two satellites to the receiver was determined to be 4 s. (In reality this value is far too high. As the signals travel with the speed of light (299,792,458,0 m/s), the actual time span for signals from the satellite to the receiver lies in the range of 0.07 s). Based on this information, we can state that the receiver is positioned somewhere on a circle with a radius of 4 s around the first satellite (left circle). If we perform the same procedure with a second satellite (right circle), we get two points of intersection. On one of the two points the receiver must be situated. Now we have used two satellites. But the process is called
Figure 3.1. Position determination with two satellites (in a 2-dimensional world). trilateration, not dilateration so dont we need a third satellite? We may use a third satellite but we could also assume that the receiver is located somewhere close to the earths surface and not deep in space, so we can neglect point B and know that the receiver must be found on point A. The area in Figure 3.1 which shaded grey is the region in which GPS signals are supposed to be realistic. Positions outside this area are discarded, so is point B. This assumption replaces the third satellite which would in theory be required for the process of trilateration. In this example an unequivocal position is obtained from only two satellites. So we just need a third satellite for a third dimension and thats it? Well, in principle yes. But The problem lies in the determination of the exact runtime of signals. As explained above, satellites impose a sort of time stamp on each transmitted data package. We know that all clocks of satellites are absolutely precise (they are atomic clocks after all) but the problem is the clock in our GPS receiver. Atomic clocks being too expensive, our GPS receivers are based on conventional quartz clocks which are comparatively inaccurate. What does this mean in practice? Lets stick to our example and suppose the clock in our receiver is 0.5 seconds early compared to the clock in the satellite (see Figure 3.2). The runtime of the signal seems to be
Figure 3.2. 2D position determination with two satellites and clock error. 0.5 s longer than it actually is. This leads to the assumption that we are on point B instead of point A. The circles that intersect in point B are called pseudo-ranges. They are called pseudo as long as no correction of the synchronization errors (bias) of the clocks has been performed. Depending on the accuracy of the clock in the GPS receiver, the determined position will be more or less wrong. For the practice of GPS based navigation this would mean that no determined position can ever be of any use, as the runtimes of the signals are so short, that any clock error has an overwhelming influence on the result. A clock error of 1/100 second, which is difficult to imagine but quite common from car races or skiing races, would in GPS navigation lead to a mistake in the position of about 3000 km. to achieve an accuracy of 10 m of the position, the runtime of the signal must be precise to 0.00000003 seconds. As atomic clocks are no option in GPS receivers, the problem is solved in another and quite elegant way as shown in Figure 3.3. If a third satellite is taken into account for the calculation of the position, another intersection point is obtained: in case that all clocks are absolutely precise, point A would be obtained, corresponding to the actual position of the receiver. In case of the receiver clock being 0.5 s early, the three intersection points B are obtained. In this case the clock error stands out immediately. If now the time of the receiver clock is shifted until the three
Figure 3.3. 2D position determination with three satellites and corrected clock error. intersection points B merge to A, the clock error is corrected and the receiver clock is synchronized with the atomic clocks in the satellites. The GPS receiver can now be regarded as an atomic clock itself. The distances to the satellites, formerly regarded as pseudo-ranges, now correspond to the actual distances and the determined position is accurate. In case of the example a two dimensional disc world we therefore need three satellites for an unequivocal determination of our position. In the real world which has one additional dimension, we would need a fourth satellite. Well, then why is it always said that three satellites are enough? In practice you get a two-dimensional position determination (2D-fix) with three satellites. The position is bound to be located on the earths surface. The fourth satellite is the geo-center; the distance to the fourth satellite corresponds to 6360 km (the radius of the globe). Therewith the fourth
9 satellite necessary for the calculation is given, but the calculation is restricted to locations on the earth surface. However the earth is not a perfect sphere. The surface of the earth in this case means the earth geoid, corresponding to sea level. If the receiver is located on a mountain, the determined position again is afflicted with an inaccuracy, as the runtime of the satellite signals is wrong. By constantly recalculating its position, the GPS receiver can additionally determine the speed and direction of a movement (referred to as ground speed and ground track). Another possibility of determining the speed is by using the Dopplers effect which occurs due to the movement of the receiver while receiving the signals. The principle is the same as for a moving siren on a police car: the tune is higher when the car moves towards the listener and it is lower when the car moves away [2]. Android is a software stack for mobile devices that includes an operating system, middleware and key applications. The Android SDK provides the tools and APIs necessary to begin developing applications on the Android platform using the Java programming language. XML is tagged based language through which we can design the graphics user interface in android device. XML tags are used to define different kind of elements to display on the screen. Tags also have various attributes within the element to set different properties of the element like width height of the textbox. There are many layouts defined in XML language for android user interface. Like linear layout and scroll layout, etc. We make a ASP application on remote server side to fetch the data sent from mobile device.
10
11 Higher end potable units have larger screens and large memory storage capacity. They typically use a hard drive or DVD disk to store the map software. Most of the high end portable units have other cool integrated features such a MP3 playback capability, XM satellite radio services, picture viewers, audio books and blue tooth integration.
12
13 More solutions also exist for smart-phones with inbuilt GPS capabilities. Some such phones can use tethering to double as a wireless modem for a laptop, while allowing GPSnavigation/localization as well [1]. One such example is marketed by Verizon Wireless in the United States, and is called VZ Navigator. The system uses GPS One technology to determine the location, and then uses the mobile phones data connection to download maps and calculate navigational routes. Other products including iPhone are used to provide similar services. Nokia gives Ovi Maps free on its smart-phones and maps can be preloaded. According to market research from the independent analyst firm Berg Insight, the sales of GPS-enabled GSM/WCDMA handsets was 150 million units in 2009 [4], while only 40 million separate GPS receivers were sold. GPS navigation applications for mobile phones include Waze and Google Maps Navigation. Google Maps Navigation included with Android and iPhone means most smartphone users only need their phone to have a PNA [1].
14
4.11.1 Accutracking
Accutracking is a full-featured low-cost LBS provider using Motorola, Boost Mobile and Blackberry phones operating on the Sprint/Nextel network [5].
15
16
17 Once the Id has-been selected the tracking of the location in accordance to latitudes and longitudes starts up by a simple press of Green start button in the Cellular device which begins tracking. And accordingly the system would start rendering the detailed locations data into a database at regular intervals which are pre-set. A server database repository is being used to hold this data, thus providing an accurate tracking methodology if needed for historical trips which the device has followed. Stopping of the application would be initiated using the Red stop button. Also the device provides feature to drop a Unique Id, in-case if needed, by just a click of delete button present in most of the commercial cell-phones. Now we comet Phase II, where-in an interactive website would be built which would be the core of the project dealing with the server database. The web application would fetch data from the server database and provide an entire trajectory of the path followed by the device in accordance to the unique-id provided. And since longitude and latitude of the phone is stored along with time span so we are able to trace the phone based on time span. Looking just at the time-span ranges, we could judge the exact location of the device at a particular time, or even fore-tell the entire trajectory being followed by the device for a given unique-id.
18
You will also need to install a suitable development environment such as: Eclipse Eclipse 3.2, 3.3 (Europa) Android Development Tools Plug-In(optional)
Other development environments or IDEs JDK 5 or JDK 6 (JRE alone is not sufficient) Not compatible with Gnu Compiler for Java (gcj) Apache Ant 1.6.5 or later for Linux and Mac, 1.7 or later for Windows
19
Figure 7.1. Android SDK 1.0. Alternatively you can add /tools to your root path which will prevent the need to specify the full path to the tools directory along with enabling you to run Android Debug Bridge (adb) along with other command line tools.
20
Figure 7.2. Start installing SDK. To add/tools using Linux: 1. Edit the ~/.bash_profile or ~/.bashrc files looking for a line that sets the PATH variable. 2. Add the full path location to your $SDK_ROOT/tools location for the PATH variable. 3. If no PATH line exists you can add the line by typing the following: Export PATH=${PATH}:<path to your $SDK_ROOT/tools> To add/tools using Mac OS X: In the home directory locate the .bash_profile and locating the PATH variable add the location to your $SDK_ROOT/tools folder. To add/tools using Windows XP/Vista: 1. Right click on the My Computer icon and select the properties tab. 2. Select the Advanced tab and click the Environment Variables button. 3. In the new dialog box double-click on Path (located under System Variables) and type in the full path location to the tools directory. See Figure 7.3.
21
22
Figure 7.4. Software update. 2. Choose Available Software tab, then click on the button Add Site...(see Figure 7.5). 3. In the resulting dialog box, enter a name for the remote site (e.g. Android Plug-In) and enter this as its URL: https://dl-ssl.google.com/android/eclipse/. 4. Press OK (see Figure 7.6). 5. You should now see the new site added to the search list (and checked). 6. Press Install (see Figure 7.7). 7. In the subsequent Search Results dialog box, select the checkbox for Android Plug-In >Eclipse Integration > Android Development Tools and press Next. 8. Read the license agreement and then select Accept terms of the license agreement, if appropriate. 9. Press Next (see Figure 7.8). 10. Press Finish (see Figure 7.9). 11. The ADT Plug-In is not signed; you can accept the installation anyway by pressing Install All (see Figure 7.10). 12. Restart Eclipse (see Figure 7.11). 13. After restart, update your Eclipse preferences to point to the SDK root directory ($SDK_ROOT): Select Window > Preferences to open the Preferences panel. (Mac OS X: Eclipse >Preferences) Select Android from the left panel.
23
Figure 7.6. Add website for plug-ins. For the SDK Location in the main panel, press Browse... and find the SDK root directory.
24
25
26
27
3. Press Finish. Once completed the ADT Plug-In will go ahead and create the following files and folders as appropriate for the type of project selected: src/ A folder that includes your stub .java Activity file. res/ A folder for your resources. AndroidManifest.xml The manifest for your project.
28
29
Figure 7.14. Selecting Android to create Android Project. 2. In the project type list on the left, right-click Android Application and select New. 3. Enter a name for your configuration. 4. On the Android tab, browse for the project and Activity to start (see Figure 7.17). 5. On the Emulator tab, set the desired screen and network properties, as well as any other emulator startup options. 6. You can set additional options on the Common tab as desired. 7. Press Apply to save the launch configuration, or press Run or Debug (as appropriate) (see Figure 7.18).
30
31
Figure 7.17. Location for Launch. Run starts the application. Debug starts the application in Wait for debugger mode, then opens the Debug perspective and attaches the Eclipse Java debugger to the application.
32
33 out <folder> which sets the output directory. By default, the output directory is the current directory. If you created a new directory for your project files, use this option to point to it. ide intellij, which generates IntelliJ IDEA project files in the newly created project Heres an example: /android_linux_sdk/tools$ ./activityCreator.py out myprojectour.package.name.ActivityName package:your.package.name out_dir:myproject activity_name: ActivityName ~/android_linux_sdk/tools$ The activityCreator script generates the following files and directories (but will not overwrite existing ones): AndroidManifest.xml The application manifest file, synced to the specified Activity class for the project. build.xml An Ant file that you can use to build/package the application. src/your/package/name/ActivityName.java The Activity class you specified on input. your_activity.iml, your_activity.ipr, your_activity.iws [only with the -ide intelliJ flag] intelliJ project files. res/ A directory to hold resources. src/ The source directory. bin/ The output directory for the build script. Once complete you will now be able to move your folder wherever you choose for development but youll need to bear in mind that you will need to use the adb program in the tools folder in order to send the files to the emulator.
34 Windows, the default is to install in the Program Files directory. This location will cause ant to fail, because of the space. to fix the problem, you can specify the JAVA_HOME variable like this: set JAVA_HOME=c:\Prora~1\Java\. The easiest solution, however, is to install JDK in a non-space directory, for example: c:\java\jdk1.6.0_02. 3. If you have not done so already, follow the instructions for Creating a New Project above to set up the project. 4. You can now run the Ant build file by simply typing ant in the same folder as the build.xml file for your project. Each time you change a source file or resource, you should run ant again and it will package up the latest version of the application for you to deploy.
35 Start the Dalvik Debug Monitor Server (DDMS) tool, which acts as a port forwarding service between your IDE and the emulator. 1. Set optional debugging configurations on your emulator, such as blocking application startup for an activity until a debugger is attached. Note that many of these debugging options can be used without DDMS, such as displaying CPU usage or screen refresh rate on the emulator. 2. Configure your IDE to attach to port 8700 for debugging. Weve included information higher up on how to set up Eclipse to debug your project.
36 I/Logger( 1858): getView() requesting item number 0 I/Logger( 1858): getView() requesting item number 1 I/Logger( 1858): getView() requesting item number 2 D/ActivityManager(763):Stopping:historyRecord{409dbb20com.google.android. home.AllApps} Android Log- A logging class to print out messages to a log file on the emulator. You can read messages in real time if you run logcat on DDMS (covered next). Add a few logging method calls to your code. To use the Log class, you just call Log.v() (verbose), Log.d() (debug), Log.i() (information), Log.w() (warning) or Log.e (error) depending on the importance you wish to assign the log message. Log.i(MyActivity, MyClass.getView() Requesting item number + position) You can use logcat to read these messages Traceview Android can save a log of method calls and times to a logging file that you can view in a graphical reader called Traceview. See the linked topic for more information. Eclipse Plug-In The Eclipse Android Plug-In incorporates a number of these tools (ADB, DDMS, logcat output, and other functionality). See the linked topic for more information. Debug and Test Device Settings Android exposes several settings that expose useful information such as CPU usage and frame rate.
37 It will enable you to select the Wait for Debugger option to pause application startup until your debugger attaches (described next). Wait for debugger Blocks the selected application from loading until a debugger attaches. This way you can set a breakpoint in onCreate(), which is important to debug the startup process of an Activity. When you change this option, any currently running instances of the selected application will be killed. In order to check this box, you must have selected a debug application as described in the previous option. You can do the same thing by adding wait ForDebugger() to your code. Immediately destroy activities Tells the system to destroy an activity as soon as it is stopped (as if Android had to reclaim memory). This is very useful for testing the on Freeze(Bundle) / onCreate(android.os.Bundle) code path, which would otherwise be difficult to force. Choosing this option will probably reveal a number of problems in your application due to not saving state. Show screen updates Flashes a momentary pink rectangle on any screen sections that are being redrawn. This is very useful for discovering unnecessary screen drawing. Show CPU usage Displays CPU meters at the top of the screen, showing how much the CPU is being used. The top red bar shows overall CPU usage, and the green bar underneath it shows the CPU time spent in compositing the screen. Note: You cannot turn this feature off once it is on, without restarting the emulator. Show screen FPS Displays the current frame rate. Mostly useful for games to see the overall frame rate they are achieving. Note: You cannot turn this feature off once it is on without restarting the emulator. Show background Displays a background pattern when no activity screens are visible. This typically does not happen, but can happen during debugging. [6] http://www.talkandroid.com/guides/developer/android-sdk-installguide/#.T0lQsfEgdm0
38
39 Note that you can run as user/administrator cmd.exe so that every application you run from that command line will be elevated, eliminating the need to use the run as syntax from that command line. If you are logged on to an account other than the built-in local administrator account, you may see the following security alert dialog box. See Figure 8.1.
40
Figure 8.2. Open control panel. 10. IS 7 is now installed with a default configuration on Windows Vista or Windows 7. to confirm that the installation succeeded, type the following URL into your browser, http://localhost(see Figure 8.11). 11. Next, you can use Internet Information Services Manager to manage and configure IIS. to open IIS Manager, click Start, type inetmgr in the Search Programs and Files box, and then press ENTER (see Figure 8.12).
41
42
43
44
Figure 8.10. IIS installation finished. 2. In the System window verify that you have SP1 installed. (Of course the reality is if you were remotely administrating IIS, you should already know if you have SP1, but I digress) (see Figure 8.14). 3. Now lets see if the Internet Information 7 Management Console is installed, by going to the Start button, clicking on Control Panel, and clicking on Turn Windows features on or off. If you are prompted by UAC, go ahead and click OK (see Figure 8.15). 4. You will find the component you want under Internet Informational Services -> Web Management Tools ->IIS Management Console. If it is checked then you are set, if it isnt go ahead and install it so we can begin the next part! (see Figure 8.16). 5. Ok on to installing the IIS 7 Manager client, by navigating to where you downloaded the client and double click on the file to start the installation.
45
46
Figure 8.14. Service pack for Microsoft Windows editions. 6. The first splash screen will show you that you are about to install IIS 7 Manager, so go ahead and click Next (see Figure 8.17). 7. Accept the license terms by placing a check in the box, and then click Next (see Figure 8.18). 8. Unless you have other plans, accept the default file location, and click Next (see Figure 8.19). 9. With all the preliminaries out of the way click on Install to begin the installation (see Figure 8.20). 10. When the installation routine finishes, go ahead and click Finish (see Figure 8.21).
47
48
49
50
Figure 8.21. Finish the installation. 11. We can go in and see if the installed version has upgraded our IIS Management Console. Go into your Administration Tools, and click on Internet Information Services (IIS) Manager. You may be prompted by UAC, click Ok if it does. If your install was successful you should see the console shown in Figure 8.22.
51
Figure 8.23. Management tool installation. 3. In the Management Service panel you will see a notice in the right pane that WMSVC is stopped. This is a very important step because it needs to be stopped to be able to configure the service. One of the key features of IIS 7 remote management is the ability to use either Windows credentials or IIS Manager Credentials. Lets go ahead and place a check next to Enable remote connections, and set the radio button to Windows credentials or IIS Manager credentials (see Figure 8.24). 4. In the next section on Connections, you can assign the IP address, Port, SSL Certificate, and log location for the service to use.
52
Figure 8.24. Open management service. 5. You can also restrict administration based on IPv4 address, either denying specific addresses or only allowing from specific addresses. 6. Now lets start the service by clicking on the Start button, in the right pane (see Figure 8.25).
53
54
Figure 9.1. Homepage of the GPS status application. If users Device GPS setting is not turned on, then at this point Enable GPS button is active and user could turn on the GPS feature by pressing that button on device. If your device GPS functionality is not enabled at this point, the application would detect it and Enable GPS button gets activated and you can turn on the GPS functionality by clicking on the Enable GPS button.
55 When the user hit the Enable GPS button, the method below is called to enable the GPS from phone settings menu. public void showGPSDisabledAlertToUser() { AlertDialog.BuilderalertDialogBuilder = new AlertDialog.Builder(this); alertDialogBuilder.setMessage("GPS is disabled in your device. Would you like to enable it?") .setCancelable(false) .setPositiveButton("Goto Settings Page to Enable GPS", new DialogInterface.OnClickListener(){ public void onClick(DialogInterface dialog, int id){ Intent callGPSSettingIntent = new Intent( android.provider.Settings.ACTION_LOCATION_SOURCE_SETTINGS); startActivity(callGPSSettingIntent); } }); alertDialogBuilder.setNegativeButton("Cancel", new DialogInterface.OnClickListener(){ public void onClick(DialogInterface dialog, int id){ dialog.cancel(); } }); AlertDialog alert = alertDialogBuilder.create(); alert.show(); } User can see the below screenshot after user hit Enable GPS button. Where-in user could see another pop-up window which displays a message, GPS is disabled in your device, would you like to enable it? Users have the choice to, either enable the GPS to use this application or even cancel it. If user clicks on Go to settings page to enable GPS then application will guide user to the required Phone-Settings menu from where a user can enable the GPS settings and turn it on. By pressing back button twice, the user could track over to the GPS Status application again. Now at this point of time the Enable GPS button gets disabled and device is ready for the required purpose. However if the user clicks on Cancel button, it would re-direct the user back to previous page where-in Enable GPS button is still in active phase because
56 GPS functionality is disabled and user would not be allowed to navigate further with this application without the essential GPS settings being turned-on. See Figure 9.2.
Figure 9.2. Turn on wifi settings. After enabling the GPS user will be routed back to GPS Status page where now user can click on Add button to add Unique Tracking ID of the new user to track this device. After user click on Add button, Figure 9.3 screen will appear to the user. User can add Unique Tracking ID for tracking the phone or person. After User enter a Tracking-ID, hit on save button to save that Tracking ID into database. If user clicks on Cancel button that Tracking Id is not been stored to database and application come back to main screen. If User enters the same Tracking Id which is previously saved in the database, then it shows an error message stating This Id is already present in database, please enter a new Unique Tracking Id
57
Figure 9.3. Add unique tracking ID. There is Remove button in main screen by which the user can delete the Selected Tracking Id from the database. At this point all the data associated with that Tracking Id is been removed from the database which is stored on server. If you clicked on Dropped down list you can find all the previously added and not removed Tracking id for the logged in user. Shown in Figure 9.4 is screenshot for such a scenario:After the user select, any one of the previously added Tracking Id, the User can see the Start tracking system button is now enabled. And immediately when the user initiates on Start tracking system button the below mentioned method is triggered. private void updateLocation() { try { final HttpClient client = new DefaultHttpClient(); HttpPost post; Location location; locationManager = (LocationManager)getSystemService(Context.LOCATION_SERVICE);
58
Figure 9.4. Choose from previously added tracking ID. crit.setAccuracy(Criteria.ACCURACY_FINE); provider = locationManager.getBestProvider(crit, true); location = locationManager.getLastKnownLocation(provider); lat = location.getLatitude(); lng = location.getLongitude(); latitude_str = ""+lat; longitude_str = ""+lng; latLongString = "Lat:" + lat + "\nLong:" + lng; Id = get_defaultid(); post = new HttpPost("http://Localhot/Location/default.aspx?latitude="+lat+"&longitude="+ln g+"&id="+Id); HttpResponse response = client.executte(post); MessageBox(latLongString); } catch (ClientProtocolException e) { // TODO Auto-generated catch block e.printStackTrace(); } catch (IOException e) { // TODO Auto-generated catch block e.printStackTrace(); }
59 At this time the users cellular device starts tracking and storing the actual Longitude and Latitude of the earth with the associated time and date. This data is quintessential to track the user. By using HttpPost method this data is sent to particular server with Latitude, Longitude and Unique Tracking Id. The procedure below is called when the user changes the position, where-in the device communicates with the server regarding the change in Longitude and Latitude of the phone. The below mentioned method is called, and uploads the updated Location to the server by using the same HttpPost method. Now this new location is stored under the same Tracking Id but with different longitude and latitude. public void updateWithNewLocation(Location location) { if (location != null) { lat = location.getLatitude(); lng = location.getLongitude(); latitude_str = ""+lat; longitude_str = ""+lng; latLongString = "Latitude:" + lat + "\nLongitude:" + lng; Id = get_defaultid(); post = new HttpPost("http://Localhot/Location/default.aspx?latitude="+lat+"&longitude="+ln g+"&id="+Id); } else { latLongString = "No location found"; } try { send_data(); } catch (ClientProtocolException e) { // TODO Auto-generated catch block e.printStackTrace(); } catch (IOException e) { // TODO Auto-generated catch block e.printStackTrace(); } } When actual tracking is started Start Tracking system button gets disabled. While at this point a user can stop the tracking of system by pressing Stop Tracking System button.
60 This button is enabled after user presses the Start Tracking system button. When Stop Tracking System button is pressed, device would stop sending further data to the centralized server (see Figure 9.5).
Figure 9.5. Start tracking system. If User wants to change the Tracking Id in middle of tracking system with other id then user simply have to select Tracking Id from drop down list and hit the Update Now button. This Update now button will stop tracking previously selected Tracking Id and Stop sending further data to server for that Tracking Id. Instead It start Sending the updated data to server for Updated Tracking Id. If User finds any difficulty how to use this application they can press Help button and can find out some help on How to use this application. Upon clicking the About button, the user can see who developed this application and it belongs to SDSU as part of thesis. Finally by pressing Exit button the user can exit this application at any time they want, there-by stopping further tracking for the Unique Tracking ID for the user.
61
Figure 10.1. Homepage of GPS solution website. In this page the user just has to enter the valid Tracking id. This tracking id is actually added by the user on his phone when he uses the GPS Status application. If the user doesnt provide the exact tracking id, Figure 10.2 Page will be displayed. User will be prompted a message stating that No Records Available with this ID.
62
Figure 10.2. Providing wrong tracking ID. Now if a user entered a valid Tracking id, then the website starts showing the tracking path for that unique tracking ID. When the user clicks on Go button after entering Valid Tracking ID the method below is called which first validates whether the required Enter Your Tracking ID textbox is not empty, and if its empty then it prompts an Enter Valid Tracking ID message to the user. Now if the user enters data and searches for it, it immediately refers an if loop and starts looking the Tracking id from database table. If its not able to find any data from that table then it simply shows No Records Available with this ID but if it finds some data from that table then PlotGPSPoint method is called. protectedvoidImageButton1_Click(object sender, ImageClickEventArgs e) { if (TextBox1.Text != "") { SqlDataAdapterdataAdapter = newSqlDataAdapter("Select * from tbllocation where id='"+ TextBox1.Text+"'", conn); SqlCommandBuildercommandBuilder = newSqlCommandBuilder(dataAdapter); DataTable table = newDataTable(); table.Locale = System.Globalization.CultureInfo.InvariantCulture; dataAdapter.Fill(table); if (table.Rows.Count == 0) { Label2.Text = "No Records Available with this ID"; }
63 else { js.Text = GPSLib.PlotGPSPoints(table); Label2.Text = ""; } } else { Label2.Text = "Enter Valid Tracking ID"; } } When valid Tracking Id entered by user then Figure 10.3 page is shown.
Figure 10.3. Tracking map. Now Users are able to see the whole path on actual Google map. They can zoom in and zoom out to see exact location with street name and view. Even users can change the map view to Satellite view as shown in Figure 10.4 screen shot. path.push(new google.maps.LatLng( + Latitude + , + Longitude + @)); This method is used to push the Latitude and Longitude to Google map. If users move their cursor on Point shown on the map they can see that exact time and date when they are at that place and it looks similar to the Figure 10.5 screenshot.
64
65
66
67
BIBLIOGRAPHY
[1] [2] [3] [4] Wikepedia. Global Positioning System, 2011. http://en.wikipedia.org/wiki/Global_Positioning_System, accessed Nov. 2011. Kowoma. Position Determination with GPS, 2009. http://www.kowoma.de/en/gps/positioning.htm, accessed Nov. 2011. Global Sat Technology Corp. Different Types of GPS Systems, 2011. http://www.usglobalsat.com/s-29-different-types-of-gps.aspx, accessed Nov. 2011. Colleen H. Yinger. Operation and Application of the Global Positioning System, 2002. http://www.aero.org/publications/crosslink/summer2002/02.html, accessed Nov. 2011. Travel By GPS.com. Cell Phone Tracking, 2006. http://nb.cupe.ca/locals/1253/cellphone-tracking, accessed Nov. 2011. Chris Moor. Android SDK Installation Guide, 2008. http://www.talkandroid.com/guides/developer/android-sdk-installguide/#.T0lQsfEgdm0, accessed Jan. 2012. Pharr. Installing IIS 7 on Windows Vista and Windows 7, 2010. http://learn.iis.net/page.aspx/28/installing-iis-on-windows-vista-and-windows-7/, accessed Feb. 2012. How to Geek Forum. How to Install IIS on Windows-Vista,2007. http://www.howtogeek.com/howto/windows-vista/how-to-install-iis-on-windowsvista/, accessed Jan. 2012. Dave Lawlor. Remote Administration of IIS 7: Install, Configure, Connect, 2008. http://www.trainsignal.com/blog/iis-7-remote-administration, accessed Feb. 2012. Microsoft. TechNet Library, 2012. http://technet.microsoft.com/enus/library/default.aspx, accessed Feb. 2012.
[5] [6]
[7]
[8]
[9] [10]