Location-Based Information Systems

Similar documents
Transcription:

Location-Based Information Systems Developing Real-Time Tracking Applications Miguel A Labrador Alfredo J Perez Pedro M Wightman CRC Press Taylor & Francis Group Boca Raton London New York CRC Press Is an Imprint of the Taylor & Francis Group, an Informa business A CHAPMAN & HALL BOOK

Contents 1 Introduction 1 11 Definition and Classification of LBS 2 111 Types of LBS Applications 2 12 Location Provider Architectures 3 13 A Complete LBIS Real-Time Tracking System Example 6 14 Software Architecture 8 141 Client-Side Software Architecture 9 142 Server-Side Software Architecture 10 15 A Brief Look into the Future 11 16 Organization of the Book 13 2 The Mobile Phone 15 21 Introduction 15 22 The Hardware Architecture 15 221 The Microprocessor 16 222 Digital Signal Processors (DSPs) 17 223 The GPS Receiver 18 224 Memory 18 225 Future Trends and Challenges 19 23 The Software Architecture 21 231 The Java ME Virtual Machine 22 2311 The Execution Engine 23 2312 The Heap 24 2313 The Garbage Collector 25 2314 The Loader 25 2315 The Verifier 25 2316 The Thread Manager 26 24 The Mobile Phone and the LBIS Tracking System Example 26 3 The Java Platform Micro Edition (Java ME) 27 31 Introduction 27 32 The Java ME Platform 28 33 The Connected Limited Device Configuration (CLDC) Layer 11 29 331 Java Programming Language and Virtual Machine Fea tures 30 xix

XX Contents Profile 332 Libraries and APIs 30 The Mobile Information Device 33 34 (MIDP) Layer 20 35 Optional Packages 34 36 The Java ME Platform and the LBIS Tracking System Example 35 4 MIDlet Development 37 41 Introduction 37 42 MIDlets 37 43 A Hello World MIDlet 39 44 The User Interface API 40 441 Lists, Text Boxes, Forms, and Alerts 43 45 The Media API 45 46 The Record Management System API 46 461 Working with Record Stores and Records 47 47 Security 49 471 Information Security Goals and Mechanisms 49 472 MIDlet Security 49 473 Network Security 52 48 Privacy 53 49 MIDlet Development and the LBIS Tracking System Example 54 5 Other Important Programming Aspects 55 51 Introduction 55 52 Memory Management 55 53 Concurrency 56 531 Defining and Starting Threads 59 532 Stopping Threads 60 533 Joining, Interrupting, and Sleeping Threads 60 534 Monitors and Locks 61 535 Waits and Notifications 63 54 Dynamic Linking 64 55 Energy Management 64 56 Other Important Programming Aspects and the LBIS Tracking System Example 66 6 Obtaining the User's Position 67 61 Introduction 67 62 The Global Positioning System (GPS) 67 621 The Format of the GPS Navigation Message 68 622 Lateration 69 63 The GSM Cellular Network 73 631 Cell Identification or Cell ID 74 632 Enhanced Cell Identification 75 633 Enhanced Observed Time Difference (E-OTD) 75 634 Uplink-Time Difference of Arrival (U-TDoA) 75

Contents xxi 89 106 115 635 Assisted GPS (A-GPS) 76 64 Indoor Positioning Systems 77 641 Indoor Positioning Techniques 77 642 Skyhook's Hybrid Positioning System (XPS) 79 65 The Location API 20 79 651 Improvements from Version 10 82 6511 Criteria and LocationProvider 82 6512 ProximityListener 83 6513 Landmark and LandmarkStore 84 652 New Features 84 6521 Landmark Exchange Formats 84 6522 Geocoding 84 6523 Map User Interfaces 85 6524 Navigation 85 66 Obtaining the User's Position and the LBIS Tracking System Example 86 7 Storing and Retrieving the Data: The Database 87 71 Introduction 87 72 Background 87 721 Design of the LBIS Tracking System Database 722 Structure of a Relational Database 90 723 The Structure Query Language (SQL) 93 7231 Data Definition Language (DDL) 93 7232 Data Manipulation Language (DML) 97 7233 Data Retrieval 98 724 PostGIS and Geographical Databases 99 7241 Structure of PostGIS 100 7242 Creating a Table with Geographical Columns 101 7243 Inserting Geographical Data in a Table 101 7244 Retrieving Geographical Data 102 7245 Useful Geometric Operators 102 73 Accessing the Database Using Java 103 731 Connecting to the Database via JDBC 103 732 Data Insertion 104 733 Data Queries 105 74 pgadmin III: Postgres's Database Administration Tool 741 Creating a New Database 106 742 Creating a New Table Using the Wizard 106 743 Using the SQL Execution Module 113 75 The Database and the LBIS Tracking System Example

xxii Contents 8 Sending and Receiving Data: Communications 117 81 Introduction 117 82 The Generic Connection Framework (GCF) of the CDLC 117 83 The Mobile Information Device Profile (MIDP) 119 831 A TCP Client Example 120 832 A UDP Client Example 122 833 A Generic Server Example 123 834 A TCP Server Example 125 835 A UDP Server Example 127 836 A HyperText Transfer Protocol (HTTP) Example 129 84 The Wireless Messaging API (WMA) 131 841 A Multimedia Messaging Service Example 132 85 Communications and the LBIS Tracking System Example 134 851 A Java ME Tracking MIDlet Using UDP 134 852 Server-Side Application 137 157 9 Java ME Web Services 139 91 Introduction 139 92 An Overview of Web Services 139 93 The Web Services API (WSA) 141 931 The JAX-RPC Package 142 932 The JAXP Package 143 94 A Web Service Example 143 941 Web Service Creation 144 942 MIDlet Creation 146 95 Web Services and the LBIS Tracking System Example 10 System Administration 159 101 Introduction 159 1011 The World Wide Web (WWW) 159 102 Google Web Toolkit 160 103 Creating System Administration Functions 162 1031 Client-Side Code 163 10311 Creating System Administration Functions 169 10312 Remote Procedure Calls in GWT 171 1032 Server-Side Code 177 1033 Compiling and Deploying the Application with GWT 181 104 System Administration and the LBIS Tracking System Exam ple 182 11 Data Visualization 183 111 Introduction 183 112 Visualizing the Users' Positions in Google Maps 183 1121 Configuring the GWT Project 184

Contents xxiii 11211 Import the Library into the GWT Eclipse Project 184 11212 Configure the GWT Project xml File 185 1122 Client-Side Code 186 1123 Server-Side Code 191 113 Google Earth 193 1131 KML Language 194 1132 Generating KML Documents Dynamically 195 1133 Embedding Google Earth in a Web Application 199 11331 The GWT JavaScript Native Interface 200 11332 Loading Google Earth in a GWT Web Appli cation 201 114 Data Visualization and the LBIS Tracking System Example 209 12 Processing the Data 211 121 Introduction 211 122 Mobile Device-Side Processing 211 123 Server-Side Processing 214 1231 Finding the Closest Friend 214 1232 Integration of LBIS and Wireless Sensor Networks for Situational Awareness 218 124 Processing the Data and the LBIS Tracking System Example 220 222 A Installing the Software Development Environments (SDE) 221 Al Introduction 221 A2 Server-Side Software Development Environment 222 A21 Sun Java Development Kit (JDK) Standard Edition A22 GlassFish Application Server 222 A221 Administrator Information and Communica tion Ports 223 A222 Recommended Options 223 A223 Special File Replacement 225 A224 Starting and Stopping the Application Server 225 A23 Postgres 226 A231 Administrator Information 227 A232 Communication Port 227 A24 PostGIS 228 A241 Database Information 228 A25 JDBC Drivers 228 A26 Registering the Database in the Server 231 A261 Creating a Connection Pool 231 A262 Creating a JDBC Resource 236 A3 Server-Side Application Development Environment 238 A31 Registering NetBeans 238 A4 Client-Side Application Development Environment 241

xxiv Contents A41 Sun Java Development Kit 243 and the GWT Maps API 243 A42 Google Web Toolkit (GWT) A43 The Eclipse Integrated Development Environment 244 A44 Installing the GWT in Eclipse 244 A5 Mobile-Side Software Development Environment 245 A51 Cellular Phone Emulators 246 A511 Sprint Wireless Web Toolkit (SWWT) 246 Bibliography 251 Index 257