diff --git a/GPSTrackerNet/Database/GPSTracker.bak b/GPSTrackerNet/Database/GPSTracker.bak new file mode 100755 index 0000000..b6cb039 --- /dev/null +++ b/GPSTrackerNet/Database/GPSTracker.bak Binary files differ diff --git a/GPSTrackerNet/Database/GPSTracker.sql b/GPSTrackerNet/Database/GPSTracker.sql new file mode 100755 index 0000000..8cf1e90 --- /dev/null +++ b/GPSTrackerNet/Database/GPSTracker.sql @@ -0,0 +1,161 @@ +USE [GPSTracker] +GO +/****** Object: Table [dbo].[gpslocations] Script Date: 04/19/2008 09:33:23 ******/ +SET ANSI_NULLS ON +GO +SET QUOTED_IDENTIFIER ON +GO +SET ANSI_PADDING ON +GO +CREATE TABLE [dbo].[gpslocations]( + [GPSLocationID] [int] IDENTITY(1,1) NOT NULL, + [LastUpdate] [datetime] NOT NULL CONSTRAINT [DF_gpslocations_LastUpdate] DEFAULT (getdate()), + [Latitude] [decimal](10, 6) NOT NULL, + [Longitude] [decimal](10, 6) NOT NULL, + [phoneNumber] [varchar](20) NOT NULL, + [sessionID] [varchar](25) NOT NULL, + [speed] [int] NOT NULL, + [direction] [int] NOT NULL, + [distance] [int] NOT NULL, + [gpsTime] [datetime] NOT NULL, + [LocationMethod] [varchar](100) NOT NULL, + [accuracy] [int] NOT NULL, + [isLocationValid] [varchar](5) NOT NULL, + [extraInfo] [varchar](255) NOT NULL, + CONSTRAINT [PK_gpslocations] PRIMARY KEY CLUSTERED +( + [GPSLocationID] ASC +)WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY] +) ON [PRIMARY] +GO +SET ANSI_PADDING OFF +GO +/****** Object: StoredProcedure [dbo].[prcGetRoutes] Script Date: 04/19/2008 09:33:23 ******/ +SET ANSI_NULLS ON +GO +SET QUOTED_IDENTIFIER ON +GO +CREATE PROCEDURE [dbo].[prcGetRoutes] +AS + +SET NOCOUNT ON + +CREATE TABLE #tempRoutes +( + sessionID VARCHAR(25) NULL, + phoneNumber VARCHAR(20) NULL, + startTime DATETIME NULL, + endTime DATETIME NULL +) + +-- get the distinct routes +INSERT #tempRoutes (sessionID, phoneNumber) +SELECT DISTINCT sessionID, phoneNumber +FROM gpslocations + +-- get the route start times +UPDATE #tempRoutes +SET startTime = (SELECT MIN(gpsTime) FROM gpslocations gl +WHERE gl.sessionID = tr.sessionID +AND gl.phoneNumber = tr.phoneNumber) +FROM #tempRoutes tr + +-- get the route end times +UPDATE #tempRoutes +SET endTime = (SELECT MAX(gpsTime) FROM gpslocations gl +WHERE gl.sessionID = tr.sessionID +AND gl.phoneNumber = tr.phoneNumber) +FROM #tempRoutes tr + +-- format dates and then send it out as xml + +SELECT sessionID '@sessionID', +phoneNumber '@phoneNumber', +'(' + CONVERT(VARCHAR(25), startTime, 100) ++ ' - ' + +CONVERT(VARCHAR(25), endTime, 100) + ')' '@times' +FROM #tempRoutes +ORDER BY phoneNumber +FOR XML PATH('route'), ROOT('routes') + +DROP TABLE #tempRoutes +GO +/****** Object: StoredProcedure [dbo].[prcDeleteRoute] Script Date: 04/19/2008 09:33:23 ******/ +SET ANSI_NULLS ON +GO +SET QUOTED_IDENTIFIER ON +GO +CREATE PROCEDURE [dbo].[prcDeleteRoute] +@sessionID VARCHAR(20), +@phoneNumber VARCHAR(25) +AS + +SET NOCOUNT ON + +DELETE FROM gpslocations +WHERE sessionID = @sessionID +AND phoneNumber = @phoneNumber +GO +/****** Object: StoredProcedure [dbo].[prcGetRouteForMap] Script Date: 04/19/2008 09:33:23 ******/ +SET ANSI_NULLS ON +GO +SET QUOTED_IDENTIFIER ON +GO +CREATE PROCEDURE [dbo].[prcGetRouteForMap] +@sessionID VARCHAR(20), +@phoneNumber VARCHAR(25) +AS + +SET NOCOUNT ON + + SELECT latitude '@latitude', longitude '@longitude', + speed '@speed', direction '@direction', distance '@distance', + locationMethod '@locationMethod', CONVERT(VARCHAR(25), gpsTime, 100) '@gpsTime', + phoneNumber '@phoneNumber', sessionID '@sessionID', accuracy '@accuracy', + isLocationValid '@isLocationValid', extraInfo '@extraInfo' + + FROM gpslocations + WHERE sessionID = @sessionID + AND phoneNumber = @phoneNumber + ORDER BY lastupdate + FOR XML PATH('locations'), ROOT('gps') +GO +/****** Object: StoredProcedure [dbo].[prcSaveGpsLocation2] Script Date: 04/19/2008 09:33:23 ******/ +SET ANSI_NULLS ON +GO +SET QUOTED_IDENTIFIER ON +GO +CREATE PROCEDURE [dbo].[prcSaveGpsLocation2] + +@lat VARCHAR(45), +@lng VARCHAR(45), +@mph VARCHAR(45), +@direction VARCHAR(45), +@distance VARCHAR(45), +@date VARCHAR(100), +@locationMethod VARCHAR(100), +@phoneNumber VARCHAR(20), +@sessionID VARCHAR(50), +@accuracy INT, +@locationIsValid VARCHAR(5), +@extraInfo VARCHAR(255) + +AS + +SET NOCOUNT ON + + DECLARE @returnValue INT + SET @returnValue = 0 + + INSERT INTO gpslocations (Latitude, Longitude, speed, direction, distance, gpsTime, locationMethod, + phoneNumber, sessionID, accuracy, isLocationValid, extraInfo) + VALUES (@lat, @lng, @mph, @direction, @distance, @date, @locationMethod, + @phoneNumber, @sessionID, @accuracy, @locationIsValid, @extraInfo) + + SET @returnValue = IDENT_CURRENT('gpslocations') + + IF @returnValue > 0 + SELECT @returnValue + ELSE + SELECT 0 +GO diff --git a/GPSTrackerNet/Database/data.txt b/GPSTrackerNet/Database/data.txt new file mode 100755 index 0000000..a82409e --- /dev/null +++ b/GPSTrackerNet/Database/data.txt @@ -0,0 +1,80 @@ +GPSLocationID|LastUpdate|Latitude|Longitude|phoneNumber|sessionID|speed|direction|distance|gpsTime|LocationMethod|accuracy|isLocationValid|extraInfo +4|2008-04-16 14:59:52.137000000|47.473349|-122.025035|molly|1208372106690|0|0|0|2008-04-16 11:59:51|8|0|false|Invalid Location: Time out, fix unattainable and assist unavailable. +12|2008-04-16 15:09:04.077000000|47.446123|-121.988437|molly|1208372106690|0|139|3|2008-04-16 12:09:03|327681|70|true|Valid Location. +13|2008-04-16 15:10:13.200000000|47.437515|-121.978176|molly|1208372106690|44|141|4|2008-04-16 12:10:11|327681|44|true|Valid Location. +14|2008-04-16 15:11:16.230000000|47.433877|-121.973387|molly|1208372106690|24|138|4|2008-04-16 12:11:14|327681|52|true|Valid Location. +15|2008-04-16 15:12:20.310000000|47.436571|-121.967061|molly|1208372106690|49|57|4|2008-04-16 12:12:19|327681|44|true|Valid Location. +16|2008-04-16 15:13:38.293000000|47.449381|-121.958283|molly|1208372106690|45|24|5|2008-04-16 12:13:34|327681|132|true|Valid Location. +17|2008-04-16 15:14:51.497000000|47.461755|-121.945067|molly|1208372106690|52|35|6|2008-04-16 12:14:51|327681|70|true|Valid Location. +18|2008-04-16 15:15:54.480000000|47.465712|-121.928203|molly|1208372106690|0|70|7|2008-04-16 12:15:53|327681|52|true|Valid Location. +19|2008-04-16 15:17:06.607000000|47.473136|-121.906763|molly|1208372106690|55|62|8|2008-04-16 12:17:06|327681|117|true|Valid Location. +20|2008-04-16 15:18:29.030000000|47.484347|-121.889056|molly|1208372106690|56|46|9|2008-04-16 12:18:27|327681|104|true|Valid Location. +21|2008-04-16 15:19:35.263000000|47.499045|-121.885739|molly|1208372106690|0|8|10|2008-04-16 12:19:33|327681|60|true|Valid Location. +22|2008-04-16 15:20:37.217000000|47.508517|-121.880395|molly|1208372106690|51|20|11|2008-04-16 12:20:35|327681|91|true|Valid Location. +23|2008-04-16 15:21:37.810000000|47.510901|-121.857973|molly|1208372106690|69|81|12|2008-04-16 12:21:35|327681|52|true|Valid Location. +24|2008-04-16 15:22:55.827000000|47.508485|-121.829131|molly|1208372106690|68|97|14|2008-04-16 12:22:55|327681|70|true|Valid Location. +25|2008-04-16 15:24:07.137000000|47.494528|-121.811840|molly|1208372106690|57|140|15|2008-04-16 12:24:06|327681|70|true|Valid Location. +26|2008-04-16 15:25:08.170000000|47.485893|-121.794368|molly|1208372106690|60|126|16|2008-04-16 12:25:07|327681|80|true|Valid Location. +27|2008-04-16 15:26:09.340000000|47.473557|-121.779776|molly|1208372106690|69|141|17|2008-04-16 12:26:08|327681|104|true|Valid Location. +28|2008-04-16 15:27:21.903000000|47.473323|-121.749280|molly|1208372106690|62|90|18|2008-04-16 12:27:21|327681|132|true|Valid Location. +29|2008-04-16 15:28:24.683000000|47.468064|-121.725557|molly|1208372106690|70|108|20|2008-04-16 12:28:24|327681|70|true|Valid Location. +30|2008-04-16 15:29:31.827000000|47.458677|-121.703264|molly|1208372106690|0|121|21|2008-04-16 12:29:30|327681|132|true|Valid Location. +31|2008-04-16 15:30:31.433000000|47.444704|-121.691840|molly|1208372106690|69|151|22|2008-04-16 12:30:30|327681|70|true|Valid Location. +32|2008-04-16 15:31:37.840000000|47.443136|-121.664373|molly|1208372106690|65|94|23|2008-04-16 12:31:36|327681|80|true|Valid Location. +33|2008-04-16 15:32:42.827000000|47.434107|-121.641504|molly|1208372106690|50|120|24|2008-04-16 12:32:41|327681|149|true|Valid Location. +34|2008-04-16 15:33:52.077000000|47.429093|-121.615371|molly|1208372106690|67|105|26|2008-04-16 12:33:50|327681|91|true|Valid Location. +35|2008-04-16 15:34:56.887000000|47.421152|-121.592448|molly|1208372106690|52|117|27|2008-04-16 12:34:56|327681|104|true|Valid Location. +36|2008-04-16 15:35:57.497000000|47.409291|-121.576128|molly|1208372106690|65|137|28|2008-04-16 12:35:57|327681|104|true|Valid Location. +37|2008-04-16 15:37:10.170000000|47.399184|-121.551893|molly|1208372106690|68|121|29|2008-04-16 12:37:08|327681|70|true|Valid Location. +38|2008-04-16 15:38:12.670000000|47.395051|-121.527936|molly|1208372106690|68|104|31|2008-04-16 12:38:11|327681|104|true|Valid Location. +39|2008-04-16 15:39:15.810000000|47.396219|-121.501365|molly|1208372106690|69|86|32|2008-04-16 12:39:13|327681|132|true|Valid Location. +40|2008-04-16 15:40:17.887000000|47.395040|-121.480896|molly|1208372106690|1|94|33|2008-04-16 12:40:17|327681|91|true|Valid Location. +41|2008-04-16 15:41:42.543000000|47.392939|-121.481472|molly|1208372106690|0|190|33|2008-04-16 12:41:42|327681|132|true|Valid Location. +42|2008-04-16 15:43:13.247000000|47.393259|-121.482144|molly|1208372106690|0|304|33|2008-04-16 12:43:12|327681|167|false|Invalid Location: Time out, accuracy unattainable. +43|2008-04-16 15:44:44.653000000|47.394752|-121.480875|molly|1208372106690|18|29|33|2008-04-16 12:44:44|327681|149|true|Valid Location. +44|2008-04-16 15:47:53.717000000|47.397093|-121.492501|molly|1208372106690|68|286|34|2008-04-16 12:47:51|327681|104|true|Valid Location. +45|2008-04-16 15:51:23.247000000|47.413760|-121.589707|molly|1208372106690|0|284|38|2008-04-16 12:51:21|8|0|false|Invalid Location: Time out, fix unattainable and assist unavailable. +46|2008-04-16 15:54:39.623000000|47.433429|-121.640171|molly|1208372106690|54|299|41|2008-04-16 12:54:37|327681|80|true|Valid Location. +47|2008-04-16 15:57:53.920000000|47.458203|-121.702464|molly|1208372106690|0|300|44|2008-04-16 12:57:53|327681|132|true|Valid Location. +48|2008-04-16 16:01:26.560000000|47.474885|-121.777867|molly|1208372106690|0|288|48|2008-04-16 13:01:14|327681|117|true|Valid Location. +49|2008-04-16 16:04:46.153000000|47.488192|-121.794773|molly|1208372106690|0|319|49|2008-04-16 13:04:45|327681|167|false|Invalid Location: Time out, accuracy unattainable. +50|2008-04-16 16:07:52.217000000|47.489733|-121.794005|molly|1208372106690|28|18|49|2008-04-16 13:07:50|327681|91|true|Valid Location. +51|2008-04-16 16:11:01.623000000|47.501344|-121.791584|molly|1208372106690|37|8|50|2008-04-16 13:11:00|327681|44|true|Valid Location. +52|2008-04-16 16:14:34.217000000|47.508368|-121.816128|molly|1208372106690|48|292|52|2008-04-16 13:14:31|327681|70|true|Valid Location. +53|2008-04-16 16:17:36.637000000|47.525760|-121.823083|molly|1208372106690|28|344|53|2008-04-16 13:17:34|327681|44|true|Valid Location. +54|2008-04-16 16:20:59.933000000|47.543280|-121.836917|molly|1208372106690|0|331|54|2008-04-16 13:20:58|327681|91|true|Valid Location. +55|2008-04-16 16:24:25.683000000|47.543163|-121.837067|molly|1208372106690|0|220|54|2008-04-16 13:24:24|327681|70|true|Valid Location. +56|2008-04-16 16:27:28.730000000|47.543131|-121.836789|molly|1208372106690|0|99|54|2008-04-16 13:27:26|327681|117|true|Valid Location. +57|2008-04-16 16:30:43.873000000|47.534421|-121.840096|molly|1208372106690|40|194|55|2008-04-16 13:30:41|327681|149|true|Valid Location. +58|2008-04-16 16:33:56.543000000|47.523504|-121.880160|molly|1208372106690|35|248|57|2008-04-16 13:33:54|327681|70|true|Valid Location. +59|2008-04-16 16:37:25.560000000|47.489925|-121.887755|molly|1208372106690|57|188|59|2008-04-16 13:37:23|327681|209|false|Invalid Location: Time out, accuracy unattainable. +60|2008-04-16 16:40:28.030000000|47.466347|-121.930624|molly|1208372106690|2|230|62|2008-04-16 13:40:27|327681|60|true|Valid Location. +61|2008-04-16 16:43:49.873000000|47.458864|-121.948907|molly|1208372106690|49|238|63|2008-04-16 13:43:48|327681|132|true|Valid Location. +62|2008-04-16 16:45:42.653000000|47.436240|-121.967989|molly|1208372106690|50|209|65|2008-04-16 13:45:42|327681|149|true|Valid Location. +63|2008-04-16 16:47:58.433000000|47.444427|-121.973024|molly|1208372106690|0|337|65|2008-04-16 13:47:56|327681|80|true|Valid Location. +64|2008-04-16 16:50:03.310000000|47.459573|-121.980085|molly|1208372106690|27|342|66|2008-04-16 13:50:02|327681|117|true|Valid Location. +65|2008-04-16 16:52:14.230000000|47.472827|-121.993173|molly|1208372106690|0|326|67|2008-04-16 13:52:13|327681|91|true|Valid Location. +68|2008-04-16 16:59:29.030000000|47.476933|-122.021419|molly|1208372106690|0|34|69|2008-04-16 13:59:28|327681|260|false|Invalid Location: Time out, accuracy unattainable. +69|2008-04-17 13:46:16.747000000|47.473307|-122.024693|206-555-1212|1208454364321|0|0|0|2008-04-17 10:46:15|327681|80|true|Valid Location. +70|2008-04-17 13:48:20.200000000|47.461216|-122.026219|206-555-1212|1208454364321|0|184|0|2008-04-17 10:48:17|327681|70|true|Valid Location. +71|2008-04-17 13:50:33.310000000|47.445077|-122.046645|206-555-1212|1208454364321|36|220|2|2008-04-17 10:50:31|327681|91|true|Valid Location. +72|2008-04-17 13:52:33.467000000|47.438731|-122.066048|206-555-1212|1208454364321|0|244|3|2008-04-17 10:52:33|327681|25|true|Valid Location. +73|2008-04-17 13:54:45.137000000|47.424661|-122.051755|206-555-1212|1208454364321|0|145|4|2008-04-17 10:54:43|327681|80|true|Valid Location. +74|2008-04-17 13:56:49.217000000|47.406597|-122.038752|206-555-1212|1208454364321|25|154|5|2008-04-17 10:56:48|327681|44|true|Valid Location. +75|2008-04-17 13:58:56.247000000|47.394085|-122.049120|206-555-1212|1208454364321|0|209|6|2008-04-17 10:58:55|327681|80|true|Valid Location. +76|2008-04-17 14:01:05.043000000|47.377595|-122.081067|206-555-1212|1208454364321|61|232|8|2008-04-17 11:01:04|327681|104|true|Valid Location. +77|2008-04-17 14:03:05.980000000|47.361323|-122.116469|206-555-1212|1208454364321|59|235|10|2008-04-17 11:03:05|327681|52|true|Valid Location. +78|2008-04-17 14:05:16.373000000|47.358016|-122.115115|206-555-1212|1208454364321|0|164|11|2008-04-17 11:05:15|327681|117|true|Valid Location. +79|2008-04-17 14:07:23.590000000|47.357627|-122.109707|206-555-1212|1208454364321|6|96|11|2008-04-17 11:07:22|327681|60|true|Valid Location. +80|2008-04-17 14:42:29.060000000|47.357115|-122.114773|3b|1208457732980|0|0|0|2008-04-17 11:42:22|327681|70|true|Valid Location. +81|2008-04-17 14:44:32.577000000|47.358101|-122.115307|3b|1208457732980|25|339|0|2008-04-17 11:44:32|327681|70|true|Valid Location. +82|2008-04-17 14:46:44.263000000|47.371355|-122.094517|3b|1208457732980|53|46|1|2008-04-17 11:46:43|327681|52|true|Valid Location. +83|2008-04-17 14:48:44.980000000|47.387616|-122.058048|3b|1208457732980|59|56|3|2008-04-17 11:48:44|327681|52|true|Valid Location. +84|2008-04-17 14:50:46.637000000|47.409472|-122.032917|3b|1208457732980|60|37|5|2008-04-17 11:50:45|327681|80|true|Valid Location. +85|2008-04-17 14:52:55.967000000|47.425824|-121.991819|3b|1208457732980|59|59|7|2008-04-17 11:52:54|327681|44|true|Valid Location. +86|2008-04-17 14:55:22.903000000|47.442251|-121.985579|3b|1208457732980|42|14|8|2008-04-17 11:55:20|327681|60|true|Valid Location. +87|2008-04-17 14:57:27.623000000|47.459232|-122.005856|3b|1208457732980|39|321|10|2008-04-17 11:57:27|327681|132|true|Valid Location. +88|2008-04-17 14:59:34.247000000|47.475531|-122.026176|3b|1208457732980|8|319|11|2008-04-17 11:59:33|327681|80|true|Valid Location. +89|2008-04-17 15:02:05.263000000|47.473349|-122.025035|3b|1208457732980|0|160|11|2008-04-17 12:02:03|8|0|false|Invalid Location: Time out, fix unattainable and assist unavailable. +90|2008-04-17 15:04:34.607000000|47.473349|-122.025035|3b|1208457732980|0|0|11|2008-04-17 12:04:32|8|0|false|Invalid Location: Time out, fix unattainable and assist unavailable. +91|2008-04-17 15:07:03.560000000|47.473349|-122.025035|3b|1208457732980|0|0|11|2008-04-17 12:07:02|8|0|false|Invalid Location: Time out, fix unattainable and assist unavailable. diff --git a/GPSTrackerNet/License.txt b/GPSTrackerNet/License.txt new file mode 100755 index 0000000..818433e --- /dev/null +++ b/GPSTrackerNet/License.txt @@ -0,0 +1,674 @@ + GNU GENERAL PUBLIC LICENSE + Version 3, 29 June 2007 + + Copyright (C) 2007 Free Software Foundation, Inc. + Everyone is permitted to copy and distribute verbatim copies + of this license document, but changing it is not allowed. + + Preamble + + The GNU General Public License is a free, copyleft license for +software and other kinds of works. + + The licenses for most software and other practical works are designed +to take away your freedom to share and change the works. By contrast, +the GNU General Public License is intended to guarantee your freedom to +share and change all versions of a program--to make sure it remains free +software for all its users. We, the Free Software Foundation, use the +GNU General Public License for most of our software; it applies also to +any other work released this way by its authors. You can apply it to +your programs, too. + + When we speak of free software, we are referring to freedom, not +price. Our General Public Licenses are designed to make sure that you +have the freedom to distribute copies of free software (and charge for +them if you wish), that you receive source code or can get it if you +want it, that you can change the software or use pieces of it in new +free programs, and that you know you can do these things. + + To protect your rights, we need to prevent others from denying you +these rights or asking you to surrender the rights. Therefore, you have +certain responsibilities if you distribute copies of the software, or if +you modify it: responsibilities to respect the freedom of others. + + For example, if you distribute copies of such a program, whether +gratis or for a fee, you must pass on to the recipients the same +freedoms that you received. You must make sure that they, too, receive +or can get the source code. And you must show them these terms so they +know their rights. + + Developers that use the GNU GPL protect your rights with two steps: +(1) assert copyright on the software, and (2) offer you this License +giving you legal permission to copy, distribute and/or modify it. + + For the developers' and authors' protection, the GPL clearly explains +that there is no warranty for this free software. For both users' and +authors' sake, the GPL requires that modified versions be marked as +changed, so that their problems will not be attributed erroneously to +authors of previous versions. + + Some devices are designed to deny users access to install or run +modified versions of the software inside them, although the manufacturer +can do so. This is fundamentally incompatible with the aim of +protecting users' freedom to change the software. The systematic +pattern of such abuse occurs in the area of products for individuals to +use, which is precisely where it is most unacceptable. Therefore, we +have designed this version of the GPL to prohibit the practice for those +products. If such problems arise substantially in other domains, we +stand ready to extend this provision to those domains in future versions +of the GPL, as needed to protect the freedom of users. + + Finally, every program is threatened constantly by software patents. +States should not allow patents to restrict development and use of +software on general-purpose computers, but in those that do, we wish to +avoid the special danger that patents applied to a free program could +make it effectively proprietary. To prevent this, the GPL assures that +patents cannot be used to render the program non-free. + + The precise terms and conditions for copying, distribution and +modification follow. + + TERMS AND CONDITIONS + + 0. Definitions. + + "This License" refers to version 3 of the GNU General Public License. + + "Copyright" also means copyright-like laws that apply to other kinds of +works, such as semiconductor masks. + + "The Program" refers to any copyrightable work licensed under this +License. Each licensee is addressed as "you". "Licensees" and +"recipients" may be individuals or organizations. + + To "modify" a work means to copy from or adapt all or part of the work +in a fashion requiring copyright permission, other than the making of an +exact copy. The resulting work is called a "modified version" of the +earlier work or a work "based on" the earlier work. + + A "covered work" means either the unmodified Program or a work based +on the Program. + + To "propagate" a work means to do anything with it that, without +permission, would make you directly or secondarily liable for +infringement under applicable copyright law, except executing it on a +computer or modifying a private copy. Propagation includes copying, +distribution (with or without modification), making available to the +public, and in some countries other activities as well. + + To "convey" a work means any kind of propagation that enables other +parties to make or receive copies. Mere interaction with a user through +a computer network, with no transfer of a copy, is not conveying. + + An interactive user interface displays "Appropriate Legal Notices" +to the extent that it includes a convenient and prominently visible +feature that (1) displays an appropriate copyright notice, and (2) +tells the user that there is no warranty for the work (except to the +extent that warranties are provided), that licensees may convey the +work under this License, and how to view a copy of this License. If +the interface presents a list of user commands or options, such as a +menu, a prominent item in the list meets this criterion. + + 1. Source Code. + + The "source code" for a work means the preferred form of the work +for making modifications to it. "Object code" means any non-source +form of a work. + + A "Standard Interface" means an interface that either is an official +standard defined by a recognized standards body, or, in the case of +interfaces specified for a particular programming language, one that +is widely used among developers working in that language. + + The "System Libraries" of an executable work include anything, other +than the work as a whole, that (a) is included in the normal form of +packaging a Major Component, but which is not part of that Major +Component, and (b) serves only to enable use of the work with that +Major Component, or to implement a Standard Interface for which an +implementation is available to the public in source code form. A +"Major Component", in this context, means a major essential component +(kernel, window system, and so on) of the specific operating system +(if any) on which the executable work runs, or a compiler used to +produce the work, or an object code interpreter used to run it. + + The "Corresponding Source" for a work in object code form means all +the source code needed to generate, install, and (for an executable +work) run the object code and to modify the work, including scripts to +control those activities. However, it does not include the work's +System Libraries, or general-purpose tools or generally available free +programs which are used unmodified in performing those activities but +which are not part of the work. For example, Corresponding Source +includes interface definition files associated with source files for +the work, and the source code for shared libraries and dynamically +linked subprograms that the work is specifically designed to require, +such as by intimate data communication or control flow between those +subprograms and other parts of the work. + + The Corresponding Source need not include anything that users +can regenerate automatically from other parts of the Corresponding +Source. + + The Corresponding Source for a work in source code form is that +same work. + + 2. Basic Permissions. + + All rights granted under this License are granted for the term of +copyright on the Program, and are irrevocable provided the stated +conditions are met. This License explicitly affirms your unlimited +permission to run the unmodified Program. The output from running a +covered work is covered by this License only if the output, given its +content, constitutes a covered work. This License acknowledges your +rights of fair use or other equivalent, as provided by copyright law. + + You may make, run and propagate covered works that you do not +convey, without conditions so long as your license otherwise remains +in force. You may convey covered works to others for the sole purpose +of having them make modifications exclusively for you, or provide you +with facilities for running those works, provided that you comply with +the terms of this License in conveying all material for which you do +not control copyright. Those thus making or running the covered works +for you must do so exclusively on your behalf, under your direction +and control, on terms that prohibit them from making any copies of +your copyrighted material outside their relationship with you. + + Conveying under any other circumstances is permitted solely under +the conditions stated below. Sublicensing is not allowed; section 10 +makes it unnecessary. + + 3. Protecting Users' Legal Rights From Anti-Circumvention Law. + + No covered work shall be deemed part of an effective technological +measure under any applicable law fulfilling obligations under article +11 of the WIPO copyright treaty adopted on 20 December 1996, or +similar laws prohibiting or restricting circumvention of such +measures. + + When you convey a covered work, you waive any legal power to forbid +circumvention of technological measures to the extent such circumvention +is effected by exercising rights under this License with respect to +the covered work, and you disclaim any intention to limit operation or +modification of the work as a means of enforcing, against the work's +users, your or third parties' legal rights to forbid circumvention of +technological measures. + + 4. Conveying Verbatim Copies. + + You may convey verbatim copies of the Program's source code as you +receive it, in any medium, provided that you conspicuously and +appropriately publish on each copy an appropriate copyright notice; +keep intact all notices stating that this License and any +non-permissive terms added in accord with section 7 apply to the code; +keep intact all notices of the absence of any warranty; and give all +recipients a copy of this License along with the Program. + + You may charge any price or no price for each copy that you convey, +and you may offer support or warranty protection for a fee. + + 5. Conveying Modified Source Versions. + + You may convey a work based on the Program, or the modifications to +produce it from the Program, in the form of source code under the +terms of section 4, provided that you also meet all of these conditions: + + a) The work must carry prominent notices stating that you modified + it, and giving a relevant date. + + b) The work must carry prominent notices stating that it is + released under this License and any conditions added under section + 7. This requirement modifies the requirement in section 4 to + "keep intact all notices". + + c) You must license the entire work, as a whole, under this + License to anyone who comes into possession of a copy. This + License will therefore apply, along with any applicable section 7 + additional terms, to the whole of the work, and all its parts, + regardless of how they are packaged. This License gives no + permission to license the work in any other way, but it does not + invalidate such permission if you have separately received it. + + d) If the work has interactive user interfaces, each must display + Appropriate Legal Notices; however, if the Program has interactive + interfaces that do not display Appropriate Legal Notices, your + work need not make them do so. + + A compilation of a covered work with other separate and independent +works, which are not by their nature extensions of the covered work, +and which are not combined with it such as to form a larger program, +in or on a volume of a storage or distribution medium, is called an +"aggregate" if the compilation and its resulting copyright are not +used to limit the access or legal rights of the compilation's users +beyond what the individual works permit. Inclusion of a covered work +in an aggregate does not cause this License to apply to the other +parts of the aggregate. + + 6. Conveying Non-Source Forms. + + You may convey a covered work in object code form under the terms +of sections 4 and 5, provided that you also convey the +machine-readable Corresponding Source under the terms of this License, +in one of these ways: + + a) Convey the object code in, or embodied in, a physical product + (including a physical distribution medium), accompanied by the + Corresponding Source fixed on a durable physical medium + customarily used for software interchange. + + b) Convey the object code in, or embodied in, a physical product + (including a physical distribution medium), accompanied by a + written offer, valid for at least three years and valid for as + long as you offer spare parts or customer support for that product + model, to give anyone who possesses the object code either (1) a + copy of the Corresponding Source for all the software in the + product that is covered by this License, on a durable physical + medium customarily used for software interchange, for a price no + more than your reasonable cost of physically performing this + conveying of source, or (2) access to copy the + Corresponding Source from a network server at no charge. + + c) Convey individual copies of the object code with a copy of the + written offer to provide the Corresponding Source. This + alternative is allowed only occasionally and noncommercially, and + only if you received the object code with such an offer, in accord + with subsection 6b. + + d) Convey the object code by offering access from a designated + place (gratis or for a charge), and offer equivalent access to the + Corresponding Source in the same way through the same place at no + further charge. You need not require recipients to copy the + Corresponding Source along with the object code. If the place to + copy the object code is a network server, the Corresponding Source + may be on a different server (operated by you or a third party) + that supports equivalent copying facilities, provided you maintain + clear directions next to the object code saying where to find the + Corresponding Source. Regardless of what server hosts the + Corresponding Source, you remain obligated to ensure that it is + available for as long as needed to satisfy these requirements. + + e) Convey the object code using peer-to-peer transmission, provided + you inform other peers where the object code and Corresponding + Source of the work are being offered to the general public at no + charge under subsection 6d. + + A separable portion of the object code, whose source code is excluded +from the Corresponding Source as a System Library, need not be +included in conveying the object code work. + + A "User Product" is either (1) a "consumer product", which means any +tangible personal property which is normally used for personal, family, +or household purposes, or (2) anything designed or sold for incorporation +into a dwelling. In determining whether a product is a consumer product, +doubtful cases shall be resolved in favor of coverage. For a particular +product received by a particular user, "normally used" refers to a +typical or common use of that class of product, regardless of the status +of the particular user or of the way in which the particular user +actually uses, or expects or is expected to use, the product. A product +is a consumer product regardless of whether the product has substantial +commercial, industrial or non-consumer uses, unless such uses represent +the only significant mode of use of the product. + + "Installation Information" for a User Product means any methods, +procedures, authorization keys, or other information required to install +and execute modified versions of a covered work in that User Product from +a modified version of its Corresponding Source. The information must +suffice to ensure that the continued functioning of the modified object +code is in no case prevented or interfered with solely because +modification has been made. + + If you convey an object code work under this section in, or with, or +specifically for use in, a User Product, and the conveying occurs as +part of a transaction in which the right of possession and use of the +User Product is transferred to the recipient in perpetuity or for a +fixed term (regardless of how the transaction is characterized), the +Corresponding Source conveyed under this section must be accompanied +by the Installation Information. But this requirement does not apply +if neither you nor any third party retains the ability to install +modified object code on the User Product (for example, the work has +been installed in ROM). + + The requirement to provide Installation Information does not include a +requirement to continue to provide support service, warranty, or updates +for a work that has been modified or installed by the recipient, or for +the User Product in which it has been modified or installed. Access to a +network may be denied when the modification itself materially and +adversely affects the operation of the network or violates the rules and +protocols for communication across the network. + + Corresponding Source conveyed, and Installation Information provided, +in accord with this section must be in a format that is publicly +documented (and with an implementation available to the public in +source code form), and must require no special password or key for +unpacking, reading or copying. + + 7. Additional Terms. + + "Additional permissions" are terms that supplement the terms of this +License by making exceptions from one or more of its conditions. +Additional permissions that are applicable to the entire Program shall +be treated as though they were included in this License, to the extent +that they are valid under applicable law. If additional permissions +apply only to part of the Program, that part may be used separately +under those permissions, but the entire Program remains governed by +this License without regard to the additional permissions. + + When you convey a copy of a covered work, you may at your option +remove any additional permissions from that copy, or from any part of +it. (Additional permissions may be written to require their own +removal in certain cases when you modify the work.) You may place +additional permissions on material, added by you to a covered work, +for which you have or can give appropriate copyright permission. + + Notwithstanding any other provision of this License, for material you +add to a covered work, you may (if authorized by the copyright holders of +that material) supplement the terms of this License with terms: + + a) Disclaiming warranty or limiting liability differently from the + terms of sections 15 and 16 of this License; or + + b) Requiring preservation of specified reasonable legal notices or + author attributions in that material or in the Appropriate Legal + Notices displayed by works containing it; or + + c) Prohibiting misrepresentation of the origin of that material, or + requiring that modified versions of such material be marked in + reasonable ways as different from the original version; or + + d) Limiting the use for publicity purposes of names of licensors or + authors of the material; or + + e) Declining to grant rights under trademark law for use of some + trade names, trademarks, or service marks; or + + f) Requiring indemnification of licensors and authors of that + material by anyone who conveys the material (or modified versions of + it) with contractual assumptions of liability to the recipient, for + any liability that these contractual assumptions directly impose on + those licensors and authors. + + All other non-permissive additional terms are considered "further +restrictions" within the meaning of section 10. If the Program as you +received it, or any part of it, contains a notice stating that it is +governed by this License along with a term that is a further +restriction, you may remove that term. If a license document contains +a further restriction but permits relicensing or conveying under this +License, you may add to a covered work material governed by the terms +of that license document, provided that the further restriction does +not survive such relicensing or conveying. + + If you add terms to a covered work in accord with this section, you +must place, in the relevant source files, a statement of the +additional terms that apply to those files, or a notice indicating +where to find the applicable terms. + + Additional terms, permissive or non-permissive, may be stated in the +form of a separately written license, or stated as exceptions; +the above requirements apply either way. + + 8. Termination. + + You may not propagate or modify a covered work except as expressly +provided under this License. Any attempt otherwise to propagate or +modify it is void, and will automatically terminate your rights under +this License (including any patent licenses granted under the third +paragraph of section 11). + + However, if you cease all violation of this License, then your +license from a particular copyright holder is reinstated (a) +provisionally, unless and until the copyright holder explicitly and +finally terminates your license, and (b) permanently, if the copyright +holder fails to notify you of the violation by some reasonable means +prior to 60 days after the cessation. + + Moreover, your license from a particular copyright holder is +reinstated permanently if the copyright holder notifies you of the +violation by some reasonable means, this is the first time you have +received notice of violation of this License (for any work) from that +copyright holder, and you cure the violation prior to 30 days after +your receipt of the notice. + + Termination of your rights under this section does not terminate the +licenses of parties who have received copies or rights from you under +this License. If your rights have been terminated and not permanently +reinstated, you do not qualify to receive new licenses for the same +material under section 10. + + 9. Acceptance Not Required for Having Copies. + + You are not required to accept this License in order to receive or +run a copy of the Program. Ancillary propagation of a covered work +occurring solely as a consequence of using peer-to-peer transmission +to receive a copy likewise does not require acceptance. However, +nothing other than this License grants you permission to propagate or +modify any covered work. These actions infringe copyright if you do +not accept this License. Therefore, by modifying or propagating a +covered work, you indicate your acceptance of this License to do so. + + 10. Automatic Licensing of Downstream Recipients. + + Each time you convey a covered work, the recipient automatically +receives a license from the original licensors, to run, modify and +propagate that work, subject to this License. You are not responsible +for enforcing compliance by third parties with this License. + + An "entity transaction" is a transaction transferring control of an +organization, or substantially all assets of one, or subdividing an +organization, or merging organizations. If propagation of a covered +work results from an entity transaction, each party to that +transaction who receives a copy of the work also receives whatever +licenses to the work the party's predecessor in interest had or could +give under the previous paragraph, plus a right to possession of the +Corresponding Source of the work from the predecessor in interest, if +the predecessor has it or can get it with reasonable efforts. + + You may not impose any further restrictions on the exercise of the +rights granted or affirmed under this License. For example, you may +not impose a license fee, royalty, or other charge for exercise of +rights granted under this License, and you may not initiate litigation +(including a cross-claim or counterclaim in a lawsuit) alleging that +any patent claim is infringed by making, using, selling, offering for +sale, or importing the Program or any portion of it. + + 11. Patents. + + A "contributor" is a copyright holder who authorizes use under this +License of the Program or a work on which the Program is based. The +work thus licensed is called the contributor's "contributor version". + + A contributor's "essential patent claims" are all patent claims +owned or controlled by the contributor, whether already acquired or +hereafter acquired, that would be infringed by some manner, permitted +by this License, of making, using, or selling its contributor version, +but do not include claims that would be infringed only as a +consequence of further modification of the contributor version. For +purposes of this definition, "control" includes the right to grant +patent sublicenses in a manner consistent with the requirements of +this License. + + Each contributor grants you a non-exclusive, worldwide, royalty-free +patent license under the contributor's essential patent claims, to +make, use, sell, offer for sale, import and otherwise run, modify and +propagate the contents of its contributor version. + + In the following three paragraphs, a "patent license" is any express +agreement or commitment, however denominated, not to enforce a patent +(such as an express permission to practice a patent or covenant not to +sue for patent infringement). To "grant" such a patent license to a +party means to make such an agreement or commitment not to enforce a +patent against the party. + + If you convey a covered work, knowingly relying on a patent license, +and the Corresponding Source of the work is not available for anyone +to copy, free of charge and under the terms of this License, through a +publicly available network server or other readily accessible means, +then you must either (1) cause the Corresponding Source to be so +available, or (2) arrange to deprive yourself of the benefit of the +patent license for this particular work, or (3) arrange, in a manner +consistent with the requirements of this License, to extend the patent +license to downstream recipients. "Knowingly relying" means you have +actual knowledge that, but for the patent license, your conveying the +covered work in a country, or your recipient's use of the covered work +in a country, would infringe one or more identifiable patents in that +country that you have reason to believe are valid. + + If, pursuant to or in connection with a single transaction or +arrangement, you convey, or propagate by procuring conveyance of, a +covered work, and grant a patent license to some of the parties +receiving the covered work authorizing them to use, propagate, modify +or convey a specific copy of the covered work, then the patent license +you grant is automatically extended to all recipients of the covered +work and works based on it. + + A patent license is "discriminatory" if it does not include within +the scope of its coverage, prohibits the exercise of, or is +conditioned on the non-exercise of one or more of the rights that are +specifically granted under this License. You may not convey a covered +work if you are a party to an arrangement with a third party that is +in the business of distributing software, under which you make payment +to the third party based on the extent of your activity of conveying +the work, and under which the third party grants, to any of the +parties who would receive the covered work from you, a discriminatory +patent license (a) in connection with copies of the covered work +conveyed by you (or copies made from those copies), or (b) primarily +for and in connection with specific products or compilations that +contain the covered work, unless you entered into that arrangement, +or that patent license was granted, prior to 28 March 2007. + + Nothing in this License shall be construed as excluding or limiting +any implied license or other defenses to infringement that may +otherwise be available to you under applicable patent law. + + 12. No Surrender of Others' Freedom. + + If conditions are imposed on you (whether by court order, agreement or +otherwise) that contradict the conditions of this License, they do not +excuse you from the conditions of this License. If you cannot convey a +covered work so as to satisfy simultaneously your obligations under this +License and any other pertinent obligations, then as a consequence you may +not convey it at all. For example, if you agree to terms that obligate you +to collect a royalty for further conveying from those to whom you convey +the Program, the only way you could satisfy both those terms and this +License would be to refrain entirely from conveying the Program. + + 13. Use with the GNU Affero General Public License. + + Notwithstanding any other provision of this License, you have +permission to link or combine any covered work with a work licensed +under version 3 of the GNU Affero General Public License into a single +combined work, and to convey the resulting work. The terms of this +License will continue to apply to the part which is the covered work, +but the special requirements of the GNU Affero General Public License, +section 13, concerning interaction through a network will apply to the +combination as such. + + 14. Revised Versions of this License. + + The Free Software Foundation may publish revised and/or new versions of +the GNU General Public License from time to time. Such new versions will +be similar in spirit to the present version, but may differ in detail to +address new problems or concerns. + + Each version is given a distinguishing version number. If the +Program specifies that a certain numbered version of the GNU General +Public License "or any later version" applies to it, you have the +option of following the terms and conditions either of that numbered +version or of any later version published by the Free Software +Foundation. If the Program does not specify a version number of the +GNU General Public License, you may choose any version ever published +by the Free Software Foundation. + + If the Program specifies that a proxy can decide which future +versions of the GNU General Public License can be used, that proxy's +public statement of acceptance of a version permanently authorizes you +to choose that version for the Program. + + Later license versions may give you additional or different +permissions. However, no additional obligations are imposed on any +author or copyright holder as a result of your choosing to follow a +later version. + + 15. Disclaimer of Warranty. + + THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY +APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT +HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY +OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, +THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR +PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM +IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF +ALL NECESSARY SERVICING, REPAIR OR CORRECTION. + + 16. Limitation of Liability. + + IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING +WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS +THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY +GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE +USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF +DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD +PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS), +EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF +SUCH DAMAGES. + + 17. Interpretation of Sections 15 and 16. + + If the disclaimer of warranty and limitation of liability provided +above cannot be given local legal effect according to their terms, +reviewing courts shall apply local law that most closely approximates +an absolute waiver of all civil liability in connection with the +Program, unless a warranty or assumption of liability accompanies a +copy of the Program in return for a fee. + + END OF TERMS AND CONDITIONS + + How to Apply These Terms to Your New Programs + + If you develop a new program, and you want it to be of the greatest +possible use to the public, the best way to achieve this is to make it +free software which everyone can redistribute and change under these terms. + + To do so, attach the following notices to the program. It is safest +to attach them to the start of each source file to most effectively +state the exclusion of warranty; and each file should have at least +the "copyright" line and a pointer to where the full notice is found. + + + Copyright (C) + + This program is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see . + +Also add information on how to contact you by electronic and paper mail. + + If the program does terminal interaction, make it output a short +notice like this when it starts in an interactive mode: + + Copyright (C) + This program comes with ABSOLUTELY NO WARRANTY; for details type `show w'. + This is free software, and you are welcome to redistribute it + under certain conditions; type `show c' for details. + +The hypothetical commands `show w' and `show c' should show the appropriate +parts of the General Public License. Of course, your program's commands +might be different; for a GUI interface, you would use an "about box". + + You should also get your employer (if you work as a programmer) or school, +if any, to sign a "copyright disclaimer" for the program, if necessary. +For more information on this, and how to apply and follow the GNU GPL, see +. + + The GNU General Public License does not permit incorporating your program +into proprietary programs. If your program is a subroutine library, you +may consider it more useful to permit linking proprietary applications with +the library. If this is what you want to do, use the GNU Lesser General +Public License instead of this License. But first, please read +. diff --git a/GPSTrackerNet/Phone/GPSTracker2.0/build.xml b/GPSTrackerNet/Phone/GPSTracker2.0/build.xml new file mode 100755 index 0000000..16d19d5 --- /dev/null +++ b/GPSTrackerNet/Phone/GPSTracker2.0/build.xml @@ -0,0 +1,83 @@ + + + + + + Builds, tests, and runs the project . + + + diff --git a/GPSTrackerNet/Phone/GPSTracker2.0/build/.timestamp b/GPSTrackerNet/Phone/GPSTracker2.0/build/.timestamp new file mode 100755 index 0000000..999b584 --- /dev/null +++ b/GPSTrackerNet/Phone/GPSTracker2.0/build/.timestamp @@ -0,0 +1 @@ +ignore me \ No newline at end of file diff --git a/GPSTrackerNet/Phone/GPSTracker2.0/build/compiled/gps32.png b/GPSTrackerNet/Phone/GPSTracker2.0/build/compiled/gps32.png new file mode 100755 index 0000000..68dcc1b --- /dev/null +++ b/GPSTrackerNet/Phone/GPSTracker2.0/build/compiled/gps32.png Binary files differ diff --git a/GPSTrackerNet/Phone/GPSTracker2.0/build/manifest.mf b/GPSTrackerNet/Phone/GPSTracker2.0/build/manifest.mf new file mode 100755 index 0000000..aef0378 --- /dev/null +++ b/GPSTrackerNet/Phone/GPSTracker2.0/build/manifest.mf @@ -0,0 +1,9 @@ +MIDlet-1: GPSTracker,/res/gps32.png,GPSTracker +MIDlet-Permissions: javax.microedition.io.Connector.http, javax.microedition.location.Location +MIDlet-Vendor: Websmithing +MIDlet-Info-URL: www.websmithing.com +MIDlet-Name: GPSTracker2.0 +MIDlet-Icon: /res/gps32.png +MIDlet-Version: 2.0 +MicroEdition-Configuration: CLDC-1.1 +MicroEdition-Profile: MIDP-2.0 diff --git a/GPSTrackerNet/Phone/GPSTracker2.0/build/obfuscated/META-INF/MANIFEST.MF b/GPSTrackerNet/Phone/GPSTracker2.0/build/obfuscated/META-INF/MANIFEST.MF new file mode 100755 index 0000000..24ff3cc --- /dev/null +++ b/GPSTrackerNet/Phone/GPSTracker2.0/build/obfuscated/META-INF/MANIFEST.MF @@ -0,0 +1,4 @@ +Manifest-Version: 1.0 +Ant-Version: Apache Ant 1.7.0 +Created-By: 1.6.0_01-b06 (Sun Microsystems Inc.) + diff --git a/GPSTrackerNet/Phone/GPSTracker2.0/build/obfuscated/gps32.png b/GPSTrackerNet/Phone/GPSTracker2.0/build/obfuscated/gps32.png new file mode 100755 index 0000000..68dcc1b --- /dev/null +++ b/GPSTrackerNet/Phone/GPSTracker2.0/build/obfuscated/gps32.png Binary files differ diff --git a/GPSTrackerNet/Phone/GPSTracker2.0/build/preprocessed/GPS.java b/GPSTrackerNet/Phone/GPSTracker2.0/build/preprocessed/GPS.java new file mode 100755 index 0000000..776a420 --- /dev/null +++ b/GPSTrackerNet/Phone/GPSTracker2.0/build/preprocessed/GPS.java @@ -0,0 +1,156 @@ +// Please leave the link below with the source code, thank you. +// http://www.websmithing.com/portal/Programming/tabid/55/articleType/ArticleView/articleId/6/Google-Map-GPS-Cell-Phone-Tracker-Version-2.aspx + +import javax.microedition.location.*; +import java.util.Calendar; +import java.util.Date; + +public class GPS implements LocationListener { + + private LocationProvider locationProvider = null; + private Coordinates oldCoordinates = null, currentCoordinates = null; + private float distance = 0; + private int azimuth = 0; + private String uploadWebsite; + private String queryString; + private GPSTracker midlet; + private int interval; + protected Calendar currentTime; + protected long sessionID; + + + public GPS(GPSTracker Midlet, int Interval, String UploadWebsite){ + currentTime = Calendar.getInstance(); + sessionID = System.currentTimeMillis(); + this.midlet = Midlet; + this.interval = Interval; + this.uploadWebsite = UploadWebsite; + } + + // getting the gps location is based on an interval in seconds. for instance, + // the location is gotten once a minute, sent to the website to be stored in + // the DB (and then viewed on Google map) and used to retrieve a map tile (image) + // to be diplayed on the phone + + public void startGPS() { + if (locationProvider == null) { + createLocationProvider(); + + Thread locationThread = new Thread() { + public void run(){ + createLocationListener(); + } + }; + locationThread.start(); + } + } + + // this allows us to change how often the gps location is gotten + public void changeInterval(int Interval) { + if (locationProvider != null) { + locationProvider.setLocationListener(this, Interval, -1, -1); + } + } + + private void createLocationProvider() { + Criteria cr = new Criteria(); + + try { + locationProvider = LocationProvider.getInstance(cr); + } catch (Exception e) { + midlet.log("GPS.createLocationProvider: " + e); + } + } + + private void createLocationListener(){ + // 2cd value is interval in seconds + try { + locationProvider.setLocationListener(this, interval, -1, -1); + } catch (Exception e) { + midlet.log("GPS.createLocationListener: " + e); + } + } + + public void locationUpdated(LocationProvider provider, final Location location) { + // get new location from locationProvider + + try { + Thread getLocationThread = new Thread(){ + public void run(){ + getLocation(location); + } + }; + + getLocationThread.start(); + } catch (Exception e) { + midlet.log("GPS.locationUpdated: " + e); + } + } + + public void providerStateChanged(LocationProvider provider, int newState) {} + + private void getLocation(Location location){ + float speed = 0; + + try { + QualifiedCoordinates qualifiedCoordinates = location.getQualifiedCoordinates(); + + qualifiedCoordinates.getLatitude(); + + if (oldCoordinates == null){ + oldCoordinates = new Coordinates(qualifiedCoordinates.getLatitude(), + qualifiedCoordinates.getLongitude(), + qualifiedCoordinates.getAltitude()); + } else { + if (!Float.isNaN( qualifiedCoordinates.distance(oldCoordinates))) { + distance += qualifiedCoordinates.distance(oldCoordinates); + } + + currentCoordinates = new Coordinates(qualifiedCoordinates.getLatitude(), + qualifiedCoordinates.getLongitude(), + qualifiedCoordinates.getAltitude()); + azimuth = (int)oldCoordinates.azimuthTo(currentCoordinates); + oldCoordinates.setAltitude(qualifiedCoordinates.getAltitude()); + oldCoordinates.setLatitude(qualifiedCoordinates.getLatitude()); + oldCoordinates.setLongitude(qualifiedCoordinates.getLongitude()); + + } + + if (qualifiedCoordinates != null){ + Date d = new Date(); + + if (!Float.isNaN(location.getSpeed())) { + speed = location.getSpeed(); + } + + queryString = "?lat=" + String.valueOf(qualifiedCoordinates.getLatitude()) + + "&lng=" + String.valueOf(qualifiedCoordinates.getLongitude()) + + "&mph=" + String.valueOf((int)(speed/1609*3600)) + + "&dir=" + String.valueOf(azimuth) + + "&dis=" + String.valueOf((int)(distance/1609)) + + "&dt=" + d.toString() + + "&lm=" + location.getLocationMethod() + + "&pn=" + midlet.phoneNumber + + "&sid=" + String.valueOf(sessionID) + + "&acc=" + String.valueOf((int)(qualifiedCoordinates.getHorizontalAccuracy()*3.28)) + + "&iv=" + String.valueOf(location.isValid()) + + "&info=" + location.getExtraInfo("text/plain") + + "&zm=" + midlet.zoomLevel + + "&h=" + midlet.height + + "&w=" + midlet.width; + + // with our query string built, we create a networker object to send the + // query to our website and get the map image and update the DB + NetWorker worker = new NetWorker(midlet, uploadWebsite); + worker.getUrl(queryString); + + } + + } catch (Exception e) { + midlet.log("GPS.getLocation: " + e); + } + } +} + + + diff --git a/GPSTrackerNet/Phone/GPSTracker2.0/build/preprocessed/GPSTracker.java b/GPSTrackerNet/Phone/GPSTracker2.0/build/preprocessed/GPSTracker.java new file mode 100755 index 0000000..f81c350 --- /dev/null +++ b/GPSTrackerNet/Phone/GPSTracker2.0/build/preprocessed/GPSTracker.java @@ -0,0 +1,279 @@ +// Please leave the link below with the source code, thank you. +// http://www.websmithing.com/portal/Programming/tabid/55/articleType/ArticleView/articleId/6/Google-Map-GPS-Cell-Phone-Tracker-Version-2.aspx + +import javax.microedition.midlet.*; +import javax.microedition.lcdui.*; +import javax.microedition.location.*; +import java.util.Calendar; + +public class GPSTracker extends MIDlet implements CommandListener, ItemStateListener { + private Display display; + private Form form; + private Form zoomScreen; + private Form settingsScreen; + private Command exitCmd; + private Command saveCmd; + private Command zoomCmd; + private Command settingsCmd; + private Command backCmd; + private TextField phoneNumberTextField; + private TextField uploadWebsiteTextField; + private Gauge zoomGauge; + private StringItem zoomStringItem; + private ChoiceGroup updateIntervalCG; + private String updateInterval; + private int[] iTimes = {60, 120, 180, 300, 600}; + + private RMS rms; + private GPS gps; + + private String uploadWebsite; + private String defaultUploadWebsite = "http://www.websmithing.com/gpstracker/GetGoogleMap2.aspx"; + + protected String phoneNumber; + protected String zoomLevel; + protected int height, width; + protected Calendar currentTime; + protected long sessionID; + protected Image im = null; + + public GPSTracker(){ + form = new Form("GPSTracker2.0"); + display = Display.getDisplay(this); + exitCmd = new Command("Exit", Command.EXIT, 1); + zoomCmd = new Command("Zoom", Command.SCREEN, 2); + settingsCmd = new Command("Settings", Command.SCREEN, 3); + + form.addCommand(exitCmd); + form.addCommand(zoomCmd); + form.addCommand(settingsCmd); + form.setCommandListener(this); + + display.setCurrent(form); + currentTime = Calendar.getInstance(); + sessionID = System.currentTimeMillis(); + height = form.getHeight(); + width = form.getWidth(); + + // RMS is the phone's built in storage, kind of like a database, but + // it only stores name-value pairs (like an associative array or hashtable). + // eveything is stored as a string. + getSettingsFromRMS(); + + // the phone number field is the only empty field when the application is + // first loaded. it does not have to be a phone number, it can be any string, + // but for uniqueness, it's best to use a phone number. this only has to be + // done once. + if (hasPhoneNumber()) { + startGPS(); + displayInterval(); + } + } + + public void startApp() { + if ( form != null ) { + display.setCurrent(form); + } + } + + // let the user know how often map will be updated + private void displayInterval() { + int tempTime = iTimes[Integer.parseInt(updateInterval)]/60; + + display.setCurrent(form); + form.deleteAll(); + + if (tempTime == 1) { + log("Getting map once a minute..."); + } + else { + log("Getting map every " + String.valueOf(tempTime) + " minutes..."); + } + } + + private void loadZoomScreen() { + zoomScreen = new Form("Zoom"); + zoomGauge = new Gauge("Google Map Zoom", true, 17, Integer.parseInt(zoomLevel)); + zoomStringItem = new StringItem(null, ""); + zoomStringItem.setText("Zoom level: " + zoomGauge.getValue()); + backCmd = new Command("Back", Command.SCREEN, 1); + + zoomScreen.append(zoomGauge); + zoomScreen.append(zoomStringItem); + zoomScreen.addCommand(backCmd); + zoomScreen.setItemStateListener(this); + zoomScreen.setCommandListener(this); + + display.setCurrent(zoomScreen); + } + + // this method is called every time the zoom guage changes value. the zoom level is + // reset and saved + public void itemStateChanged(Item item) { + if (item == zoomGauge) { + zoomStringItem.setText("Zoom level: " + zoomGauge.getValue()); + zoomLevel = String.valueOf(zoomGauge.getValue()); + + try { + rms.put("zoomLevel", zoomLevel); + rms.save(); + } + catch (Exception e) { + log("GPSTracker.itemStateChanged: " + e); + } + } + } + + private void loadSettingsScreen() { + settingsScreen = new Form("Settings"); + + phoneNumberTextField = new TextField("Phone number or user name", phoneNumber, 20, TextField.ANY); + uploadWebsiteTextField = new TextField("Upload website", uploadWebsite, 100, TextField.ANY); + settingsScreen.append(phoneNumberTextField); + settingsScreen.append(uploadWebsiteTextField); + + String[] times = { "1 minute", "2 minutes", "3 minutes", "5 minutes", "10 minutes"}; + updateIntervalCG = new ChoiceGroup("Update map how often?", ChoiceGroup.EXCLUSIVE, times, null); + updateIntervalCG.setSelectedIndex(Integer.parseInt(updateInterval), true); + settingsScreen.append(updateIntervalCG); + + saveCmd = new Command("Save", Command.SCREEN, 1); + settingsScreen.addCommand(saveCmd); + + settingsScreen.setCommandListener(this); + display.setCurrent(settingsScreen); + } + + // get the settings from the phone's storage and load 4 global variables + public void getSettingsFromRMS() { + try { + rms = new RMS(this, "GPSTracker"); + + phoneNumber = rms.get("phoneNumber"); + uploadWebsite = rms.get("uploadWebsite"); + zoomLevel = rms.get("zoomLevel"); + updateInterval = rms.get("updateInterval"); + } + catch (Exception e) { + log("GPSTracker.getSettingsFromRMS: " + e); + } + + if ((uploadWebsite == null) || (uploadWebsite.trim().length() == 0)) { + uploadWebsite = defaultUploadWebsite; + } + + if ((zoomLevel == null) || (zoomLevel.trim().length() == 0)) { + zoomLevel = "12"; + } + if ((updateInterval == null) || (updateInterval.trim().length() == 0)) { + updateInterval = "1"; + } + } + + private boolean hasPhoneNumber() { + if ((phoneNumber == null) || (phoneNumber.trim().length() == 0)) { + log("Phone number required. Please go to settings."); + return false; + } + else { + return true; + } + } + + // gps is started with the update interval. the interval is the time in between + // map updates + private void startGPS() { + if (gps == null) { + gps = new GPS(this, iTimes[Integer.parseInt(updateInterval)], uploadWebsite); + gps.startGPS(); + } + } + + // this is called when the user changes the interval in the settings screen + private void changeInterval() { + if (gps == null) { + startGPS(); + } + else { + gps.changeInterval(iTimes[Integer.parseInt(updateInterval)]); + } + } + + // save settings back to phone memory + private void saveSettingsToRMS() { + try { + phoneNumber = phoneNumberTextField.getString(); + uploadWebsite = uploadWebsiteTextField.getString(); + updateInterval = String.valueOf(updateIntervalCG.getSelectedIndex()); + + rms.put("phoneNumber", phoneNumber); + rms.put("uploadWebsite", uploadWebsite); + rms.put("updateInterval", updateInterval); + + rms.save(); + } + catch (Exception e) { + log("GPSTracker.saveSettings: " + e); + } + display.setCurrent(form); + } + + // this method displays the map image, it is called from the networker object + public void showMap(boolean flag) + { + if (flag == false) { + log("Map could not be downloaded."); + } + else { + ImageItem imageitem = new ImageItem(null, im, ImageItem.LAYOUT_DEFAULT, null); + + if(form.size()!= 0) { + form.set(0, imageitem); + } + else { + form.append(imageitem); + } + } + } + + public void log(String text) { + StringItem si = new StringItem(null, text); + si.setLayout(Item.LAYOUT_NEWLINE_AFTER); + form.append(si); + } + + public void commandAction(Command cmd, Displayable screen) { + if (cmd == exitCmd) { + shutDownApp(); + } + else if (cmd == saveCmd) { + saveSettingsToRMS(); + + if (hasPhoneNumber()) { + changeInterval(); + displayInterval(); + } + } + else if (cmd == settingsCmd) { + loadSettingsScreen(); + } + else if (cmd == zoomCmd) { + loadZoomScreen(); + } + else if (cmd == backCmd) { + displayInterval(); + } + } + + public void pauseApp() {} + + public void destroyApp(boolean unconditional) {} + + protected void shutDownApp() { + destroyApp(true); + notifyDestroyed(); + } +} + + + diff --git a/GPSTrackerNet/Phone/GPSTracker2.0/build/preprocessed/NetWorker.java b/GPSTrackerNet/Phone/GPSTracker2.0/build/preprocessed/NetWorker.java new file mode 100755 index 0000000..ebae7f4 --- /dev/null +++ b/GPSTrackerNet/Phone/GPSTracker2.0/build/preprocessed/NetWorker.java @@ -0,0 +1,112 @@ +// Please leave the link below with the source code, thank you. +// http://www.websmithing.com/portal/Programming/tabid/55/articleType/ArticleView/articleId/6/Google-Map-GPS-Cell-Phone-Tracker-Version-2.aspx + +import javax.microedition.io.*; +import java.io.*; +import javax.microedition.lcdui.Image; + +public class NetWorker { + private GPSTracker midlet; + private String uploadWebsite; + int i = 1; + + public NetWorker(GPSTracker lbsMidlet, String UploadWebsite){ + this.midlet = lbsMidlet; + this.uploadWebsite = UploadWebsite; + } + + public void getUrl(String queryString) { + queryString = URLencodeSpaces(queryString); + String url = uploadWebsite + queryString; + HttpConnection httpConn = null; + InputStream inputStream = null; + DataInputStream iStrm = null; + ByteArrayOutputStream bStrm = null; + Image im = null; + + try{ + httpConn = (HttpConnection)Connector.open(url); + + if(httpConn.getResponseCode() == HttpConnection.HTTP_OK){ + inputStream = httpConn.openInputStream(); + iStrm = new DataInputStream(inputStream); + + byte imageData[]; + int length = (int)httpConn.getLength(); + + if(length != -1) { + imageData = new byte[length]; + iStrm.readFully(imageData); + } + else { //Length not available + bStrm = new ByteArrayOutputStream(); + int ch; + + while((ch = iStrm.read())!= -1) { + bStrm.write(ch); + } + imageData = bStrm.toByteArray(); + + } + im = Image.createImage(imageData, 0, imageData.length); + } + else { + midlet.log("NetWorker.getUrl responseCode: " + httpConn.getResponseCode()); + } + + } catch (Exception e) { + midlet.log("NetWorker.getUrl: " + e); + } + finally{ // Clean up + try{ + if(bStrm != null) + bStrm.close(); + if(iStrm != null) + iStrm.close(); + if(inputStream != null) + inputStream.close(); + if(httpConn != null) + httpConn.close(); + } + catch(Exception e){} + } + + // if we have successfully gotten a map image, then we want to display it + if( im == null) { + midlet.showMap(false); + } + else { + midlet.im = im; + midlet.showMap(true); + } + + } + + // http://forum.java.sun.com/thread.jspa?threadID=341790&messageID=1408555 + private String URLencodeSpaces(String s) + { + if (s != null) { + StringBuffer tmp = new StringBuffer(); + int i = 0; + try { + while (true) { + int b = (int)s.charAt(i++); + + if (b != 0x20) { + tmp.append((char)b); + } + else { + tmp.append("%"); + if (b <= 0xf) { + tmp.append("0"); + } + tmp.append(Integer.toHexString(b)); + } + } + } + catch (Exception e) {} + return tmp.toString(); + } + return null; + } +} diff --git a/GPSTrackerNet/Phone/GPSTracker2.0/build/preprocessed/RMS.java b/GPSTrackerNet/Phone/GPSTracker2.0/build/preprocessed/RMS.java new file mode 100755 index 0000000..da626ff --- /dev/null +++ b/GPSTrackerNet/Phone/GPSTracker2.0/build/preprocessed/RMS.java @@ -0,0 +1,79 @@ +// Wireless Java Developing with J2ME, Jonathan Knudsen + +import java.util.*; +import javax.microedition.rms.*; + +public class RMS { + private GPSTracker midlet; + private String mRecordStoreName; + private Hashtable mHashtable; + + public RMS(GPSTracker Midlet, String recordStoreName) throws RecordStoreException { + this.midlet = Midlet; + this.mRecordStoreName = recordStoreName; + this.mHashtable = new Hashtable(); + load(); + } + + public String get(String key) { + return (String)mHashtable.get(key); + } + + public void put(String key, String value) { + if (value == null) value = ""; + mHashtable.put(key, value); + } + + private void load() throws RecordStoreException { + RecordStore rs = null; + RecordEnumeration re = null; + + try { + rs = RecordStore.openRecordStore(mRecordStoreName, true); + re = rs.enumerateRecords(null, null, false); + while (re.hasNextElement()) { + byte[] raw = re.nextRecord(); + String pref = new String(raw); + // Parse out the name. + int index = pref.indexOf('|'); + String name = pref.substring(0, index); + String value = pref.substring(index + 1); + put(name, value); + } + } + finally { + if (re != null) re.destroy(); + if (rs != null) rs.closeRecordStore(); + } + } + + public void save() throws RecordStoreException { + RecordStore rs = null; + RecordEnumeration re = null; + try { + rs = RecordStore.openRecordStore(mRecordStoreName, true); + re = rs.enumerateRecords(null, null, false); + + // First remove all records, a little clumsy. + while (re.hasNextElement()) { + int id = re.nextRecordId(); + rs.deleteRecord(id); + } + + // Now save the preferences records. + Enumeration keys = mHashtable.keys(); + while (keys.hasMoreElements()) { + String key = (String)keys.nextElement(); + String value = get(key); + String pref = key + "|" + value; + byte[] raw = pref.getBytes(); + rs.addRecord(raw, 0, raw.length); + } + } + finally { + if (re != null) re.destroy(); + if (rs != null) rs.closeRecordStore(); + } + } + +} diff --git a/GPSTrackerNet/Phone/GPSTracker2.0/build/preverified/META-INF/MANIFEST.MF b/GPSTrackerNet/Phone/GPSTracker2.0/build/preverified/META-INF/MANIFEST.MF new file mode 100755 index 0000000..24ff3cc --- /dev/null +++ b/GPSTrackerNet/Phone/GPSTracker2.0/build/preverified/META-INF/MANIFEST.MF @@ -0,0 +1,4 @@ +Manifest-Version: 1.0 +Ant-Version: Apache Ant 1.7.0 +Created-By: 1.6.0_01-b06 (Sun Microsystems Inc.) + diff --git a/GPSTrackerNet/Phone/GPSTracker2.0/build/preverified/gps32.png b/GPSTrackerNet/Phone/GPSTracker2.0/build/preverified/gps32.png new file mode 100755 index 0000000..68dcc1b --- /dev/null +++ b/GPSTrackerNet/Phone/GPSTracker2.0/build/preverified/gps32.png Binary files differ diff --git a/GPSTrackerNet/Phone/GPSTracker2.0/dist/GPST2.0.jad b/GPSTrackerNet/Phone/GPSTracker2.0/dist/GPST2.0.jad new file mode 100755 index 0000000..1ccf57c --- /dev/null +++ b/GPSTrackerNet/Phone/GPSTracker2.0/dist/GPST2.0.jad @@ -0,0 +1,11 @@ +MIDlet-1: GPSTracker,/res/gps32.png,GPSTracker +MIDlet-Icon: /res/gps32.png +MIDlet-Info-URL: www.websmithing.com +MIDlet-Jar-Size: 9179 +MIDlet-Jar-URL: GPST2.0.jar +MIDlet-Name: GPSTracker2.0 +MIDlet-Permissions: javax.microedition.io.Connector.http, javax.microedition.location.Location +MIDlet-Vendor: Websmithing +MIDlet-Version: 2.0 +MicroEdition-Configuration: CLDC-1.1 +MicroEdition-Profile: MIDP-2.0 diff --git a/GPSTrackerNet/Phone/GPSTracker2.0/nbproject/build-impl.xml b/GPSTrackerNet/Phone/GPSTracker2.0/nbproject/build-impl.xml new file mode 100755 index 0000000..6fe56bb --- /dev/null +++ b/GPSTrackerNet/Phone/GPSTracker2.0/nbproject/build-impl.xml @@ -0,0 +1,1151 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Classpath to J2ME Ant extension library (libs.j2me_ant_ext.classpath property) is not set. For example: location of mobility/modules/org-netbeans-mobility-antext.jar file in the IDE installation directory. + Platform home (platform.home property) is not set. Value of this property should be ${platform.active.description} emulator home directory location. + Platform boot classpath (platform.bootclasspath property) is not set. Value of this property should be ${platform.active.description} emulator boot classpath containing all J2ME classes provided by emulator. + Must set src.dir + Must set build.dir + Must set dist.dir + Must set dist.jar + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Must set preprocessed.dir + + + + + + + + + + + + + + + + + + Must set build.classes.dir + + + + + + + + + + + + + + + + + + + + + Must select some files in the IDE or set javac.includes + + + + + + + + + + + + + + + + + + + + + + + + + + Must set obfuscated.classes.dir + + + + Must set obfuscated.classes.dir + Must set obfuscator.srcjar + Must set obfuscator.destjar + + + + + + + + + + + + + + + + + + + + Must set preverify.classes.dir + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + MicroEdition-Configuration: ${platform.configuration} + + MicroEdition-Configuration: ${platform.configuration} + + + + MicroEdition-Profile: ${platform.profile} + + MicroEdition-Profile: ${platform.profile} + + + + Must set dist.jad + + + + + + + + + + + + + + + + + + + + + + + + ${manifest.midlets}${evaluated.manifest.apipermissions}${evaluated.manifest.pushregistry}${manifest.others}${manifest.jad} + ${manifest.midlets}${evaluated.manifest.apipermissions}${evaluated.manifest.pushregistry}${manifest.others}${manifest.manifest} + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Must set dist.javadoc.dir + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Property deployment.${deployment.method}.scriptfile not set. The property should point to an Ant script providing ${deployment.method} deployment. + + + + + + + + Classpath to Ant Contrib library (libs.ant-contrib.classpath property) is not set. + + + + + + + + + Active project configuration: @{cfg} + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Property build.root.dir is not set. By default its value should be \"build\". + Property dist.root.dir is not set. By default its value should be \"dist\". + + + + + + + diff --git a/GPSTrackerNet/Phone/GPSTracker2.0/nbproject/genfiles.properties b/GPSTrackerNet/Phone/GPSTracker2.0/nbproject/genfiles.properties new file mode 100755 index 0000000..415f660 --- /dev/null +++ b/GPSTrackerNet/Phone/GPSTracker2.0/nbproject/genfiles.properties @@ -0,0 +1,8 @@ +# This file is used by a NetBeans-based IDE to track changes in generated files such as build-impl.xml. +# Do not edit this file. You may delete it but then the IDE will never regenerate such files for you. +build.xml.data.CRC32=45da0bd0 +build.xml.script.CRC32=0d45f2af +build.xml.stylesheet.CRC32=03eab09b +nbproject/build-impl.xml.data.CRC32=45da0bd0 +nbproject/build-impl.xml.script.CRC32=7ceefb47 +nbproject/build-impl.xml.stylesheet.CRC32=2a2b5990 diff --git a/GPSTrackerNet/Phone/GPSTracker2.0/nbproject/private/private.properties b/GPSTrackerNet/Phone/GPSTracker2.0/nbproject/private/private.properties new file mode 100755 index 0000000..2b716d1 --- /dev/null +++ b/GPSTrackerNet/Phone/GPSTracker2.0/nbproject/private/private.properties @@ -0,0 +1,8 @@ +#Sun Apr 20 18:21:27 PDT 2008 +netbeans.user=C\:\\Documents and Settings\\nick\\.netbeans\\6.0 +javadoc.preview=true +config.active= +deployment.counter=96 +app-version.autoincrement=true +deployment.number=0.0.95 +file.reference.GPSTracker2.0-res=C\:\\Documents and Settings\\nick\\My Documents\\NetBeansProjects\\GPSTracker2.0\\res diff --git a/GPSTrackerNet/Phone/GPSTracker2.0/nbproject/private/private.xml b/GPSTrackerNet/Phone/GPSTracker2.0/nbproject/private/private.xml new file mode 100755 index 0000000..cc2c0e5 --- /dev/null +++ b/GPSTrackerNet/Phone/GPSTracker2.0/nbproject/private/private.xml @@ -0,0 +1,4 @@ + + + + diff --git a/GPSTrackerNet/Phone/GPSTracker2.0/nbproject/project.properties b/GPSTrackerNet/Phone/GPSTracker2.0/nbproject/project.properties new file mode 100755 index 0000000..08d1fed --- /dev/null +++ b/GPSTrackerNet/Phone/GPSTracker2.0/nbproject/project.properties @@ -0,0 +1,142 @@ +abilities=MMAPI=1.1,SATSAJCRMI=1.0,SATSACRYPTO=1.0,JSR82=1.1,JSR226=1.0,MIDP=2.1,JSR229=1.1.0,SATSAAPDU=1.0,CLDC=1.1,JSR177=1.0,JSR179=1.0.1,J2MEWS=1.0,WMA=2.0,JSR172=1.0,OBEX=1.0,ColorScreen,JSR238=1.0,JSR239=1.0,JSR211=1.0,JSR234=1.0,ScreenWidth=240,JSR75=1.0,JSR184=1.1,SATSAPKI=1.0,ScreenHeight=320,ScreenColorDepth=8,JSR180=1.0.1,J2MEXMLRPC=1.0, +all.configurations=\ +application.args= +application.description= +application.description.detail= +application.name= +application.vendor=Vendor +build.classes.dir=${build.dir}/compiled +build.classes.excludes=**/*.java,**/*.form,**/*.class,**/.nbintdb,**/*.mvd,**/*.wsclient,**/*.vmd +build.dir=build/${config.active} +build.root.dir=build +debug.level=debug +deployment.copy.target=deploy +deployment.instance=default +deployment.jarurl=${dist.jar} +deployment.method=NONE +deployment.override.jarurl=false +dist.dir=dist/${config.active} +dist.jad=GPST2.0.jad +dist.jar=GPST2.0.jar +dist.javadoc.dir=${dist.dir}/doc +dist.root.dir=dist +extra.classpath= +file.reference.builtin.ks=${netbeans.user}/config/j2me/builtin.ks +file.reference.GPSTracker2.0-res=res +filter.exclude.tests=false +filter.excludes= +filter.more.excludes= +filter.use.standard=true +jar.compress=true +javac.debug=true +javac.deprecation=false +javac.encoding=windows-1255 +javac.optimize=false +javac.source=1.3 +javac.target=1.3 +javadoc.author=false +javadoc.encoding= +javadoc.noindex=false +javadoc.nonavbar=false +javadoc.notree=false +javadoc.private=false +javadoc.splitindex=true +javadoc.use=true +javadoc.version=false +javadoc.windowtitle= +libs.classpath=${file.reference.GPSTracker2.0-res} +main.class= +main.class.class=applet +manifest.apipermissions=MIDlet-Permissions: javax.microedition.io.Connector.http, javax.microedition.location.Location\n +manifest.file=manifest.mf +manifest.jad= +manifest.manifest= +manifest.midlets=MIDlet-1: GPSTracker,/res/gps32.png,GPSTracker\n +manifest.others=MIDlet-Vendor: Websmithing\nMIDlet-Info-URL: www.websmithing.com\nMIDlet-Name: GPSTracker2.0\nMIDlet-Icon: /res/gps32.png\nMIDlet-Version: 2.0\n +manifest.pushregistry= +name=GPSTracker2.0 +no.dependencies=false +nokiaS80.application.icon= +nsicom.application.monitorhost= +nsicom.application.runremote= +nsicom.application.runverbose= +nsicom.remoteapp.location=\\My Documents\\NetBeans Applications +nsicom.remotevm.location=\\Windows\\creme\\bin\\CrEme.exe +obfuscated.classes.dir=${build.dir}/obfuscated +obfuscation.custom= +obfuscation.level=9 +obfuscator.destjar=${build.dir}/obfuscated.jar +obfuscator.srcjar=${build.dir}/before-obfuscation.jar +platform.active=Sun_Java_TM__Wireless_Toolkit_2_5_2_for_CLDC +platform.active.description=Sun Java(TM) Wireless Toolkit 2.5.2 for CLDC +platform.apis=JSR179-1.0.1 +platform.bootclasspath=${platform.home}/lib/jsr179.jar:${platform.home}/lib/cldcapi11.jar:${platform.home}/lib/midpapi20.jar +platform.configuration=CLDC-1.1 +platform.device=DefaultColorPhone +platform.fat.jar=true +platform.profile=MIDP-2.0 +platform.trigger=CLDC +platform.type=UEI-1.0.1 +preprocessed.dir=${build.dir}/preprocessed +preverify.classes.dir=${build.dir}/preverified +preverify.sources.dir=${build.dir}/preverifysrc +resources.dir=resources +ricoh.application.email= +ricoh.application.fax= +ricoh.application.icon= +ricoh.application.target-jar= +ricoh.application.telephone= +ricoh.application.uid=24148073 +ricoh.application.version= +ricoh.dalp.application-desc.auto-run=false +ricoh.dalp.application-desc.energy-save= +ricoh.dalp.application-desc.exec-auth= +ricoh.dalp.application-desc.visible=true +ricoh.dalp.argument= +ricoh.dalp.codebase= +ricoh.dalp.display-mode.color=true +ricoh.dalp.display-mode.is-4line-support=false +ricoh.dalp.display-mode.is-hvga-support=true +ricoh.dalp.display-mode.is-vga-support=false +ricoh.dalp.display-mode.is-wvga-support=false +ricoh.dalp.information.abbreviation= +ricoh.dalp.information.icon.basepath= +ricoh.dalp.information.icon.location= +ricoh.dalp.information.is-icon-used=true +ricoh.dalp.install.destination=hdd +ricoh.dalp.install.mode.auto=true +ricoh.dalp.install.work-dir=hdd +ricoh.dalp.is-managed=true +ricoh.dalp.resources.dsdk.version=2.0 +ricoh.dalp.resources.jar.basepath= +ricoh.dalp.resources.jar.version= +ricoh.dalp.version= +ricoh.icon.invert=false +ricoh.platform.target.version= +run.cmd.options= +run.jvmargs= +run.method=STANDARD +run.security.domain=trusted +run.use.security.domain=false +savaje.application.icon= +savaje.application.icon.focused= +savaje.application.icon.small= +savaje.application.uid=TBD +savaje.bundle.base= +savaje.bundle.debug=false +savaje.bundle.debug.port= +semc.application.caps= +semc.application.icon= +semc.application.icon.count= +semc.application.icon.splash= +semc.application.icon.splash.installonly=false +semc.application.uid=E1156475 +semc.certificate.path= +semc.private.key.password= +semc.private.key.path= +sign.alias=sprintadp +sign.enabled=false +sign.keystore=${file.reference.builtin.ks} +src.dir=src +use.emptyapis=true +use.preprocessor=true diff --git a/GPSTrackerNet/Phone/GPSTracker2.0/nbproject/project.xml b/GPSTrackerNet/Phone/GPSTracker2.0/nbproject/project.xml new file mode 100755 index 0000000..234ab96 --- /dev/null +++ b/GPSTrackerNet/Phone/GPSTracker2.0/nbproject/project.xml @@ -0,0 +1,10 @@ + + + org.netbeans.modules.kjava.j2meproject + + + GPSTracker2.0 + 1.6 + + + diff --git a/GPSTrackerNet/Phone/GPSTracker2.0/res/gps32.png b/GPSTrackerNet/Phone/GPSTracker2.0/res/gps32.png new file mode 100755 index 0000000..68dcc1b --- /dev/null +++ b/GPSTrackerNet/Phone/GPSTracker2.0/res/gps32.png Binary files differ diff --git a/GPSTrackerNet/Phone/GPSTracker2.0/src/GPS.java b/GPSTrackerNet/Phone/GPSTracker2.0/src/GPS.java new file mode 100755 index 0000000..776a420 --- /dev/null +++ b/GPSTrackerNet/Phone/GPSTracker2.0/src/GPS.java @@ -0,0 +1,156 @@ +// Please leave the link below with the source code, thank you. +// http://www.websmithing.com/portal/Programming/tabid/55/articleType/ArticleView/articleId/6/Google-Map-GPS-Cell-Phone-Tracker-Version-2.aspx + +import javax.microedition.location.*; +import java.util.Calendar; +import java.util.Date; + +public class GPS implements LocationListener { + + private LocationProvider locationProvider = null; + private Coordinates oldCoordinates = null, currentCoordinates = null; + private float distance = 0; + private int azimuth = 0; + private String uploadWebsite; + private String queryString; + private GPSTracker midlet; + private int interval; + protected Calendar currentTime; + protected long sessionID; + + + public GPS(GPSTracker Midlet, int Interval, String UploadWebsite){ + currentTime = Calendar.getInstance(); + sessionID = System.currentTimeMillis(); + this.midlet = Midlet; + this.interval = Interval; + this.uploadWebsite = UploadWebsite; + } + + // getting the gps location is based on an interval in seconds. for instance, + // the location is gotten once a minute, sent to the website to be stored in + // the DB (and then viewed on Google map) and used to retrieve a map tile (image) + // to be diplayed on the phone + + public void startGPS() { + if (locationProvider == null) { + createLocationProvider(); + + Thread locationThread = new Thread() { + public void run(){ + createLocationListener(); + } + }; + locationThread.start(); + } + } + + // this allows us to change how often the gps location is gotten + public void changeInterval(int Interval) { + if (locationProvider != null) { + locationProvider.setLocationListener(this, Interval, -1, -1); + } + } + + private void createLocationProvider() { + Criteria cr = new Criteria(); + + try { + locationProvider = LocationProvider.getInstance(cr); + } catch (Exception e) { + midlet.log("GPS.createLocationProvider: " + e); + } + } + + private void createLocationListener(){ + // 2cd value is interval in seconds + try { + locationProvider.setLocationListener(this, interval, -1, -1); + } catch (Exception e) { + midlet.log("GPS.createLocationListener: " + e); + } + } + + public void locationUpdated(LocationProvider provider, final Location location) { + // get new location from locationProvider + + try { + Thread getLocationThread = new Thread(){ + public void run(){ + getLocation(location); + } + }; + + getLocationThread.start(); + } catch (Exception e) { + midlet.log("GPS.locationUpdated: " + e); + } + } + + public void providerStateChanged(LocationProvider provider, int newState) {} + + private void getLocation(Location location){ + float speed = 0; + + try { + QualifiedCoordinates qualifiedCoordinates = location.getQualifiedCoordinates(); + + qualifiedCoordinates.getLatitude(); + + if (oldCoordinates == null){ + oldCoordinates = new Coordinates(qualifiedCoordinates.getLatitude(), + qualifiedCoordinates.getLongitude(), + qualifiedCoordinates.getAltitude()); + } else { + if (!Float.isNaN( qualifiedCoordinates.distance(oldCoordinates))) { + distance += qualifiedCoordinates.distance(oldCoordinates); + } + + currentCoordinates = new Coordinates(qualifiedCoordinates.getLatitude(), + qualifiedCoordinates.getLongitude(), + qualifiedCoordinates.getAltitude()); + azimuth = (int)oldCoordinates.azimuthTo(currentCoordinates); + oldCoordinates.setAltitude(qualifiedCoordinates.getAltitude()); + oldCoordinates.setLatitude(qualifiedCoordinates.getLatitude()); + oldCoordinates.setLongitude(qualifiedCoordinates.getLongitude()); + + } + + if (qualifiedCoordinates != null){ + Date d = new Date(); + + if (!Float.isNaN(location.getSpeed())) { + speed = location.getSpeed(); + } + + queryString = "?lat=" + String.valueOf(qualifiedCoordinates.getLatitude()) + + "&lng=" + String.valueOf(qualifiedCoordinates.getLongitude()) + + "&mph=" + String.valueOf((int)(speed/1609*3600)) + + "&dir=" + String.valueOf(azimuth) + + "&dis=" + String.valueOf((int)(distance/1609)) + + "&dt=" + d.toString() + + "&lm=" + location.getLocationMethod() + + "&pn=" + midlet.phoneNumber + + "&sid=" + String.valueOf(sessionID) + + "&acc=" + String.valueOf((int)(qualifiedCoordinates.getHorizontalAccuracy()*3.28)) + + "&iv=" + String.valueOf(location.isValid()) + + "&info=" + location.getExtraInfo("text/plain") + + "&zm=" + midlet.zoomLevel + + "&h=" + midlet.height + + "&w=" + midlet.width; + + // with our query string built, we create a networker object to send the + // query to our website and get the map image and update the DB + NetWorker worker = new NetWorker(midlet, uploadWebsite); + worker.getUrl(queryString); + + } + + } catch (Exception e) { + midlet.log("GPS.getLocation: " + e); + } + } +} + + + diff --git a/GPSTrackerNet/Phone/GPSTracker2.0/src/GPSTracker.java b/GPSTrackerNet/Phone/GPSTracker2.0/src/GPSTracker.java new file mode 100755 index 0000000..f81c350 --- /dev/null +++ b/GPSTrackerNet/Phone/GPSTracker2.0/src/GPSTracker.java @@ -0,0 +1,279 @@ +// Please leave the link below with the source code, thank you. +// http://www.websmithing.com/portal/Programming/tabid/55/articleType/ArticleView/articleId/6/Google-Map-GPS-Cell-Phone-Tracker-Version-2.aspx + +import javax.microedition.midlet.*; +import javax.microedition.lcdui.*; +import javax.microedition.location.*; +import java.util.Calendar; + +public class GPSTracker extends MIDlet implements CommandListener, ItemStateListener { + private Display display; + private Form form; + private Form zoomScreen; + private Form settingsScreen; + private Command exitCmd; + private Command saveCmd; + private Command zoomCmd; + private Command settingsCmd; + private Command backCmd; + private TextField phoneNumberTextField; + private TextField uploadWebsiteTextField; + private Gauge zoomGauge; + private StringItem zoomStringItem; + private ChoiceGroup updateIntervalCG; + private String updateInterval; + private int[] iTimes = {60, 120, 180, 300, 600}; + + private RMS rms; + private GPS gps; + + private String uploadWebsite; + private String defaultUploadWebsite = "http://www.websmithing.com/gpstracker/GetGoogleMap2.aspx"; + + protected String phoneNumber; + protected String zoomLevel; + protected int height, width; + protected Calendar currentTime; + protected long sessionID; + protected Image im = null; + + public GPSTracker(){ + form = new Form("GPSTracker2.0"); + display = Display.getDisplay(this); + exitCmd = new Command("Exit", Command.EXIT, 1); + zoomCmd = new Command("Zoom", Command.SCREEN, 2); + settingsCmd = new Command("Settings", Command.SCREEN, 3); + + form.addCommand(exitCmd); + form.addCommand(zoomCmd); + form.addCommand(settingsCmd); + form.setCommandListener(this); + + display.setCurrent(form); + currentTime = Calendar.getInstance(); + sessionID = System.currentTimeMillis(); + height = form.getHeight(); + width = form.getWidth(); + + // RMS is the phone's built in storage, kind of like a database, but + // it only stores name-value pairs (like an associative array or hashtable). + // eveything is stored as a string. + getSettingsFromRMS(); + + // the phone number field is the only empty field when the application is + // first loaded. it does not have to be a phone number, it can be any string, + // but for uniqueness, it's best to use a phone number. this only has to be + // done once. + if (hasPhoneNumber()) { + startGPS(); + displayInterval(); + } + } + + public void startApp() { + if ( form != null ) { + display.setCurrent(form); + } + } + + // let the user know how often map will be updated + private void displayInterval() { + int tempTime = iTimes[Integer.parseInt(updateInterval)]/60; + + display.setCurrent(form); + form.deleteAll(); + + if (tempTime == 1) { + log("Getting map once a minute..."); + } + else { + log("Getting map every " + String.valueOf(tempTime) + " minutes..."); + } + } + + private void loadZoomScreen() { + zoomScreen = new Form("Zoom"); + zoomGauge = new Gauge("Google Map Zoom", true, 17, Integer.parseInt(zoomLevel)); + zoomStringItem = new StringItem(null, ""); + zoomStringItem.setText("Zoom level: " + zoomGauge.getValue()); + backCmd = new Command("Back", Command.SCREEN, 1); + + zoomScreen.append(zoomGauge); + zoomScreen.append(zoomStringItem); + zoomScreen.addCommand(backCmd); + zoomScreen.setItemStateListener(this); + zoomScreen.setCommandListener(this); + + display.setCurrent(zoomScreen); + } + + // this method is called every time the zoom guage changes value. the zoom level is + // reset and saved + public void itemStateChanged(Item item) { + if (item == zoomGauge) { + zoomStringItem.setText("Zoom level: " + zoomGauge.getValue()); + zoomLevel = String.valueOf(zoomGauge.getValue()); + + try { + rms.put("zoomLevel", zoomLevel); + rms.save(); + } + catch (Exception e) { + log("GPSTracker.itemStateChanged: " + e); + } + } + } + + private void loadSettingsScreen() { + settingsScreen = new Form("Settings"); + + phoneNumberTextField = new TextField("Phone number or user name", phoneNumber, 20, TextField.ANY); + uploadWebsiteTextField = new TextField("Upload website", uploadWebsite, 100, TextField.ANY); + settingsScreen.append(phoneNumberTextField); + settingsScreen.append(uploadWebsiteTextField); + + String[] times = { "1 minute", "2 minutes", "3 minutes", "5 minutes", "10 minutes"}; + updateIntervalCG = new ChoiceGroup("Update map how often?", ChoiceGroup.EXCLUSIVE, times, null); + updateIntervalCG.setSelectedIndex(Integer.parseInt(updateInterval), true); + settingsScreen.append(updateIntervalCG); + + saveCmd = new Command("Save", Command.SCREEN, 1); + settingsScreen.addCommand(saveCmd); + + settingsScreen.setCommandListener(this); + display.setCurrent(settingsScreen); + } + + // get the settings from the phone's storage and load 4 global variables + public void getSettingsFromRMS() { + try { + rms = new RMS(this, "GPSTracker"); + + phoneNumber = rms.get("phoneNumber"); + uploadWebsite = rms.get("uploadWebsite"); + zoomLevel = rms.get("zoomLevel"); + updateInterval = rms.get("updateInterval"); + } + catch (Exception e) { + log("GPSTracker.getSettingsFromRMS: " + e); + } + + if ((uploadWebsite == null) || (uploadWebsite.trim().length() == 0)) { + uploadWebsite = defaultUploadWebsite; + } + + if ((zoomLevel == null) || (zoomLevel.trim().length() == 0)) { + zoomLevel = "12"; + } + if ((updateInterval == null) || (updateInterval.trim().length() == 0)) { + updateInterval = "1"; + } + } + + private boolean hasPhoneNumber() { + if ((phoneNumber == null) || (phoneNumber.trim().length() == 0)) { + log("Phone number required. Please go to settings."); + return false; + } + else { + return true; + } + } + + // gps is started with the update interval. the interval is the time in between + // map updates + private void startGPS() { + if (gps == null) { + gps = new GPS(this, iTimes[Integer.parseInt(updateInterval)], uploadWebsite); + gps.startGPS(); + } + } + + // this is called when the user changes the interval in the settings screen + private void changeInterval() { + if (gps == null) { + startGPS(); + } + else { + gps.changeInterval(iTimes[Integer.parseInt(updateInterval)]); + } + } + + // save settings back to phone memory + private void saveSettingsToRMS() { + try { + phoneNumber = phoneNumberTextField.getString(); + uploadWebsite = uploadWebsiteTextField.getString(); + updateInterval = String.valueOf(updateIntervalCG.getSelectedIndex()); + + rms.put("phoneNumber", phoneNumber); + rms.put("uploadWebsite", uploadWebsite); + rms.put("updateInterval", updateInterval); + + rms.save(); + } + catch (Exception e) { + log("GPSTracker.saveSettings: " + e); + } + display.setCurrent(form); + } + + // this method displays the map image, it is called from the networker object + public void showMap(boolean flag) + { + if (flag == false) { + log("Map could not be downloaded."); + } + else { + ImageItem imageitem = new ImageItem(null, im, ImageItem.LAYOUT_DEFAULT, null); + + if(form.size()!= 0) { + form.set(0, imageitem); + } + else { + form.append(imageitem); + } + } + } + + public void log(String text) { + StringItem si = new StringItem(null, text); + si.setLayout(Item.LAYOUT_NEWLINE_AFTER); + form.append(si); + } + + public void commandAction(Command cmd, Displayable screen) { + if (cmd == exitCmd) { + shutDownApp(); + } + else if (cmd == saveCmd) { + saveSettingsToRMS(); + + if (hasPhoneNumber()) { + changeInterval(); + displayInterval(); + } + } + else if (cmd == settingsCmd) { + loadSettingsScreen(); + } + else if (cmd == zoomCmd) { + loadZoomScreen(); + } + else if (cmd == backCmd) { + displayInterval(); + } + } + + public void pauseApp() {} + + public void destroyApp(boolean unconditional) {} + + protected void shutDownApp() { + destroyApp(true); + notifyDestroyed(); + } +} + + + diff --git a/GPSTrackerNet/Phone/GPSTracker2.0/src/NetWorker.java b/GPSTrackerNet/Phone/GPSTracker2.0/src/NetWorker.java new file mode 100755 index 0000000..ebae7f4 --- /dev/null +++ b/GPSTrackerNet/Phone/GPSTracker2.0/src/NetWorker.java @@ -0,0 +1,112 @@ +// Please leave the link below with the source code, thank you. +// http://www.websmithing.com/portal/Programming/tabid/55/articleType/ArticleView/articleId/6/Google-Map-GPS-Cell-Phone-Tracker-Version-2.aspx + +import javax.microedition.io.*; +import java.io.*; +import javax.microedition.lcdui.Image; + +public class NetWorker { + private GPSTracker midlet; + private String uploadWebsite; + int i = 1; + + public NetWorker(GPSTracker lbsMidlet, String UploadWebsite){ + this.midlet = lbsMidlet; + this.uploadWebsite = UploadWebsite; + } + + public void getUrl(String queryString) { + queryString = URLencodeSpaces(queryString); + String url = uploadWebsite + queryString; + HttpConnection httpConn = null; + InputStream inputStream = null; + DataInputStream iStrm = null; + ByteArrayOutputStream bStrm = null; + Image im = null; + + try{ + httpConn = (HttpConnection)Connector.open(url); + + if(httpConn.getResponseCode() == HttpConnection.HTTP_OK){ + inputStream = httpConn.openInputStream(); + iStrm = new DataInputStream(inputStream); + + byte imageData[]; + int length = (int)httpConn.getLength(); + + if(length != -1) { + imageData = new byte[length]; + iStrm.readFully(imageData); + } + else { //Length not available + bStrm = new ByteArrayOutputStream(); + int ch; + + while((ch = iStrm.read())!= -1) { + bStrm.write(ch); + } + imageData = bStrm.toByteArray(); + + } + im = Image.createImage(imageData, 0, imageData.length); + } + else { + midlet.log("NetWorker.getUrl responseCode: " + httpConn.getResponseCode()); + } + + } catch (Exception e) { + midlet.log("NetWorker.getUrl: " + e); + } + finally{ // Clean up + try{ + if(bStrm != null) + bStrm.close(); + if(iStrm != null) + iStrm.close(); + if(inputStream != null) + inputStream.close(); + if(httpConn != null) + httpConn.close(); + } + catch(Exception e){} + } + + // if we have successfully gotten a map image, then we want to display it + if( im == null) { + midlet.showMap(false); + } + else { + midlet.im = im; + midlet.showMap(true); + } + + } + + // http://forum.java.sun.com/thread.jspa?threadID=341790&messageID=1408555 + private String URLencodeSpaces(String s) + { + if (s != null) { + StringBuffer tmp = new StringBuffer(); + int i = 0; + try { + while (true) { + int b = (int)s.charAt(i++); + + if (b != 0x20) { + tmp.append((char)b); + } + else { + tmp.append("%"); + if (b <= 0xf) { + tmp.append("0"); + } + tmp.append(Integer.toHexString(b)); + } + } + } + catch (Exception e) {} + return tmp.toString(); + } + return null; + } +} diff --git a/GPSTrackerNet/Phone/GPSTracker2.0/src/RMS.java b/GPSTrackerNet/Phone/GPSTracker2.0/src/RMS.java new file mode 100755 index 0000000..da626ff --- /dev/null +++ b/GPSTrackerNet/Phone/GPSTracker2.0/src/RMS.java @@ -0,0 +1,79 @@ +// Wireless Java Developing with J2ME, Jonathan Knudsen + +import java.util.*; +import javax.microedition.rms.*; + +public class RMS { + private GPSTracker midlet; + private String mRecordStoreName; + private Hashtable mHashtable; + + public RMS(GPSTracker Midlet, String recordStoreName) throws RecordStoreException { + this.midlet = Midlet; + this.mRecordStoreName = recordStoreName; + this.mHashtable = new Hashtable(); + load(); + } + + public String get(String key) { + return (String)mHashtable.get(key); + } + + public void put(String key, String value) { + if (value == null) value = ""; + mHashtable.put(key, value); + } + + private void load() throws RecordStoreException { + RecordStore rs = null; + RecordEnumeration re = null; + + try { + rs = RecordStore.openRecordStore(mRecordStoreName, true); + re = rs.enumerateRecords(null, null, false); + while (re.hasNextElement()) { + byte[] raw = re.nextRecord(); + String pref = new String(raw); + // Parse out the name. + int index = pref.indexOf('|'); + String name = pref.substring(0, index); + String value = pref.substring(index + 1); + put(name, value); + } + } + finally { + if (re != null) re.destroy(); + if (rs != null) rs.closeRecordStore(); + } + } + + public void save() throws RecordStoreException { + RecordStore rs = null; + RecordEnumeration re = null; + try { + rs = RecordStore.openRecordStore(mRecordStoreName, true); + re = rs.enumerateRecords(null, null, false); + + // First remove all records, a little clumsy. + while (re.hasNextElement()) { + int id = re.nextRecordId(); + rs.deleteRecord(id); + } + + // Now save the preferences records. + Enumeration keys = mHashtable.keys(); + while (keys.hasMoreElements()) { + String key = (String)keys.nextElement(); + String value = get(key); + String pref = key + "|" + value; + byte[] raw = pref.getBytes(); + rs.addRecord(raw, 0, raw.length); + } + } + finally { + if (re != null) re.destroy(); + if (rs != null) rs.closeRecordStore(); + } + } + +} diff --git a/GPSTrackerNet/ReadMe.txt b/GPSTrackerNet/ReadMe.txt new file mode 100755 index 0000000..9300514 --- /dev/null +++ b/GPSTrackerNet/ReadMe.txt @@ -0,0 +1,85 @@ + +Google Map GPS Cell Phone Tracker, Version 2.0 + +Installation + +There are 3 parts to this project, the website, the database and the phone app. I will describe the installation for all 3 parts. First unzip the files. There are some basic requirements for using this app. The first is that you have a GPS cellphone that has a data plan (so that you can access your website). Your carrier must support GPS, I used Sprint/Nextel with the Motorola i355 phone. + +The second is .NET 2.0 and the Visual Studio 2005 IDE. You can use the express edition, it's free. + +http://www.microsoft.com/express/download/#webInstall + +The third is MSSQL Server 2005, once again you can use the express edition, it's free also: + +http://msdn2.microsoft.com/en-us/express/bb410791.aspx + +******************************************************* + +Website: + +Put the .NET website solution files into a folder called GPSTracker. In administrative tools open the IIS console and right click on "default web site" and create a new virtual directory called GPSTracker and then browse to your GPSTracker directory that has the .NET solution files, click next. Make sure that Read and Run Scripts is selected and finish creating the virtual directory. +You can then open the solution by clicking on the GPSTracker.sln file. Open the Web.config file and change the uid (username) and pwd (password) to your user in SQL server. + +Go to http://www.google.com/apis/maps/signup.html and get your API key for your website. You must have your own domain name. You cannot use localhost on your home computer unless it has it's own domain name. Open the Web.config page and replace the key that is there with the one you got for your domain. + +Right click on "default web site" again and go to properties. Click on the Http Headers tab and then at the bottom where it says Mime Map, click on File Types. Click on new type and and add the following: + +associated extension: .jad + +content type (MIME): text/vnd.sun.j2me.app-descriptor + +Click ok and save it. This allows the user to download the jad/jar files for the phone application. + +******************************************************* + +Database: + +There are 2 ways to create the database. Create a database called GPSTracker and then restore the database with the file GPSTracker.bak. When you restore, go to the Options page and select the checkbox that says "Overwrite the existing database". There is some sample GPS data in this database. + +The second way is to open up a query window in Management Studio and run the GPSTracker.sql script. You then need to import the sample data in data.txt. You do not need to do both methods. I would do the .bak method personally because it's easier. You can use the data.txt file to reload data if you delete it. + +******************************************************* + +Phone: + +The best thing about version 2 of the gps tracker is that the phone application does not need to be compiled. Version 1 required everyone to download netbeans and compile the app. You can still compile the application if you want, the instructions for that are below. + +The first thing you need to do is get the application onto your phone. If you have installed the website and set the mime type for jad files (see above), you can then browse to the application with your phone. For example: + +http://www.mywebsite.com/gpstracker/phone/ + +Download the app and go to settings and set the phone number, download website and interval. The phone number can be any string, for instance, someone's name. If you want to uniquely identify routes, use an actual phone number. + +If you try using the phone with the default download website (websmithing), you can test if your phone is working by going to: + +http://www.websmithing.com/gpstracker/DisplayMap2.aspx + +and viewing the route you created with your phone. + +The second way to get the app onto your phone is to use a cable and your cell phone's application loader software that comes with your cell phone. + +For those of you who need to alter or recompile the phone application, here's what you need. + +Download netbeans from here: + +http://download.netbeans.org/netbeans/6.0/final/ + +choose the one that says Mobility. + +Go to http://java.sun.com/products/sjwtoolkit/download-2_5_1.html and download: + +Sun Java Wireless Toolkit 2.5.1 for CLDC + +The link is about 3/4 of the way down the page. The directory must be in the root (C:\) with *no spaces*. It defaults to C:\WTK25. I would use that... Start Net Beans IDE and go to File/Open Project menu and open up the GPSTracker2.0 project. In netbeans, right click on the word GPSTracker2.0, you will find it up in the upper left hand corner. Click on the Platform menu item and then the button that says manage emulators. cLick "add platform" and select "Java Micro Edition Platform Emulator" and click next. A list will be generated, then click the C:\WTK25 2.5.1 Wireless Toolket that you installed earlier. + +Now go ahead and build the application. The 2 files that you need are in the Phone/dist folder. They are GPST2.0.jar and GPST2.0.jad. + +******************************************************* + +Please leave the link below with the source code, thank you. +http://www.websmithing.com/portal/Programming/tabid/55/articleType/ArticleView/articleId/6/Google-Map-GPS-Cell-Phone-Tracker-Version-2.aspx + + + + + \ No newline at end of file diff --git a/GPSTrackerNet/Website/GPSTracker/App_Code/DbWriter.cs b/GPSTrackerNet/Website/GPSTracker/App_Code/DbWriter.cs new file mode 100755 index 0000000..f1afe14 --- /dev/null +++ b/GPSTrackerNet/Website/GPSTracker/App_Code/DbWriter.cs @@ -0,0 +1,67 @@ +// Please leave the link below with the source code, thank you. +// http://www.websmithing.com/portal/Programming/tabid/55/articleType/ArticleView/articleId/6/Google-Map-GPS-Cell-Phone-Tracker-Version-2.aspx + +using System; +using System.Configuration; +using System.Data; +using System.Data.SqlClient; + + +/// +/// Inserts or updates MSSQL using stored procedure. +/// Returns new identity column ID if successful or 0 if not. +/// +public class DbWriter +{ + public DbWriter() + { + } + + /// + /// This method takes an optional list of parameters. + /// + public string updateDB(string storedProcedureName, params SqlParameter[] spParameterList) + { + string identityColumnID = "0"; + + SqlConnection conn = new SqlConnection(); + conn.ConnectionString = GetConnectionString(); + + SqlCommand cmd = new SqlCommand(); + cmd.Connection = conn; + cmd.CommandText = storedProcedureName; + cmd.CommandType = CommandType.StoredProcedure; + + // optional list of parameters for stored procedure + if (spParameterList.Length > 0) + { + for (int i = 0; i < spParameterList.Length; i++) + { + cmd.Parameters.Add(spParameterList[i]); + } + } + + conn.Open(); + SqlDataReader reader = cmd.ExecuteReader(); + + // if we have successfully executed the stored procedure then + // get the identityColumnID from the DB + if (reader.Read()) + { + identityColumnID = reader.GetInt32(0).ToString(); + } + + reader.Close(); + conn.Close(); + + return identityColumnID; + } + + private string GetConnectionString() + { + return ConfigurationManager.ConnectionStrings + ["RemoteConnectionString"].ConnectionString; + } +} + + diff --git a/GPSTrackerNet/Website/GPSTracker/App_Code/DbXmlReader.cs b/GPSTrackerNet/Website/GPSTracker/App_Code/DbXmlReader.cs new file mode 100755 index 0000000..8ac61dd --- /dev/null +++ b/GPSTrackerNet/Website/GPSTracker/App_Code/DbXmlReader.cs @@ -0,0 +1,64 @@ +// Please leave the link below with the source code, thank you. +// http://www.websmithing.com/portal/Programming/tabid/55/articleType/ArticleView/articleId/6/Google-Map-GPS-Cell-Phone-Tracker-Version-2.aspx + +using System; +using System.Configuration; +using System.Data; +using System.Data.SqlClient; +using System.Xml; + + +public class DbXmlReader +{ + /// + /// Gets xml from MSSQL Server and returns it as a string. + /// + public DbXmlReader() + { + } + + /// + /// This method takes an optional list of paramters. + /// + public string getXmlString(string storedProcedureName, params SqlParameter[] spParameterList) + { + string xmlString = ""; + + SqlConnection conn = new SqlConnection(); + conn.ConnectionString = GetConnectionString(); + + SqlCommand cmd = new SqlCommand(); + cmd.Connection = conn; + cmd.CommandText = storedProcedureName; + cmd.CommandType = CommandType.StoredProcedure; + + // optional list of parameters for stored procedure + if (spParameterList.Length > 0) + { + for (int i = 0; i < spParameterList.Length; i++) + { + cmd.Parameters.Add(spParameterList[i]); + } + } + + conn.Open(); + XmlReader xmlr = cmd.ExecuteXmlReader(); + xmlr.Read(); + + // we are getting XML straight from the stored procedure, so add it to + // our XML string + while (xmlr.ReadState != ReadState.EndOfFile) + { + xmlString = xmlr.ReadOuterXml(); + } + + return xmlString; + } + + private string GetConnectionString() // stored in web.config + { + return ConfigurationManager.ConnectionStrings + ["RemoteConnectionString"].ConnectionString; + } +} + diff --git a/GPSTrackerNet/Website/GPSTracker/DeleteRoute.aspx b/GPSTrackerNet/Website/GPSTracker/DeleteRoute.aspx new file mode 100755 index 0000000..84ffd51 --- /dev/null +++ b/GPSTrackerNet/Website/GPSTracker/DeleteRoute.aspx @@ -0,0 +1,2 @@ +<%@ Page Language="C#" AutoEventWireup="true" CodeFile="DeleteRoute.aspx.cs" Inherits="DeleteRoute" %> + diff --git a/GPSTrackerNet/Website/GPSTracker/DeleteRoute.aspx.cs b/GPSTrackerNet/Website/GPSTracker/DeleteRoute.aspx.cs new file mode 100755 index 0000000..968f064 --- /dev/null +++ b/GPSTrackerNet/Website/GPSTracker/DeleteRoute.aspx.cs @@ -0,0 +1,25 @@ +// Please leave the link below with the source code, thank you. +// http://www.websmithing.com/portal/Programming/tabid/55/articleType/ArticleView/articleId/6/Google-Map-GPS-Cell-Phone-Tracker-Version-2.aspx + +using System; +using System.Data.SqlClient; + +public partial class DeleteRoute : System.Web.UI.Page +{ + protected void Page_Load(object sender, EventArgs e) + { + string sessionID = Request.QueryString["sessionID"]; + string phoneNumber = Request.QueryString["phoneNumber"]; + + // our helper class to get data + DbXmlReader reader = new DbXmlReader(); + + Response.AppendHeader("Content-Type", "text/xml"); + + // actually we are getting a response back here, but the result will be a deleted route on the webpage + Response.Write(reader.getXmlString("prcDeleteRoute", + new SqlParameter("@sessionID", sessionID), + new SqlParameter("@phoneNumber", phoneNumber))); + + } +} diff --git a/GPSTrackerNet/Website/GPSTracker/DisplayMap2.aspx b/GPSTrackerNet/Website/GPSTracker/DisplayMap2.aspx new file mode 100755 index 0000000..f7743b9 --- /dev/null +++ b/GPSTrackerNet/Website/GPSTracker/DisplayMap2.aspx @@ -0,0 +1,106 @@ +<%@ Page Language="C#" AutoEventWireup="true" CodeFile="DisplayMap2.aspx.cs" Inherits="DisplayMap2" %> + + + + + Google Map GPS Cell Phone Tracker + + + + + + + + + + + +
+
GPS Tracker
+
+ + + + + + + + + + + + + + + + + + + + + + diff --git a/GPSTrackerNet/Website/GPSTracker/DisplayMap2.aspx.cs b/GPSTrackerNet/Website/GPSTracker/DisplayMap2.aspx.cs new file mode 100755 index 0000000..cef09e1 --- /dev/null +++ b/GPSTrackerNet/Website/GPSTracker/DisplayMap2.aspx.cs @@ -0,0 +1,28 @@ +// Please leave the link below with the source code, thank you. +// http://www.websmithing.com/portal/Programming/tabid/55/articleType/ArticleView/articleId/6/Google-Map-GPS-Cell-Phone-Tracker-Version-2.aspx + +using System; +using System.Configuration; +using System.Web.UI; + +public partial class DisplayMap2 : System.Web.UI.Page { + protected void Page_Load(object sender, EventArgs e) { + // the application uses the Google map key on 2 different pages so the key is stored in + // web.config. the code below gets the key and then injects this javascript code onto the + // web page. It will be used to get the Google javascript library for maps. The reason we + // go through all this is so that we can store the Google key in one location. + + string url = "http://maps.google.com/maps?file=api&v=2.x&key=" + GetGoogleMapKey(); + + if (!ClientScript.IsClientScriptBlockRegistered("googleKey")) { + String scriptString = ""; + ClientScript.RegisterClientScriptBlock(this.GetType(), "googleKey", scriptString); + } + } + + private string GetGoogleMapKey() { // stored in web.config + return ConfigurationManager.AppSettings["GoogleMapKey"]; + } +} diff --git a/GPSTrackerNet/Website/GPSTracker/GPSTracker.sln b/GPSTrackerNet/Website/GPSTracker/GPSTracker.sln new file mode 100755 index 0000000..17cca1a --- /dev/null +++ b/GPSTrackerNet/Website/GPSTracker/GPSTracker.sln @@ -0,0 +1,35 @@ + +Microsoft Visual Studio Solution File, Format Version 9.00 +# Visual Studio 2005 +Project("{E24C65DC-7377-472B-9ABA-BC803B73C61A}") = "http://localhost/GPSTracker/", "http://localhost/GPSTracker", "{B2CAFC54-B8D3-410B-8B22-667496F2C862}" + ProjectSection(WebsiteProperties) = preProject + Debug.AspNetCompiler.VirtualPath = "/GPSTracker" + Debug.AspNetCompiler.PhysicalPath = "inetpub\wwwroot\GPSTracker\" + Debug.AspNetCompiler.TargetPath = "PrecompiledWeb\GPSTracker\" + Debug.AspNetCompiler.Updateable = "true" + Debug.AspNetCompiler.ForceOverwrite = "true" + Debug.AspNetCompiler.FixedNames = "false" + Debug.AspNetCompiler.Debug = "True" + Release.AspNetCompiler.VirtualPath = "/GPSTracker" + Release.AspNetCompiler.PhysicalPath = "inetpub\wwwroot\GPSTracker\" + Release.AspNetCompiler.TargetPath = "PrecompiledWeb\GPSTracker\" + Release.AspNetCompiler.Updateable = "true" + Release.AspNetCompiler.ForceOverwrite = "true" + Release.AspNetCompiler.FixedNames = "false" + Release.AspNetCompiler.Debug = "False" + SlnRelativePath = "inetpub\wwwroot\GPSTracker\" + DefaultWebSiteLanguage = "Visual C#" + EndProjectSection +EndProject +Global + GlobalSection(SolutionConfigurationPlatforms) = preSolution + Debug|.NET = Debug|.NET + EndGlobalSection + GlobalSection(ProjectConfigurationPlatforms) = postSolution + {B2CAFC54-B8D3-410B-8B22-667496F2C862}.Debug|.NET.ActiveCfg = Debug|.NET + {B2CAFC54-B8D3-410B-8B22-667496F2C862}.Debug|.NET.Build.0 = Debug|.NET + EndGlobalSection + GlobalSection(SolutionProperties) = preSolution + HideSolutionNode = FALSE + EndGlobalSection +EndGlobal diff --git a/GPSTrackerNet/Website/GPSTracker/GPSTracker.suo b/GPSTrackerNet/Website/GPSTracker/GPSTracker.suo new file mode 100755 index 0000000..eb8dd9d --- /dev/null +++ b/GPSTrackerNet/Website/GPSTracker/GPSTracker.suo Binary files differ diff --git a/GPSTrackerNet/Website/GPSTracker/GetGoogleMap2.aspx b/GPSTrackerNet/Website/GPSTracker/GetGoogleMap2.aspx new file mode 100755 index 0000000..632d6db --- /dev/null +++ b/GPSTrackerNet/Website/GPSTracker/GetGoogleMap2.aspx @@ -0,0 +1,2 @@ +<%@ Page Language="C#" AutoEventWireup="true" CodeFile="GetGoogleMap2.aspx.cs" Inherits="GetGoogleMap2" %> + diff --git a/GPSTrackerNet/Website/GPSTracker/GetGoogleMap2.aspx.cs b/GPSTrackerNet/Website/GPSTracker/GetGoogleMap2.aspx.cs new file mode 100755 index 0000000..4a68fda --- /dev/null +++ b/GPSTrackerNet/Website/GPSTracker/GetGoogleMap2.aspx.cs @@ -0,0 +1,149 @@ +// Please leave the link below with the source code, thank you. +// http://www.websmithing.com/portal/Programming/tabid/55/articleType/ArticleView/articleId/6/Google-Map-GPS-Cell-Phone-Tracker-Version-2.aspx + +using System; +using System.Configuration; +using System.Drawing; +using System.Drawing.Imaging; +using System.IO; +using System.Net; +using System.Text; +using System.Data.SqlClient; + +public partial class GetGoogleMap2 : System.Web.UI.Page { + private MemoryStream stream = null; + private Image image = null; + //private string key = "ABQIAAAAQ35Hu3xqOoeD50UMgBW0cBQEt3eA6mol2Np5q6SKw0EDVXpM9hRExX__LZW3RbLXHuLKZlwC0oypOw"; // websmithing + private string url = "http://maps.google.com/staticmap"; + + private string height; + private string width; + private string latitude; + private string longitude; + private string zoom; + + protected void Page_Load(object sender, EventArgs e) { + height = Request.QueryString["h"]; + width = Request.QueryString["w"]; + latitude = Request.QueryString["lat"]; + longitude = Request.QueryString["lng"]; + zoom = Request.QueryString["zm"]; + + string mph = Request.QueryString["mph"]; + string direction = Request.QueryString["dir"]; + string distance = Request.QueryString["dis"]; + string date = Server.UrlDecode(Request.QueryString["dt"]); + + // convert to DateTime format + date = getDateFromJavaDate(date); + + string locationMethod = Server.UrlDecode(Request.QueryString["lm"]); + + string phoneNumber = Request.QueryString["pn"]; + string sessionID = Request.QueryString["sid"]; + string accuracy = Request.QueryString["acc"]; + string locationIsValid = Request.QueryString["iv"]; + string extraInfo = Request.QueryString["info"]; + + // our helper class to update the database + DbWriter dbw = new DbWriter(); + + try { + + // update the database with our GPS data from the phone + dbw.updateDB("prcSaveGPSLocation2", + new SqlParameter("@lat", latitude), + new SqlParameter("@lng", longitude), + new SqlParameter("@mph", mph), + new SqlParameter("@direction", direction), + new SqlParameter("@distance", distance), + new SqlParameter("@date", date), + new SqlParameter("@locationMethod", locationMethod), + + new SqlParameter("@phoneNumber", phoneNumber), + new SqlParameter("@sessionID", sessionID), + new SqlParameter("@accuracy", accuracy), + new SqlParameter("@locationIsValid", locationIsValid), + new SqlParameter("@extraInfo", extraInfo)); + + image = getMap(); + + // here we take our Google map image and send it out as a .png + // all phones handle png images + stream = new MemoryStream(); + image.Save(stream, ImageFormat.Png); + Response.ContentType = "image/png"; + stream.WriteTo(Response.OutputStream); + + Response.Flush(); + } + catch (Exception ex) { + Response.Write(ex.Message); + } + finally { + if (stream != null) { + stream.Dispose(); + } + if (image != null) { + image.Dispose(); + } + } + } + + // using the parameters from the phone, build a url string and get the Google map image + private Image getMap() { + try { + StringBuilder sb = new StringBuilder(url); + sb.Append("?markers="); + sb.Append(latitude); + sb.Append(","); + sb.Append(longitude); + sb.Append(",blueu&zoom="); + sb.Append(zoom); + sb.Append("&size="); + sb.Append(width.ToString()); + sb.Append("x"); + sb.Append(height.ToString()); + sb.Append("&maptype=mobile&key="); + sb.Append(GetGoogleMapKey()); + + HttpWebRequest WebReq = (HttpWebRequest)WebRequest.Create(sb.ToString()); + HttpWebResponse WebResp = (HttpWebResponse)WebReq.GetResponse(); + Stream stream = WebResp.GetResponseStream(); + + Image image = Image.FromStream(stream); + + stream.Close(); + + return image; + } + catch (Exception e) { + throw new Exception(e.Message); + } + } + + // parse the date string coming from the phone and convert it to a .net DateTime format + private string getDateFromJavaDate(string date) { + StringBuilder sb; + if (date.IndexOf("G") > 0) // GMT time + { + sb = new StringBuilder(date.Substring(0, date.IndexOf("G"))); + } + else if (date.IndexOf("U") > 0) // UTC time + { + sb = new StringBuilder(date.Substring(0, date.IndexOf("U"))); + } + else { + sb = new StringBuilder(date); + } + sb.Append(date.Substring(date.Length - 4, 4)); + DateTime dt = DateTime.ParseExact(sb.ToString(), "ddd MMM dd HH:mm:ss yyyy", + System.Globalization.CultureInfo.InvariantCulture); + + return dt.ToString(); + } + + private string GetGoogleMapKey() { // stored in web.config + return ConfigurationManager.AppSettings["GoogleMapKey"]; + } +} diff --git a/GPSTrackerNet/Website/GPSTracker/GetRouteForMap.aspx b/GPSTrackerNet/Website/GPSTracker/GetRouteForMap.aspx new file mode 100755 index 0000000..4c8da4a --- /dev/null +++ b/GPSTrackerNet/Website/GPSTracker/GetRouteForMap.aspx @@ -0,0 +1,2 @@ +<%@ Page Language="C#" AutoEventWireup="true" CodeFile="GetRouteForMap.aspx.cs" Inherits="GetRouteForMap" %> + diff --git a/GPSTrackerNet/Website/GPSTracker/GetRouteForMap.aspx.cs b/GPSTrackerNet/Website/GPSTracker/GetRouteForMap.aspx.cs new file mode 100755 index 0000000..28d5c5e --- /dev/null +++ b/GPSTrackerNet/Website/GPSTracker/GetRouteForMap.aspx.cs @@ -0,0 +1,26 @@ +// Please leave the link below with the source code, thank you. +// http://www.websmithing.com/portal/Programming/tabid/55/articleType/ArticleView/articleId/6/Google-Map-GPS-Cell-Phone-Tracker-Version-2.aspx + +using System; +using System.Data.SqlClient; + +public partial class GetRouteForMap : System.Web.UI.Page +{ + protected void Page_Load(object sender, EventArgs e) + { + string sessionID = Request.QueryString["sessionID"]; + string phoneNumber = Request.QueryString["phoneNumber"]; + + // our helper class to get data + DbXmlReader reader = new DbXmlReader(); + + Response.AppendHeader("Content-Type", "text/xml"); + + // sessionID and phoneNumber are the unique identifiers for routes if the phoneNumber is unique. + // the phoneNumber field is a string field and anything can be put in that field, but for + // uniqueness, the actual phone number should be used + Response.Write(reader.getXmlString("prcGetRouteForMap", + new SqlParameter("@sessionID", sessionID), + new SqlParameter("@phoneNumber", phoneNumber))); + } +} diff --git a/GPSTrackerNet/Website/GPSTracker/GetRoutes.aspx b/GPSTrackerNet/Website/GPSTracker/GetRoutes.aspx new file mode 100755 index 0000000..299e118 --- /dev/null +++ b/GPSTrackerNet/Website/GPSTracker/GetRoutes.aspx @@ -0,0 +1,2 @@ +<%@ Page Language="C#" AutoEventWireup="true" CodeFile="GetRoutes.aspx.cs" Inherits="GetRoutes" %> + diff --git a/GPSTrackerNet/Website/GPSTracker/GetRoutes.aspx.cs b/GPSTrackerNet/Website/GPSTracker/GetRoutes.aspx.cs new file mode 100755 index 0000000..2b4bea6 --- /dev/null +++ b/GPSTrackerNet/Website/GPSTracker/GetRoutes.aspx.cs @@ -0,0 +1,17 @@ +// Please leave the link below with the source code, thank you. +// http://www.websmithing.com/portal/Programming/tabid/55/articleType/ArticleView/articleId/6/Google-Map-GPS-Cell-Phone-Tracker-Version-2.aspx + +using System; + +public partial class GetRoutes : System.Web.UI.Page +{ + protected void Page_Load(object sender, EventArgs e) + { + // our helper class to get data + DbXmlReader reader = new DbXmlReader(); + + Response.AppendHeader("Content-Type", "text/xml"); + + Response.Write(reader.getXmlString("prcGetRoutes")); + } +} diff --git a/GPSTrackerNet/Website/GPSTracker/Web.config b/GPSTrackerNet/Website/GPSTracker/Web.config new file mode 100755 index 0000000..8b7d471 --- /dev/null +++ b/GPSTrackerNet/Website/GPSTracker/Web.config @@ -0,0 +1,14 @@ + + + + + + + + + + + + + + diff --git a/GPSTrackerNet/Website/GPSTracker/images/ajax-loader.gif b/GPSTrackerNet/Website/GPSTracker/images/ajax-loader.gif new file mode 100755 index 0000000..3c2f7c0 --- /dev/null +++ b/GPSTrackerNet/Website/GPSTracker/images/ajax-loader.gif Binary files differ diff --git a/GPSTrackerNet/Website/GPSTracker/images/compassE.jpg b/GPSTrackerNet/Website/GPSTracker/images/compassE.jpg new file mode 100755 index 0000000..e7ef937 --- /dev/null +++ b/GPSTrackerNet/Website/GPSTracker/images/compassE.jpg Binary files differ diff --git a/GPSTrackerNet/Website/GPSTracker/images/compassN.jpg b/GPSTrackerNet/Website/GPSTracker/images/compassN.jpg new file mode 100755 index 0000000..03f4998 --- /dev/null +++ b/GPSTrackerNet/Website/GPSTracker/images/compassN.jpg Binary files differ diff --git a/GPSTrackerNet/Website/GPSTracker/images/compassNE.jpg b/GPSTrackerNet/Website/GPSTracker/images/compassNE.jpg new file mode 100755 index 0000000..fd8d380 --- /dev/null +++ b/GPSTrackerNet/Website/GPSTracker/images/compassNE.jpg Binary files differ diff --git a/GPSTrackerNet/Website/GPSTracker/images/compassNW.jpg b/GPSTrackerNet/Website/GPSTracker/images/compassNW.jpg new file mode 100755 index 0000000..6ef421d --- /dev/null +++ b/GPSTrackerNet/Website/GPSTracker/images/compassNW.jpg Binary files differ diff --git a/GPSTrackerNet/Website/GPSTracker/images/compassS.jpg b/GPSTrackerNet/Website/GPSTracker/images/compassS.jpg new file mode 100755 index 0000000..841f24c --- /dev/null +++ b/GPSTrackerNet/Website/GPSTracker/images/compassS.jpg Binary files differ diff --git a/GPSTrackerNet/Website/GPSTracker/images/compassSE.jpg b/GPSTrackerNet/Website/GPSTracker/images/compassSE.jpg new file mode 100755 index 0000000..1253e8b --- /dev/null +++ b/GPSTrackerNet/Website/GPSTracker/images/compassSE.jpg Binary files differ diff --git a/GPSTrackerNet/Website/GPSTracker/images/compassSW.jpg b/GPSTrackerNet/Website/GPSTracker/images/compassSW.jpg new file mode 100755 index 0000000..62ddf3d --- /dev/null +++ b/GPSTrackerNet/Website/GPSTracker/images/compassSW.jpg Binary files differ diff --git a/GPSTrackerNet/Website/GPSTracker/images/compassW.jpg b/GPSTrackerNet/Website/GPSTracker/images/compassW.jpg new file mode 100755 index 0000000..f694a4d --- /dev/null +++ b/GPSTrackerNet/Website/GPSTracker/images/compassW.jpg Binary files differ diff --git a/GPSTrackerNet/Website/GPSTracker/images/coolblue_small.png b/GPSTrackerNet/Website/GPSTracker/images/coolblue_small.png new file mode 100755 index 0000000..597a53e --- /dev/null +++ b/GPSTrackerNet/Website/GPSTracker/images/coolblue_small.png Binary files differ diff --git a/GPSTrackerNet/Website/GPSTracker/images/coolred_small.png b/GPSTrackerNet/Website/GPSTracker/images/coolred_small.png new file mode 100755 index 0000000..47384e2 --- /dev/null +++ b/GPSTrackerNet/Website/GPSTracker/images/coolred_small.png Binary files differ diff --git a/GPSTrackerNet/Website/GPSTracker/images/coolshadow_small.png b/GPSTrackerNet/Website/GPSTracker/images/coolshadow_small.png new file mode 100755 index 0000000..3a89759 --- /dev/null +++ b/GPSTrackerNet/Website/GPSTracker/images/coolshadow_small.png Binary files differ diff --git a/GPSTrackerNet/Website/GPSTracker/images/cooltransparent_small.png b/GPSTrackerNet/Website/GPSTracker/images/cooltransparent_small.png new file mode 100755 index 0000000..ba7ed91 --- /dev/null +++ b/GPSTrackerNet/Website/GPSTracker/images/cooltransparent_small.png Binary files differ diff --git a/GPSTrackerNet/Website/GPSTracker/javascript/maps2.js b/GPSTrackerNet/Website/GPSTracker/javascript/maps2.js new file mode 100755 index 0000000..5472fd6 --- /dev/null +++ b/GPSTrackerNet/Website/GPSTracker/javascript/maps2.js @@ -0,0 +1,301 @@ +// Please leave the link below with the source code, thank you. +// http://www.websmithing.com/portal/Programming/tabid/55/articleType/ArticleView/articleId/6/Google-Map-GPS-Cell-Phone-Tracker-Version-2.aspx + +function loadRoutes(data, responseCode) { + if (data.length == 0) { + showMessage('There are no routes available to view.'); + map.innerHTML = ''; + } + else { + // get list of routes + var xml = GXml.parse(data); + + var routes = xml.getElementsByTagName("route"); + + // create the first option of the dropdown box + var option = document.createElement('option'); + option.setAttribute('value', '0'); + option.innerHTML = 'Select Route...'; + routeSelect.appendChild(option); + + // iterate through the routes and load them into the dropdwon box. + for (i = 0; i < routes.length; i++) { + var option = document.createElement('option'); + option.setAttribute('value', '?sessionID=' + routes[i].getAttribute("sessionID") + + '&phoneNumber=' + routes[i].getAttribute("phoneNumber")); + option.innerHTML = routes[i].getAttribute("phoneNumber") + " " + routes[i].getAttribute("times"); + routeSelect.appendChild(option); + } + + // need to reset this for firefox + routeSelect.selectedIndex = 0; + + hideWait(); + showMessage('Please select a route below.'); + } + +} + +// this will get the map and route, the route is selected from the dropdown box +function getRouteForMap() { + if (hasMap()) { + showWait('Getting map...'); + var url = 'GetRouteForMap.aspx' + routeSelect.options[routeSelect.selectedIndex].value; + GDownloadUrl(url, loadGPSLocations); + } + else { + alert("Please select a route before trying to refresh map."); + } +} + +// check to see if we have a map loaded, don't want to autorefresh or delete without it +function hasMap() { + if (routeSelect.selectedIndex == 0) { // means no map + return false; + } + else { + return true; + } +} + +function loadGPSLocations(data, responseCode) { + if (data.length == 0) { + showMessage('There is no tracking data to view.'); + map.innerHTML = ''; + } + else { + if (GBrowserIsCompatible()) { + + // create list of GPS data locations from our XML + var xml = GXml.parse(data); + + // markers that we will display on Google map + var markers = xml.getElementsByTagName("locations"); + + // get rid of the wait gif + hideWait(); + + // create new map and add zoom control and type of map control + var map = new GMap2(document.getElementById("map")); + map.addControl(new GSmallMapControl()); + map.addControl(new GMapTypeControl()); + + var length = markers.length; + + // center map on last marker so we can see progress during refreshes + map.setCenter(new GLatLng(parseFloat(markers[length-1].getAttribute("latitude")), + parseFloat(markers[length-1].getAttribute("longitude"))), zoomLevel); + + // interate through all our GPS data, create markers and add them to map + for (var i = 0; i < length; i++) { + var point = new GLatLng(parseFloat(markers[i].getAttribute("latitude")), + parseFloat(markers[i].getAttribute("longitude"))); + + var marker = createMarker(i, length, point, + markers[i].getAttribute("speed"), + markers[i].getAttribute("direction"), + markers[i].getAttribute("distance"), + markers[i].getAttribute("locationMethod"), + markers[i].getAttribute("gpsTime"), + markers[i].getAttribute("phoneNumber"), + markers[i].getAttribute("sessionID"), + markers[i].getAttribute("accuracy"), + markers[i].getAttribute("isLocationValid"), + markers[i].getAttribute("extraInfo")); + + // add markers to map + map.addOverlay(marker); + } + } + + // show route name + showMessage(routeSelect.options[routeSelect.selectedIndex].innerHTML); + } +} + +function createMarker(i, length, point, speed, direction, distance, locationMethod, gpsTime, + phoneNumber, sessionID, accuracy, isLocationValid, extraInfo) { + var icon = new GIcon(); + + // make the most current marker red + if (i == length - 1) { + icon.image = "images/coolred_small.png"; + } + else { + icon.image = "images/coolblue_small.png"; + } + + icon.shadow = "images/coolshadow_small.png"; + icon.iconSize = new GSize(12, 20); + icon.shadowSize = new GSize(22, 20); + icon.iconAnchor = new GPoint(6, 20); + icon.infoWindowAnchor = new GPoint(5, 1); + + var marker = new GMarker(point,icon); + + // this describes how we got our location data, either by satellite or by cell phone tower + var lm = ""; + if (locationMethod == "8") { + lm = "Cell Tower"; + } else if (locationMethod == "327681") { + lm = "Satellite"; + } else { + lm = locationMethod; + } + + var str = ""; + + // when a user clicks on last marker, let them know it's final one + if (i == length - 1) { + str = " Final location"; + } + + // this creates the pop up bubble that displays info when a user clicks on a marker + GEvent.addListener(marker, "click", function() { + marker.openInfoWindowHtml( + "" + + "" + + "" + + "" + + "" + + "" + + "" + + "" + + "" + + "" + + + "
  " + + "/" + + str + + "
Speed:" + speed + " mph
Distance:" + distance + " mi 
Time:" + gpsTime + "
Method:" + lm + " 
Phone #:" + phoneNumber + " 
Session ID:" + sessionID + " 
Accuracy:" + accuracy + " ft 
Location Valid:" + isLocationValid + " 
Extra Info:" + extraInfo + " 
" + ); + }); + + return marker; +} + +// this chooses the proper image for our litte compass in the popup window +function getCompassImage(azimuth) { + if ((azimuth >= 337 && azimuth <= 360) || (azimuth >= 0 && azimuth < 23)) + return "compassN"; + if (azimuth >= 23 && azimuth < 68) + return "compassNE"; + if (azimuth >= 68 && azimuth < 113) + return "compassE"; + if (azimuth >= 113 && azimuth < 158) + return "compassSE"; + if (azimuth >= 158 && azimuth < 203) + return "compassS"; + if (azimuth >= 203 && azimuth < 248) + return "compassSW"; + if (azimuth >= 248 && azimuth < 293) + return "compassW"; + if (azimuth >= 293 && azimuth < 337) + return "compassNW"; + + return ""; +} + +function deleteRoute() { + if (hasMap()) { + var answer = confirm("This will permanently delete this route\n from the database. Do you want to delete?") + if (answer){ + showWait('Deleting route...'); + var url = 'DeleteRoute.aspx' + routeSelect.options[routeSelect.selectedIndex].value; + GDownloadUrl(url, deleteRouteResponse); + } + else { + return false; + } + } + else { + alert("Please select a route before trying to delete."); + } +} + +function deleteRouteResponse(data, responseCode) { + map.innerHTML = ''; + routeSelect.length = 0; + GDownloadUrl('GetRoutes.aspx', loadRoutes); +} + +// auto refresh the map. there are 3 transitions (shown below). transitions happen when a user +// selects an option in the auto refresh dropdown box. an interval is an amount of time in between +// refreshes of the map. for instance, auto refresh once a minute. in the method below, the 3 numbers +// in the code show where the 3 transitions are handled. setInterval turns on a timer that calls +// the getRouteForMap() method every so many seconds based on the value of newInterval. +// clearInterval turns off the timer. if newInterval is 5, then the value passed to setInterval is +// 5000 milliseconds or 5 seconds. +function autoRefresh() { + /* + 1) going from off to any interval + 2) going from any interval to off + 3) going from one interval to another + */ + + if (hasMap()) { + newInterval = refreshSelect.options[refreshSelect.selectedIndex].value; + + if (currentInterval > 0) { // currently running at an interval + + if (newInterval > 0) { // moving to another interval (3) + clearInterval(intervalID); + intervalID = setInterval("getRouteForMap();", newInterval * 1000); + currentInterval = newInterval; + } + else { // we are turning off (2) + clearInterval(intervalID); + newInterval = 0; + currentInterval = 0; + } + } + else { // off and going to an interval (1) + intervalID = setInterval("getRouteForMap();", newInterval * 1000); + currentInterval = newInterval; + } + + // show what auto refresh action was taken and after 5 seconds, display the route name again + showMessage(refreshSelect.options[refreshSelect.selectedIndex].innerHTML); + setTimeout('showRouteName();', 5000); + } + else { + alert("Please select a route before trying to refresh map."); + refreshSelect.selectedIndex = 0; + } +} + +function changeZoomLevel() { + if (hasMap()) { + zoomLevel = zoomLevelSelect.selectedIndex + 1; + + getRouteForMap(); + + // show what zoom level action was taken and after 5 seconds, display the route name again + showMessage(zoomLevelSelect.options[zoomLevelSelect.selectedIndex].innerHTML); + setTimeout('showRouteName();', 5000); + } + else { + alert("Please select a route before selecting zoom level."); + zoomLevelSelect.selectedIndex = zoomLevel - 1; + } +} + +function showMessage(message) { + messages.innerHTML = 'GPS Tracker: ' + message + ''; +} + +function showRouteName() { + showMessage(routeSelect.options[routeSelect.selectedIndex].innerHTML); +} + +function showWait(theMessage) { + map.innerHTML = ''; + showMessage(theMessage); +} + +function hideWait() { + map.innerHTML = ''; + messages.innerHTML = 'GPS Tracker'; +} + diff --git a/GPSTrackerNet/Website/GPSTracker/phone/Download.aspx b/GPSTrackerNet/Website/GPSTracker/phone/Download.aspx new file mode 100755 index 0000000..ef09228 --- /dev/null +++ b/GPSTrackerNet/Website/GPSTracker/phone/Download.aspx @@ -0,0 +1,19 @@ +<%@ Page Language="C#" AutoEventWireup="true" CodeFile="Download.aspx.cs" Inherits="phone_Download" %> + + + + + + Untitled Page + + +
+
+ GPS Tracker download for cell phones. +
+ GPST2.0.jad + +
+
+ + diff --git a/GPSTrackerNet/Website/GPSTracker/phone/Download.aspx.cs b/GPSTrackerNet/Website/GPSTracker/phone/Download.aspx.cs new file mode 100755 index 0000000..b53aa76 --- /dev/null +++ b/GPSTrackerNet/Website/GPSTracker/phone/Download.aspx.cs @@ -0,0 +1,18 @@ +using System; +using System.Data; +using System.Configuration; +using System.Collections; +using System.Web; +using System.Web.Security; +using System.Web.UI; +using System.Web.UI.WebControls; +using System.Web.UI.WebControls.WebParts; +using System.Web.UI.HtmlControls; + +public partial class phone_Download : System.Web.UI.Page +{ + protected void Page_Load(object sender, EventArgs e) + { + + } +} diff --git a/GPSTrackerNet/Website/GPSTracker/phone/GPST2.0.jad b/GPSTrackerNet/Website/GPSTracker/phone/GPST2.0.jad new file mode 100755 index 0000000..1ccf57c --- /dev/null +++ b/GPSTrackerNet/Website/GPSTracker/phone/GPST2.0.jad @@ -0,0 +1,11 @@ +MIDlet-1: GPSTracker,/res/gps32.png,GPSTracker +MIDlet-Icon: /res/gps32.png +MIDlet-Info-URL: www.websmithing.com +MIDlet-Jar-Size: 9179 +MIDlet-Jar-URL: GPST2.0.jar +MIDlet-Name: GPSTracker2.0 +MIDlet-Permissions: javax.microedition.io.Connector.http, javax.microedition.location.Location +MIDlet-Vendor: Websmithing +MIDlet-Version: 2.0 +MicroEdition-Configuration: CLDC-1.1 +MicroEdition-Profile: MIDP-2.0 diff --git a/GPSTrackerNet/Website/GPSTracker/styles/styles.css b/GPSTrackerNet/Website/GPSTracker/styles/styles.css new file mode 100755 index 0000000..ed7f8d8 --- /dev/null +++ b/GPSTrackerNet/Website/GPSTracker/styles/styles.css @@ -0,0 +1,71 @@ +/* +Please leave the link below with the source code, thank you. +http://www.websmithing.com/portal/Programming/tabid/55/articleType/ArticleView/articleId/6/Google-Map-GPS-Cell-Phone-Tracker-Version-2.aspx +*/ + +* { + margin: 0; + padding: 0; +} +body { + font-family: arial, helvetica, sans-serif; +} +#messages +{ + position:absolute; + left: 10px; + top: 10px; + width:700px; +} +#map +{ + position:absolute; + left: 10px; + top: 40px; + width:700px; + height:450px; + border:1px; + border-style:solid; + background-color:#FFF; +} + +#selectRoute +{ + position:absolute; + left: 10px; + top: 510px; + width: 575px; +} + +#selectRefresh +{ + position:absolute; + left: 10px; + top: 550px; + width: 250px; +} + +#selectZoomLevel +{ + position:absolute; + left: 335px; + top: 550px; + width: 250px; +} + +#delete +{ + position:absolute; + left: 625px; + top: 510px; + width: 75px; +} + +#refresh +{ + position:absolute; + left: 625px; + top: 550px; + width: 75px; +} + diff --git a/GPSTrackerPhp/Database/GPSTracker2.sql b/GPSTrackerPhp/Database/GPSTracker2.sql new file mode 100755 index 0000000..24a1270 --- /dev/null +++ b/GPSTrackerPhp/Database/GPSTracker2.sql @@ -0,0 +1,273 @@ +-- MySQL Administrator dump 1.4 +-- +-- ------------------------------------------------------ +-- Server version 5.1.11-beta-log + + +/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */; +/*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */; +/*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */; +/*!40101 SET NAMES utf8 */; + +/*!40014 SET @OLD_UNIQUE_CHECKS=@@UNIQUE_CHECKS, UNIQUE_CHECKS=0 */; +/*!40014 SET @OLD_FOREIGN_KEY_CHECKS=@@FOREIGN_KEY_CHECKS, FOREIGN_KEY_CHECKS=0 */; +/*!40101 SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE='NO_AUTO_VALUE_ON_ZERO' */; + + +-- +-- Create schema gpstracker2 +-- + +CREATE DATABASE IF NOT EXISTS gpstracker2; +USE gpstracker2; + +-- +-- Definition of table `gpslocations2` +-- + +DROP TABLE IF EXISTS `gpslocations2`; +CREATE TABLE `gpslocations2` ( + `GPSLocationID` int(10) unsigned NOT NULL AUTO_INCREMENT, + `LastUpdate` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP, + `Latitude` decimal(10,6) NOT NULL DEFAULT '0.000000', + `Longitude` decimal(10,6) NOT NULL DEFAULT '0.000000', + `phoneNumber` varchar(20) NOT NULL, + `sessionID` varchar(25) NOT NULL, + `speed` int(10) unsigned NOT NULL, + `direction` int(10) unsigned NOT NULL, + `distance` int(10) unsigned NOT NULL, + `gpsTime` timestamp NOT NULL DEFAULT '0000-00-00 00:00:00', + `LocationMethod` varchar(100) NOT NULL DEFAULT '', + `accuracy` int(10) unsigned NOT NULL, + `isLocationValid` varchar(5) NOT NULL, + `extraInfo` varchar(255) NOT NULL, + PRIMARY KEY (`GPSLocationID`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8; + +-- +-- Dumping data for table `gpslocations2` +-- + +/*!40000 ALTER TABLE `gpslocations2` DISABLE KEYS */; +INSERT INTO `gpslocations2` (`GPSLocationID`,`LastUpdate`,`Latitude`,`Longitude`,`phoneNumber`,`sessionID`,`speed`,`direction`,`distance`,`gpsTime`,`LocationMethod`,`accuracy`,`isLocationValid`,`extraInfo`) VALUES + (4,'2008-04-16 14:59:52','47.473349','-122.025035','molly','1208372106690',0,0,0,'2008-04-16 11:59:51','8',0,'0','Invalid Location: Time out, fix unattainable and assist unavailable.'), + (12,'2008-04-16 15:09:04','47.446123','-121.988437','molly','1208372106690',0,139,3,'2008-04-16 12:09:03','327681',70,'1','Valid Location.'), + (13,'2008-04-16 15:10:13','47.437515','-121.978176','molly','1208372106690',44,141,4,'2008-04-16 12:10:11','327681',44,'1','Valid Location.'), + (14,'2008-04-16 15:11:16','47.433877','-121.973387','molly','1208372106690',24,138,4,'2008-04-16 12:11:14','327681',52,'1','Valid Location.'), + (15,'2008-04-16 15:12:20','47.436571','-121.967061','molly','1208372106690',49,57,4,'2008-04-16 12:12:19','327681',44,'1','Valid Location.'), + (16,'2008-04-16 15:13:38','47.449381','-121.958283','molly','1208372106690',45,24,5,'2008-04-16 12:13:34','327681',132,'1','Valid Location.'), + (17,'2008-04-16 15:14:51','47.461755','-121.945067','molly','1208372106690',52,35,6,'2008-04-16 12:14:51','327681',70,'1','Valid Location.'), + (18,'2008-04-16 15:15:54','47.465712','-121.928203','molly','1208372106690',0,70,7,'2008-04-16 12:15:53','327681',52,'1','Valid Location.'), + (19,'2008-04-16 15:17:06','47.473136','-121.906763','molly','1208372106690',55,62,8,'2008-04-16 12:17:06','327681',117,'1','Valid Location.'), + (20,'2008-04-16 15:18:29','47.484347','-121.889056','molly','1208372106690',56,46,9,'2008-04-16 12:18:27','327681',104,'1','Valid Location.'), + (21,'2008-04-16 15:19:35','47.499045','-121.885739','molly','1208372106690',0,8,10,'2008-04-16 12:19:33','327681',60,'1','Valid Location.'), + (22,'2008-04-16 15:20:37','47.508517','-121.880395','molly','1208372106690',51,20,11,'2008-04-16 12:20:35','327681',91,'1','Valid Location.'), + (23,'2008-04-16 15:21:37','47.510901','-121.857973','molly','1208372106690',69,81,12,'2008-04-16 12:21:35','327681',52,'1','Valid Location.'), + (24,'2008-04-16 15:22:55','47.508485','-121.829131','molly','1208372106690',68,97,14,'2008-04-16 12:22:55','327681',70,'1','Valid Location.'), + (25,'2008-04-16 15:24:07','47.494528','-121.811840','molly','1208372106690',57,140,15,'2008-04-16 12:24:06','327681',70,'1','Valid Location.'), + (26,'2008-04-16 15:25:08','47.485893','-121.794368','molly','1208372106690',60,126,16,'2008-04-16 12:25:07','327681',80,'1','Valid Location.'), + (27,'2008-04-16 15:26:09','47.473557','-121.779776','molly','1208372106690',69,141,17,'2008-04-16 12:26:08','327681',104,'1','Valid Location.'), + (28,'2008-04-16 15:27:21','47.473323','-121.749280','molly','1208372106690',62,90,18,'2008-04-16 12:27:21','327681',132,'1','Valid Location.'), + (29,'2008-04-16 15:28:24','47.468064','-121.725557','molly','1208372106690',70,108,20,'2008-04-16 12:28:24','327681',70,'1','Valid Location.'), + (30,'2008-04-16 15:29:31','47.458677','-121.703264','molly','1208372106690',0,121,21,'2008-04-16 12:29:30','327681',132,'1','Valid Location.'), + (31,'2008-04-16 15:30:31','47.444704','-121.691840','molly','1208372106690',69,151,22,'2008-04-16 12:30:30','327681',70,'1','Valid Location.'), + (32,'2008-04-16 15:31:37','47.443136','-121.664373','molly','1208372106690',65,94,23,'2008-04-16 12:31:36','327681',80,'1','Valid Location.'), + (33,'2008-04-16 15:32:42','47.434107','-121.641504','molly','1208372106690',50,120,24,'2008-04-16 12:32:41','327681',149,'1','Valid Location.'), + (34,'2008-04-16 15:33:52','47.429093','-121.615371','molly','1208372106690',67,105,26,'2008-04-16 12:33:50','327681',91,'1','Valid Location.'), + (35,'2008-04-16 15:34:56','47.421152','-121.592448','molly','1208372106690',52,117,27,'2008-04-16 12:34:56','327681',104,'1','Valid Location.'), + (36,'2008-04-16 15:35:57','47.409291','-121.576128','molly','1208372106690',65,137,28,'2008-04-16 12:35:57','327681',104,'1','Valid Location.'), + (37,'2008-04-16 15:37:10','47.399184','-121.551893','molly','1208372106690',68,121,29,'2008-04-16 12:37:08','327681',70,'1','Valid Location.'), + (38,'2008-04-16 15:38:12','47.395051','-121.527936','molly','1208372106690',68,104,31,'2008-04-16 12:38:11','327681',104,'1','Valid Location.'), + (39,'2008-04-16 15:39:15','47.396219','-121.501365','molly','1208372106690',69,86,32,'2008-04-16 12:39:13','327681',132,'1','Valid Location.'), + (40,'2008-04-16 15:40:17','47.395040','-121.480896','molly','1208372106690',1,94,33,'2008-04-16 12:40:17','327681',91,'1','Valid Location.'), + (41,'2008-04-16 15:41:42','47.392939','-121.481472','molly','1208372106690',0,190,33,'2008-04-16 12:41:42','327681',132,'1','Valid Location.'), + (42,'2008-04-16 15:43:13','47.393259','-121.482144','molly','1208372106690',0,304,33,'2008-04-16 12:43:12','327681',167,'0','Invalid Location: Time out, accuracy unattainable.'), + (43,'2008-04-16 15:44:44','47.394752','-121.480875','molly','1208372106690',18,29,33,'2008-04-16 12:44:44','327681',149,'1','Valid Location.'), + (44,'2008-04-16 15:47:53','47.397093','-121.492501','molly','1208372106690',68,286,34,'2008-04-16 12:47:51','327681',104,'1','Valid Location.'), + (45,'2008-04-16 15:51:23','47.413760','-121.589707','molly','1208372106690',0,284,38,'2008-04-16 12:51:21','8',0,'0','Invalid Location: Time out, fix unattainable and assist unavailable.'), + (46,'2008-04-16 15:54:39','47.433429','-121.640171','molly','1208372106690',54,299,41,'2008-04-16 12:54:37','327681',80,'1','Valid Location.'), + (47,'2008-04-16 15:57:53','47.458203','-121.702464','molly','1208372106690',0,300,44,'2008-04-16 12:57:53','327681',132,'1','Valid Location.'), + (48,'2008-04-16 16:01:26','47.474885','-121.777867','molly','1208372106690',0,288,48,'2008-04-16 13:01:14','327681',117,'1','Valid Location.'), + (49,'2008-04-16 16:04:46','47.488192','-121.794773','molly','1208372106690',0,319,49,'2008-04-16 13:04:45','327681',167,'0','Invalid Location: Time out, accuracy unattainable.'), + (50,'2008-04-16 16:07:52','47.489733','-121.794005','molly','1208372106690',28,18,49,'2008-04-16 13:07:50','327681',91,'1','Valid Location.'), + (51,'2008-04-16 16:11:01','47.501344','-121.791584','molly','1208372106690',37,8,50,'2008-04-16 13:11:00','327681',44,'1','Valid Location.'), + (52,'2008-04-16 16:14:34','47.508368','-121.816128','molly','1208372106690',48,292,52,'2008-04-16 13:14:31','327681',70,'1','Valid Location.'), + (53,'2008-04-16 16:17:36','47.525760','-121.823083','molly','1208372106690',28,344,53,'2008-04-16 13:17:34','327681',44,'1','Valid Location.'), + (54,'2008-04-16 16:20:59','47.543280','-121.836917','molly','1208372106690',0,331,54,'2008-04-16 13:20:58','327681',91,'1','Valid Location.'), + (55,'2008-04-16 16:24:25','47.543163','-121.837067','molly','1208372106690',0,220,54,'2008-04-16 13:24:24','327681',70,'1','Valid Location.'), + (56,'2008-04-16 16:27:28','47.543131','-121.836789','molly','1208372106690',0,99,54,'2008-04-16 13:27:26','327681',117,'1','Valid Location.'), + (57,'2008-04-16 16:30:43','47.534421','-121.840096','molly','1208372106690',40,194,55,'2008-04-16 13:30:41','327681',149,'1','Valid Location.'), + (58,'2008-04-16 16:33:56','47.523504','-121.880160','molly','1208372106690',35,248,57,'2008-04-16 13:33:54','327681',70,'1','Valid Location.'), + (59,'2008-04-16 16:37:25','47.489925','-121.887755','molly','1208372106690',57,188,59,'2008-04-16 13:37:23','327681',209,'0','Invalid Location: Time out, accuracy unattainable.'), + (60,'2008-04-16 16:40:28','47.466347','-121.930624','molly','1208372106690',2,230,62,'2008-04-16 13:40:27','327681',60,'1','Valid Location.'), + (61,'2008-04-16 16:43:49','47.458864','-121.948907','molly','1208372106690',49,238,63,'2008-04-16 13:43:48','327681',132,'1','Valid Location.'), + (62,'2008-04-16 16:45:42','47.436240','-121.967989','molly','1208372106690',50,209,65,'2008-04-16 13:45:42','327681',149,'1','Valid Location.'), + (63,'2008-04-16 16:47:58','47.444427','-121.973024','molly','1208372106690',0,337,65,'2008-04-16 13:47:56','327681',80,'1','Valid Location.'), + (64,'2008-04-16 16:50:03','47.459573','-121.980085','molly','1208372106690',27,342,66,'2008-04-16 13:50:02','327681',117,'1','Valid Location.'), + (65,'2008-04-16 16:52:14','47.472827','-121.993173','molly','1208372106690',0,326,67,'2008-04-16 13:52:13','327681',91,'1','Valid Location.'), + (68,'2008-04-16 16:59:29','47.476933','-122.021419','molly','1208372106690',0,34,69,'2008-04-16 13:59:28','327681',260,'0','Invalid Location: Time out, accuracy unattainable.'), + (69,'2008-04-17 13:46:16','47.473307','-122.024693','206-555-1212','1208454364321',0,0,0,'2008-04-17 10:46:15','327681',80,'1','Valid Location.'), + (70,'2008-04-17 13:48:20','47.461216','-122.026219','206-555-1212','1208454364321',0,184,0,'2008-04-17 10:48:17','327681',70,'1','Valid Location.'), + (71,'2008-04-17 13:50:33','47.445077','-122.046645','206-555-1212','1208454364321',36,220,2,'2008-04-17 10:50:31','327681',91,'1','Valid Location.'), + (72,'2008-04-17 13:52:33','47.438731','-122.066048','206-555-1212','1208454364321',0,244,3,'2008-04-17 10:52:33','327681',25,'1','Valid Location.'), + (73,'2008-04-17 13:54:45','47.424661','-122.051755','206-555-1212','1208454364321',0,145,4,'2008-04-17 10:54:43','327681',80,'1','Valid Location.'), + (74,'2008-04-17 13:56:49','47.406597','-122.038752','206-555-1212','1208454364321',25,154,5,'2008-04-17 10:56:48','327681',44,'1','Valid Location.'), + (75,'2008-04-17 13:58:56','47.394085','-122.049120','206-555-1212','1208454364321',0,209,6,'2008-04-17 10:58:55','327681',80,'1','Valid Location.'), + (76,'2008-04-17 14:01:05','47.377595','-122.081067','206-555-1212','1208454364321',61,232,8,'2008-04-17 11:01:04','327681',104,'1','Valid Location.'), + (77,'2008-04-17 14:03:05','47.361323','-122.116469','206-555-1212','1208454364321',59,235,10,'2008-04-17 11:03:05','327681',52,'1','Valid Location.'), + (78,'2008-04-17 14:05:16','47.358016','-122.115115','206-555-1212','1208454364321',0,164,11,'2008-04-17 11:05:15','327681',117,'1','Valid Location.'), + (79,'2008-04-17 14:07:23','47.357627','-122.109707','206-555-1212','1208454364321',6,96,11,'2008-04-17 11:07:22','327681',60,'1','Valid Location.'), + (80,'2008-04-17 14:42:29','47.357115','-122.114773','3b','1208457732980',0,0,0,'2008-04-17 11:42:22','327681',70,'1','Valid Location.'), + (81,'2008-04-17 14:44:32','47.358101','-122.115307','3b','1208457732980',25,339,0,'2008-04-17 11:44:32','327681',70,'1','Valid Location.'), + (82,'2008-04-17 14:46:44','47.371355','-122.094517','3b','1208457732980',53,46,1,'2008-04-17 11:46:43','327681',52,'1','Valid Location.'), + (83,'2008-04-17 14:48:44','47.387616','-122.058048','3b','1208457732980',59,56,3,'2008-04-17 11:48:44','327681',52,'1','Valid Location.'), + (84,'2008-04-17 14:50:46','47.409472','-122.032917','3b','1208457732980',60,37,5,'2008-04-17 11:50:45','327681',80,'1','Valid Location.'), + (85,'2008-04-17 14:52:55','47.425824','-121.991819','3b','1208457732980',59,59,7,'2008-04-17 11:52:54','327681',44,'1','Valid Location.'), + (86,'2008-04-17 14:55:22','47.442251','-121.985579','3b','1208457732980',42,14,8,'2008-04-17 11:55:20','327681',60,'1','Valid Location.'), + (87,'2008-04-17 14:57:27','47.459232','-122.005856','3b','1208457732980',39,321,10,'2008-04-17 11:57:27','327681',132,'1','Valid Location.'), + (88,'2008-04-17 14:59:34','47.475531','-122.026176','3b','1208457732980',8,319,11,'2008-04-17 11:59:33','327681',80,'1','Valid Location.'), + (89,'2008-04-17 15:02:05','47.473349','-122.025035','3b','1208457732980',0,160,11,'2008-04-17 12:02:03','8',0,'0','Invalid Location: Time out, fix unattainable and assist unavailable.'), + (90,'2008-04-17 15:04:34','47.473349','-122.025035','3b','1208457732980',0,0,11,'2008-04-17 12:04:32','8',0,'0','Invalid Location: Time out, fix unattainable and assist unavailable.'), + (91,'2008-04-17 15:07:03','47.473349','-122.025035','3b','1208457732980',0,0,11,'2008-04-17 12:07:02','8',0,'0','Invalid Location: Time out, fix unattainable and assist unavailable.'); +/*!40000 ALTER TABLE `gpslocations2` ENABLE KEYS */; + + +-- +-- Definition of procedure `prcDeleteRoute` +-- + +DROP PROCEDURE IF EXISTS `prcDeleteRoute`; + +DELIMITER $$ + +/*!50003 SET @TEMP_SQL_MODE=@@SQL_MODE, SQL_MODE='' */ $$ +CREATE DEFINER=`root`@`localhost` PROCEDURE `prcDeleteRoute`( +_sessionID VARCHAR(20), +_phoneNumber VARCHAR(25) +) +BEGIN + DELETE FROM gpslocations2 + WHERE sessionID = _sessionID + AND phoneNumber = _phoneNumber + ORDER BY lastupdate; +END $$ +/*!50003 SET SESSION SQL_MODE=@TEMP_SQL_MODE */ $$ + +DELIMITER ; + +-- +-- Definition of procedure `prcGetRouteForMap` +-- + +DROP PROCEDURE IF EXISTS `prcGetRouteForMap`; + +DELIMITER $$ + +/*!50003 SET @TEMP_SQL_MODE=@@SQL_MODE, SQL_MODE='' */ $$ +CREATE DEFINER=`root`@`localhost` PROCEDURE `prcGetRouteForMap`( +_sessionID VARCHAR(20), +_phoneNumber VARCHAR(25) +) +BEGIN + SELECT + CONCAT('') xml + FROM gpslocations2 + WHERE sessionID = _sessionID + AND phoneNumber = _phoneNumber + ORDER BY lastupdate; +END $$ +/*!50003 SET SESSION SQL_MODE=@TEMP_SQL_MODE */ $$ + +DELIMITER ; + +-- +-- Definition of procedure `prcGetRoutes` +-- + +DROP PROCEDURE IF EXISTS `prcGetRoutes`; + +DELIMITER $$ + +/*!50003 SET @TEMP_SQL_MODE=@@SQL_MODE, SQL_MODE='' */ $$ +CREATE DEFINER=`root`@`localhost` PROCEDURE `prcGetRoutes`() +BEGIN + CREATE TEMPORARY TABLE tempRoutes ( + sessionID VARCHAR(25), + phoneNumber VARCHAR(20), + startTime DATETIME, + endTime DATETIME) + ENGINE = MEMORY; + + INSERT INTO tempRoutes (sessionID, phoneNumber) + SELECT DISTINCT sessionID, phoneNumber + FROM gpslocations2; + + UPDATE tempRoutes tr + SET startTime = (SELECT MIN(gpsTime) FROM gpslocations2 gl + WHERE gl.sessionID = tr.sessionID + AND gl.phoneNumber = tr.phoneNumber); + + UPDATE tempRoutes tr + SET endTime = (SELECT MAX(gpsTime) FROM gpslocations2 gl + WHERE gl.sessionID = tr.sessionID + AND gl.phoneNumber = tr.phoneNumber); + + SELECT + CONCAT('') + FROM tempRoutes + ORDER BY phoneNumber; + + DROP TABLE tempRoutes; +END $$ +/*!50003 SET SESSION SQL_MODE=@TEMP_SQL_MODE */ $$ + +DELIMITER ; + +-- +-- Definition of procedure `prcSaveGPSLocation2` +-- + +DROP PROCEDURE IF EXISTS `prcSaveGPSLocation2`; + +DELIMITER $$ + +/*!50003 SET @TEMP_SQL_MODE=@@SQL_MODE, SQL_MODE='' */ $$ +CREATE DEFINER=`root`@`localhost` PROCEDURE `prcSaveGPSLocation2`( +_lat VARCHAR(45), +_lng VARCHAR(45), +_mph VARCHAR(45), +_direction VARCHAR(45), +_distance VARCHAR(45), +_date VARCHAR(100), +_locationMethod VARCHAR(100), +_phoneNumber VARCHAR(20), +_sessionID VARCHAR(50), +_accuracy VARCHAR(20), +_locationIsValid VARCHAR(5), +_extraInfo VARCHAR(255) +) +BEGIN + INSERT INTO gpslocations2 (latitude, longitude, speed, direction, distance, gpsTime, locationMethod, + phoneNumber, sessionID, accuracy, isLocationValid, extraInfo) + VALUES (_lat, _lng, _mph, _direction, _distance, _date, _locationMethod, + _phoneNumber, _sessionID, _accuracy, _locationIsValid, _extraInfo); +END $$ +/*!50003 SET SESSION SQL_MODE=@TEMP_SQL_MODE */ $$ + +DELIMITER ; + + + +/*!40101 SET SQL_MODE=@OLD_SQL_MODE */; +/*!40014 SET FOREIGN_KEY_CHECKS=@OLD_FOREIGN_KEY_CHECKS */; +/*!40014 SET UNIQUE_CHECKS=@OLD_UNIQUE_CHECKS */; +/*!40101 SET CHARACTER_SET_CLIENT=@OLD_CHARACTER_SET_CLIENT */; +/*!40101 SET CHARACTER_SET_RESULTS=@OLD_CHARACTER_SET_RESULTS */; +/*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */; +/*!40101 SET CHARACTER_SET_CLIENT=@OLD_CHARACTER_SET_CLIENT */; diff --git a/GPSTrackerPhp/Database/data.sql b/GPSTrackerPhp/Database/data.sql new file mode 100755 index 0000000..01cc755 --- /dev/null +++ b/GPSTrackerPhp/Database/data.sql @@ -0,0 +1,80 @@ +INSERT INTO `gpslocations2` (`GPSLocationID`, `LastUpdate`, `Latitude`, `Longitude`, `phoneNumber`, `sessionID`, `speed`, `direction`, `distance`, `gpsTime`, `LocationMethod`, `accuracy`, `isLocationValid`, `extraInfo`) VALUES +(4, '2008-04-16 14:59:52', 47.473349, -122.025035, 'molly', '1208372106690', 0, 0, 0, '2008-04-16 11:59:51', '8', 0, '0', 'Invalid Location: Time out, fix unattainable and assist unavailable.'), +(12, '2008-04-16 15:09:04', 47.446123, -121.988437, 'molly', '1208372106690', 0, 139, 3, '2008-04-16 12:09:03', '327681', 70, '1', 'Valid Location.'), +(13, '2008-04-16 15:10:13', 47.437515, -121.978176, 'molly', '1208372106690', 44, 141, 4, '2008-04-16 12:10:11', '327681', 44, '1', 'Valid Location.'), +(14, '2008-04-16 15:11:16', 47.433877, -121.973387, 'molly', '1208372106690', 24, 138, 4, '2008-04-16 12:11:14', '327681', 52, '1', 'Valid Location.'), +(15, '2008-04-16 15:12:20', 47.436571, -121.967061, 'molly', '1208372106690', 49, 57, 4, '2008-04-16 12:12:19', '327681', 44, '1', 'Valid Location.'), +(16, '2008-04-16 15:13:38', 47.449381, -121.958283, 'molly', '1208372106690', 45, 24, 5, '2008-04-16 12:13:34', '327681', 132, '1', 'Valid Location.'), +(17, '2008-04-16 15:14:51', 47.461755, -121.945067, 'molly', '1208372106690', 52, 35, 6, '2008-04-16 12:14:51', '327681', 70, '1', 'Valid Location.'), +(18, '2008-04-16 15:15:54', 47.465712, -121.928203, 'molly', '1208372106690', 0, 70, 7, '2008-04-16 12:15:53', '327681', 52, '1', 'Valid Location.'), +(19, '2008-04-16 15:17:06', 47.473136, -121.906763, 'molly', '1208372106690', 55, 62, 8, '2008-04-16 12:17:06', '327681', 117, '1', 'Valid Location.'), +(20, '2008-04-16 15:18:29', 47.484347, -121.889056, 'molly', '1208372106690', 56, 46, 9, '2008-04-16 12:18:27', '327681', 104, '1', 'Valid Location.'), +(21, '2008-04-16 15:19:35', 47.499045, -121.885739, 'molly', '1208372106690', 0, 8, 10, '2008-04-16 12:19:33', '327681', 60, '1', 'Valid Location.'), +(22, '2008-04-16 15:20:37', 47.508517, -121.880395, 'molly', '1208372106690', 51, 20, 11, '2008-04-16 12:20:35', '327681', 91, '1', 'Valid Location.'), +(23, '2008-04-16 15:21:37', 47.510901, -121.857973, 'molly', '1208372106690', 69, 81, 12, '2008-04-16 12:21:35', '327681', 52, '1', 'Valid Location.'), +(24, '2008-04-16 15:22:55', 47.508485, -121.829131, 'molly', '1208372106690', 68, 97, 14, '2008-04-16 12:22:55', '327681', 70, '1', 'Valid Location.'), +(25, '2008-04-16 15:24:07', 47.494528, -121.811840, 'molly', '1208372106690', 57, 140, 15, '2008-04-16 12:24:06', '327681', 70, '1', 'Valid Location.'), +(26, '2008-04-16 15:25:08', 47.485893, -121.794368, 'molly', '1208372106690', 60, 126, 16, '2008-04-16 12:25:07', '327681', 80, '1', 'Valid Location.'), +(27, '2008-04-16 15:26:09', 47.473557, -121.779776, 'molly', '1208372106690', 69, 141, 17, '2008-04-16 12:26:08', '327681', 104, '1', 'Valid Location.'), +(28, '2008-04-16 15:27:21', 47.473323, -121.749280, 'molly', '1208372106690', 62, 90, 18, '2008-04-16 12:27:21', '327681', 132, '1', 'Valid Location.'), +(29, '2008-04-16 15:28:24', 47.468064, -121.725557, 'molly', '1208372106690', 70, 108, 20, '2008-04-16 12:28:24', '327681', 70, '1', 'Valid Location.'), +(30, '2008-04-16 15:29:31', 47.458677, -121.703264, 'molly', '1208372106690', 0, 121, 21, '2008-04-16 12:29:30', '327681', 132, '1', 'Valid Location.'), +(31, '2008-04-16 15:30:31', 47.444704, -121.691840, 'molly', '1208372106690', 69, 151, 22, '2008-04-16 12:30:30', '327681', 70, '1', 'Valid Location.'), +(32, '2008-04-16 15:31:37', 47.443136, -121.664373, 'molly', '1208372106690', 65, 94, 23, '2008-04-16 12:31:36', '327681', 80, '1', 'Valid Location.'), +(33, '2008-04-16 15:32:42', 47.434107, -121.641504, 'molly', '1208372106690', 50, 120, 24, '2008-04-16 12:32:41', '327681', 149, '1', 'Valid Location.'), +(34, '2008-04-16 15:33:52', 47.429093, -121.615371, 'molly', '1208372106690', 67, 105, 26, '2008-04-16 12:33:50', '327681', 91, '1', 'Valid Location.'), +(35, '2008-04-16 15:34:56', 47.421152, -121.592448, 'molly', '1208372106690', 52, 117, 27, '2008-04-16 12:34:56', '327681', 104, '1', 'Valid Location.'), +(36, '2008-04-16 15:35:57', 47.409291, -121.576128, 'molly', '1208372106690', 65, 137, 28, '2008-04-16 12:35:57', '327681', 104, '1', 'Valid Location.'), +(37, '2008-04-16 15:37:10', 47.399184, -121.551893, 'molly', '1208372106690', 68, 121, 29, '2008-04-16 12:37:08', '327681', 70, '1', 'Valid Location.'), +(38, '2008-04-16 15:38:12', 47.395051, -121.527936, 'molly', '1208372106690', 68, 104, 31, '2008-04-16 12:38:11', '327681', 104, '1', 'Valid Location.'), +(39, '2008-04-16 15:39:15', 47.396219, -121.501365, 'molly', '1208372106690', 69, 86, 32, '2008-04-16 12:39:13', '327681', 132, '1', 'Valid Location.'), +(40, '2008-04-16 15:40:17', 47.395040, -121.480896, 'molly', '1208372106690', 1, 94, 33, '2008-04-16 12:40:17', '327681', 91, '1', 'Valid Location.'), +(41, '2008-04-16 15:41:42', 47.392939, -121.481472, 'molly', '1208372106690', 0, 190, 33, '2008-04-16 12:41:42', '327681', 132, '1', 'Valid Location.'), +(42, '2008-04-16 15:43:13', 47.393259, -121.482144, 'molly', '1208372106690', 0, 304, 33, '2008-04-16 12:43:12', '327681', 167, '0', 'Invalid Location: Time out, accuracy unattainable.'), +(43, '2008-04-16 15:44:44', 47.394752, -121.480875, 'molly', '1208372106690', 18, 29, 33, '2008-04-16 12:44:44', '327681', 149, '1', 'Valid Location.'), +(44, '2008-04-16 15:47:53', 47.397093, -121.492501, 'molly', '1208372106690', 68, 286, 34, '2008-04-16 12:47:51', '327681', 104, '1', 'Valid Location.'), +(45, '2008-04-16 15:51:23', 47.413760, -121.589707, 'molly', '1208372106690', 0, 284, 38, '2008-04-16 12:51:21', '8', 0, '0', 'Invalid Location: Time out, fix unattainable and assist unavailable.'), +(46, '2008-04-16 15:54:39', 47.433429, -121.640171, 'molly', '1208372106690', 54, 299, 41, '2008-04-16 12:54:37', '327681', 80, '1', 'Valid Location.'), +(47, '2008-04-16 15:57:53', 47.458203, -121.702464, 'molly', '1208372106690', 0, 300, 44, '2008-04-16 12:57:53', '327681', 132, '1', 'Valid Location.'), +(48, '2008-04-16 16:01:26', 47.474885, -121.777867, 'molly', '1208372106690', 0, 288, 48, '2008-04-16 13:01:14', '327681', 117, '1', 'Valid Location.'), +(49, '2008-04-16 16:04:46', 47.488192, -121.794773, 'molly', '1208372106690', 0, 319, 49, '2008-04-16 13:04:45', '327681', 167, '0', 'Invalid Location: Time out, accuracy unattainable.'), +(50, '2008-04-16 16:07:52', 47.489733, -121.794005, 'molly', '1208372106690', 28, 18, 49, '2008-04-16 13:07:50', '327681', 91, '1', 'Valid Location.'), +(51, '2008-04-16 16:11:01', 47.501344, -121.791584, 'molly', '1208372106690', 37, 8, 50, '2008-04-16 13:11:00', '327681', 44, '1', 'Valid Location.'), +(52, '2008-04-16 16:14:34', 47.508368, -121.816128, 'molly', '1208372106690', 48, 292, 52, '2008-04-16 13:14:31', '327681', 70, '1', 'Valid Location.'), +(53, '2008-04-16 16:17:36', 47.525760, -121.823083, 'molly', '1208372106690', 28, 344, 53, '2008-04-16 13:17:34', '327681', 44, '1', 'Valid Location.'), +(54, '2008-04-16 16:20:59', 47.543280, -121.836917, 'molly', '1208372106690', 0, 331, 54, '2008-04-16 13:20:58', '327681', 91, '1', 'Valid Location.'), +(55, '2008-04-16 16:24:25', 47.543163, -121.837067, 'molly', '1208372106690', 0, 220, 54, '2008-04-16 13:24:24', '327681', 70, '1', 'Valid Location.'), +(56, '2008-04-16 16:27:28', 47.543131, -121.836789, 'molly', '1208372106690', 0, 99, 54, '2008-04-16 13:27:26', '327681', 117, '1', 'Valid Location.'), +(57, '2008-04-16 16:30:43', 47.534421, -121.840096, 'molly', '1208372106690', 40, 194, 55, '2008-04-16 13:30:41', '327681', 149, '1', 'Valid Location.'), +(58, '2008-04-16 16:33:56', 47.523504, -121.880160, 'molly', '1208372106690', 35, 248, 57, '2008-04-16 13:33:54', '327681', 70, '1', 'Valid Location.'), +(59, '2008-04-16 16:37:25', 47.489925, -121.887755, 'molly', '1208372106690', 57, 188, 59, '2008-04-16 13:37:23', '327681', 209, '0', 'Invalid Location: Time out, accuracy unattainable.'), +(60, '2008-04-16 16:40:28', 47.466347, -121.930624, 'molly', '1208372106690', 2, 230, 62, '2008-04-16 13:40:27', '327681', 60, '1', 'Valid Location.'), +(61, '2008-04-16 16:43:49', 47.458864, -121.948907, 'molly', '1208372106690', 49, 238, 63, '2008-04-16 13:43:48', '327681', 132, '1', 'Valid Location.'), +(62, '2008-04-16 16:45:42', 47.436240, -121.967989, 'molly', '1208372106690', 50, 209, 65, '2008-04-16 13:45:42', '327681', 149, '1', 'Valid Location.'), +(63, '2008-04-16 16:47:58', 47.444427, -121.973024, 'molly', '1208372106690', 0, 337, 65, '2008-04-16 13:47:56', '327681', 80, '1', 'Valid Location.'), +(64, '2008-04-16 16:50:03', 47.459573, -121.980085, 'molly', '1208372106690', 27, 342, 66, '2008-04-16 13:50:02', '327681', 117, '1', 'Valid Location.'), +(65, '2008-04-16 16:52:14', 47.472827, -121.993173, 'molly', '1208372106690', 0, 326, 67, '2008-04-16 13:52:13', '327681', 91, '1', 'Valid Location.'), +(68, '2008-04-16 16:59:29', 47.476933, -122.021419, 'molly', '1208372106690', 0, 34, 69, '2008-04-16 13:59:28', '327681', 260, '0', 'Invalid Location: Time out, accuracy unattainable.'), +(69, '2008-04-17 13:46:16', 47.473307, -122.024693, '206-555-1212', '1208454364321', 0, 0, 0, '2008-04-17 10:46:15', '327681', 80, '1', 'Valid Location.'), +(70, '2008-04-17 13:48:20', 47.461216, -122.026219, '206-555-1212', '1208454364321', 0, 184, 0, '2008-04-17 10:48:17', '327681', 70, '1', 'Valid Location.'), +(71, '2008-04-17 13:50:33', 47.445077, -122.046645, '206-555-1212', '1208454364321', 36, 220, 2, '2008-04-17 10:50:31', '327681', 91, '1', 'Valid Location.'), +(72, '2008-04-17 13:52:33', 47.438731, -122.066048, '206-555-1212', '1208454364321', 0, 244, 3, '2008-04-17 10:52:33', '327681', 25, '1', 'Valid Location.'), +(73, '2008-04-17 13:54:45', 47.424661, -122.051755, '206-555-1212', '1208454364321', 0, 145, 4, '2008-04-17 10:54:43', '327681', 80, '1', 'Valid Location.'), +(74, '2008-04-17 13:56:49', 47.406597, -122.038752, '206-555-1212', '1208454364321', 25, 154, 5, '2008-04-17 10:56:48', '327681', 44, '1', 'Valid Location.'), +(75, '2008-04-17 13:58:56', 47.394085, -122.049120, '206-555-1212', '1208454364321', 0, 209, 6, '2008-04-17 10:58:55', '327681', 80, '1', 'Valid Location.'), +(76, '2008-04-17 14:01:05', 47.377595, -122.081067, '206-555-1212', '1208454364321', 61, 232, 8, '2008-04-17 11:01:04', '327681', 104, '1', 'Valid Location.'), +(77, '2008-04-17 14:03:05', 47.361323, -122.116469, '206-555-1212', '1208454364321', 59, 235, 10, '2008-04-17 11:03:05', '327681', 52, '1', 'Valid Location.'), +(78, '2008-04-17 14:05:16', 47.358016, -122.115115, '206-555-1212', '1208454364321', 0, 164, 11, '2008-04-17 11:05:15', '327681', 117, '1', 'Valid Location.'), +(79, '2008-04-17 14:07:23', 47.357627, -122.109707, '206-555-1212', '1208454364321', 6, 96, 11, '2008-04-17 11:07:22', '327681', 60, '1', 'Valid Location.'), +(80, '2008-04-17 14:42:29', 47.357115, -122.114773, '3b', '1208457732980', 0, 0, 0, '2008-04-17 11:42:22', '327681', 70, '1', 'Valid Location.'), +(81, '2008-04-17 14:44:32', 47.358101, -122.115307, '3b', '1208457732980', 25, 339, 0, '2008-04-17 11:44:32', '327681', 70, '1', 'Valid Location.'), +(82, '2008-04-17 14:46:44', 47.371355, -122.094517, '3b', '1208457732980', 53, 46, 1, '2008-04-17 11:46:43', '327681', 52, '1', 'Valid Location.'), +(83, '2008-04-17 14:48:44', 47.387616, -122.058048, '3b', '1208457732980', 59, 56, 3, '2008-04-17 11:48:44', '327681', 52, '1', 'Valid Location.'), +(84, '2008-04-17 14:50:46', 47.409472, -122.032917, '3b', '1208457732980', 60, 37, 5, '2008-04-17 11:50:45', '327681', 80, '1', 'Valid Location.'), +(85, '2008-04-17 14:52:55', 47.425824, -121.991819, '3b', '1208457732980', 59, 59, 7, '2008-04-17 11:52:54', '327681', 44, '1', 'Valid Location.'), +(86, '2008-04-17 14:55:22', 47.442251, -121.985579, '3b', '1208457732980', 42, 14, 8, '2008-04-17 11:55:20', '327681', 60, '1', 'Valid Location.'), +(87, '2008-04-17 14:57:27', 47.459232, -122.005856, '3b', '1208457732980', 39, 321, 10, '2008-04-17 11:57:27', '327681', 132, '1', 'Valid Location.'), +(88, '2008-04-17 14:59:34', 47.475531, -122.026176, '3b', '1208457732980', 8, 319, 11, '2008-04-17 11:59:33', '327681', 80, '1', 'Valid Location.'), +(89, '2008-04-17 15:02:05', 47.473349, -122.025035, '3b', '1208457732980', 0, 160, 11, '2008-04-17 12:02:03', '8', 0, '0', 'Invalid Location: Time out, fix unattainable and assist unavailable.'), +(90, '2008-04-17 15:04:34', 47.473349, -122.025035, '3b', '1208457732980', 0, 0, 11, '2008-04-17 12:04:32', '8', 0, '0', 'Invalid Location: Time out, fix unattainable and assist unavailable.'), +(91, '2008-04-17 15:07:03', 47.473349, -122.025035, '3b', '1208457732980', 0, 0, 11, '2008-04-17 12:07:02', '8', 0, '0', 'Invalid Location: Time out, fix unattainable and assist unavailable.'); diff --git a/GPSTrackerPhp/License.txt b/GPSTrackerPhp/License.txt new file mode 100755 index 0000000..818433e --- /dev/null +++ b/GPSTrackerPhp/License.txt @@ -0,0 +1,674 @@ + GNU GENERAL PUBLIC LICENSE + Version 3, 29 June 2007 + + Copyright (C) 2007 Free Software Foundation, Inc. + Everyone is permitted to copy and distribute verbatim copies + of this license document, but changing it is not allowed. + + Preamble + + The GNU General Public License is a free, copyleft license for +software and other kinds of works. + + The licenses for most software and other practical works are designed +to take away your freedom to share and change the works. By contrast, +the GNU General Public License is intended to guarantee your freedom to +share and change all versions of a program--to make sure it remains free +software for all its users. We, the Free Software Foundation, use the +GNU General Public License for most of our software; it applies also to +any other work released this way by its authors. You can apply it to +your programs, too. + + When we speak of free software, we are referring to freedom, not +price. Our General Public Licenses are designed to make sure that you +have the freedom to distribute copies of free software (and charge for +them if you wish), that you receive source code or can get it if you +want it, that you can change the software or use pieces of it in new +free programs, and that you know you can do these things. + + To protect your rights, we need to prevent others from denying you +these rights or asking you to surrender the rights. Therefore, you have +certain responsibilities if you distribute copies of the software, or if +you modify it: responsibilities to respect the freedom of others. + + For example, if you distribute copies of such a program, whether +gratis or for a fee, you must pass on to the recipients the same +freedoms that you received. You must make sure that they, too, receive +or can get the source code. And you must show them these terms so they +know their rights. + + Developers that use the GNU GPL protect your rights with two steps: +(1) assert copyright on the software, and (2) offer you this License +giving you legal permission to copy, distribute and/or modify it. + + For the developers' and authors' protection, the GPL clearly explains +that there is no warranty for this free software. For both users' and +authors' sake, the GPL requires that modified versions be marked as +changed, so that their problems will not be attributed erroneously to +authors of previous versions. + + Some devices are designed to deny users access to install or run +modified versions of the software inside them, although the manufacturer +can do so. This is fundamentally incompatible with the aim of +protecting users' freedom to change the software. The systematic +pattern of such abuse occurs in the area of products for individuals to +use, which is precisely where it is most unacceptable. Therefore, we +have designed this version of the GPL to prohibit the practice for those +products. If such problems arise substantially in other domains, we +stand ready to extend this provision to those domains in future versions +of the GPL, as needed to protect the freedom of users. + + Finally, every program is threatened constantly by software patents. +States should not allow patents to restrict development and use of +software on general-purpose computers, but in those that do, we wish to +avoid the special danger that patents applied to a free program could +make it effectively proprietary. To prevent this, the GPL assures that +patents cannot be used to render the program non-free. + + The precise terms and conditions for copying, distribution and +modification follow. + + TERMS AND CONDITIONS + + 0. Definitions. + + "This License" refers to version 3 of the GNU General Public License. + + "Copyright" also means copyright-like laws that apply to other kinds of +works, such as semiconductor masks. + + "The Program" refers to any copyrightable work licensed under this +License. Each licensee is addressed as "you". "Licensees" and +"recipients" may be individuals or organizations. + + To "modify" a work means to copy from or adapt all or part of the work +in a fashion requiring copyright permission, other than the making of an +exact copy. The resulting work is called a "modified version" of the +earlier work or a work "based on" the earlier work. + + A "covered work" means either the unmodified Program or a work based +on the Program. + + To "propagate" a work means to do anything with it that, without +permission, would make you directly or secondarily liable for +infringement under applicable copyright law, except executing it on a +computer or modifying a private copy. Propagation includes copying, +distribution (with or without modification), making available to the +public, and in some countries other activities as well. + + To "convey" a work means any kind of propagation that enables other +parties to make or receive copies. Mere interaction with a user through +a computer network, with no transfer of a copy, is not conveying. + + An interactive user interface displays "Appropriate Legal Notices" +to the extent that it includes a convenient and prominently visible +feature that (1) displays an appropriate copyright notice, and (2) +tells the user that there is no warranty for the work (except to the +extent that warranties are provided), that licensees may convey the +work under this License, and how to view a copy of this License. If +the interface presents a list of user commands or options, such as a +menu, a prominent item in the list meets this criterion. + + 1. Source Code. + + The "source code" for a work means the preferred form of the work +for making modifications to it. "Object code" means any non-source +form of a work. + + A "Standard Interface" means an interface that either is an official +standard defined by a recognized standards body, or, in the case of +interfaces specified for a particular programming language, one that +is widely used among developers working in that language. + + The "System Libraries" of an executable work include anything, other +than the work as a whole, that (a) is included in the normal form of +packaging a Major Component, but which is not part of that Major +Component, and (b) serves only to enable use of the work with that +Major Component, or to implement a Standard Interface for which an +implementation is available to the public in source code form. A +"Major Component", in this context, means a major essential component +(kernel, window system, and so on) of the specific operating system +(if any) on which the executable work runs, or a compiler used to +produce the work, or an object code interpreter used to run it. + + The "Corresponding Source" for a work in object code form means all +the source code needed to generate, install, and (for an executable +work) run the object code and to modify the work, including scripts to +control those activities. However, it does not include the work's +System Libraries, or general-purpose tools or generally available free +programs which are used unmodified in performing those activities but +which are not part of the work. For example, Corresponding Source +includes interface definition files associated with source files for +the work, and the source code for shared libraries and dynamically +linked subprograms that the work is specifically designed to require, +such as by intimate data communication or control flow between those +subprograms and other parts of the work. + + The Corresponding Source need not include anything that users +can regenerate automatically from other parts of the Corresponding +Source. + + The Corresponding Source for a work in source code form is that +same work. + + 2. Basic Permissions. + + All rights granted under this License are granted for the term of +copyright on the Program, and are irrevocable provided the stated +conditions are met. This License explicitly affirms your unlimited +permission to run the unmodified Program. The output from running a +covered work is covered by this License only if the output, given its +content, constitutes a covered work. This License acknowledges your +rights of fair use or other equivalent, as provided by copyright law. + + You may make, run and propagate covered works that you do not +convey, without conditions so long as your license otherwise remains +in force. You may convey covered works to others for the sole purpose +of having them make modifications exclusively for you, or provide you +with facilities for running those works, provided that you comply with +the terms of this License in conveying all material for which you do +not control copyright. Those thus making or running the covered works +for you must do so exclusively on your behalf, under your direction +and control, on terms that prohibit them from making any copies of +your copyrighted material outside their relationship with you. + + Conveying under any other circumstances is permitted solely under +the conditions stated below. Sublicensing is not allowed; section 10 +makes it unnecessary. + + 3. Protecting Users' Legal Rights From Anti-Circumvention Law. + + No covered work shall be deemed part of an effective technological +measure under any applicable law fulfilling obligations under article +11 of the WIPO copyright treaty adopted on 20 December 1996, or +similar laws prohibiting or restricting circumvention of such +measures. + + When you convey a covered work, you waive any legal power to forbid +circumvention of technological measures to the extent such circumvention +is effected by exercising rights under this License with respect to +the covered work, and you disclaim any intention to limit operation or +modification of the work as a means of enforcing, against the work's +users, your or third parties' legal rights to forbid circumvention of +technological measures. + + 4. Conveying Verbatim Copies. + + You may convey verbatim copies of the Program's source code as you +receive it, in any medium, provided that you conspicuously and +appropriately publish on each copy an appropriate copyright notice; +keep intact all notices stating that this License and any +non-permissive terms added in accord with section 7 apply to the code; +keep intact all notices of the absence of any warranty; and give all +recipients a copy of this License along with the Program. + + You may charge any price or no price for each copy that you convey, +and you may offer support or warranty protection for a fee. + + 5. Conveying Modified Source Versions. + + You may convey a work based on the Program, or the modifications to +produce it from the Program, in the form of source code under the +terms of section 4, provided that you also meet all of these conditions: + + a) The work must carry prominent notices stating that you modified + it, and giving a relevant date. + + b) The work must carry prominent notices stating that it is + released under this License and any conditions added under section + 7. This requirement modifies the requirement in section 4 to + "keep intact all notices". + + c) You must license the entire work, as a whole, under this + License to anyone who comes into possession of a copy. This + License will therefore apply, along with any applicable section 7 + additional terms, to the whole of the work, and all its parts, + regardless of how they are packaged. This License gives no + permission to license the work in any other way, but it does not + invalidate such permission if you have separately received it. + + d) If the work has interactive user interfaces, each must display + Appropriate Legal Notices; however, if the Program has interactive + interfaces that do not display Appropriate Legal Notices, your + work need not make them do so. + + A compilation of a covered work with other separate and independent +works, which are not by their nature extensions of the covered work, +and which are not combined with it such as to form a larger program, +in or on a volume of a storage or distribution medium, is called an +"aggregate" if the compilation and its resulting copyright are not +used to limit the access or legal rights of the compilation's users +beyond what the individual works permit. Inclusion of a covered work +in an aggregate does not cause this License to apply to the other +parts of the aggregate. + + 6. Conveying Non-Source Forms. + + You may convey a covered work in object code form under the terms +of sections 4 and 5, provided that you also convey the +machine-readable Corresponding Source under the terms of this License, +in one of these ways: + + a) Convey the object code in, or embodied in, a physical product + (including a physical distribution medium), accompanied by the + Corresponding Source fixed on a durable physical medium + customarily used for software interchange. + + b) Convey the object code in, or embodied in, a physical product + (including a physical distribution medium), accompanied by a + written offer, valid for at least three years and valid for as + long as you offer spare parts or customer support for that product + model, to give anyone who possesses the object code either (1) a + copy of the Corresponding Source for all the software in the + product that is covered by this License, on a durable physical + medium customarily used for software interchange, for a price no + more than your reasonable cost of physically performing this + conveying of source, or (2) access to copy the + Corresponding Source from a network server at no charge. + + c) Convey individual copies of the object code with a copy of the + written offer to provide the Corresponding Source. This + alternative is allowed only occasionally and noncommercially, and + only if you received the object code with such an offer, in accord + with subsection 6b. + + d) Convey the object code by offering access from a designated + place (gratis or for a charge), and offer equivalent access to the + Corresponding Source in the same way through the same place at no + further charge. You need not require recipients to copy the + Corresponding Source along with the object code. If the place to + copy the object code is a network server, the Corresponding Source + may be on a different server (operated by you or a third party) + that supports equivalent copying facilities, provided you maintain + clear directions next to the object code saying where to find the + Corresponding Source. Regardless of what server hosts the + Corresponding Source, you remain obligated to ensure that it is + available for as long as needed to satisfy these requirements. + + e) Convey the object code using peer-to-peer transmission, provided + you inform other peers where the object code and Corresponding + Source of the work are being offered to the general public at no + charge under subsection 6d. + + A separable portion of the object code, whose source code is excluded +from the Corresponding Source as a System Library, need not be +included in conveying the object code work. + + A "User Product" is either (1) a "consumer product", which means any +tangible personal property which is normally used for personal, family, +or household purposes, or (2) anything designed or sold for incorporation +into a dwelling. In determining whether a product is a consumer product, +doubtful cases shall be resolved in favor of coverage. For a particular +product received by a particular user, "normally used" refers to a +typical or common use of that class of product, regardless of the status +of the particular user or of the way in which the particular user +actually uses, or expects or is expected to use, the product. A product +is a consumer product regardless of whether the product has substantial +commercial, industrial or non-consumer uses, unless such uses represent +the only significant mode of use of the product. + + "Installation Information" for a User Product means any methods, +procedures, authorization keys, or other information required to install +and execute modified versions of a covered work in that User Product from +a modified version of its Corresponding Source. The information must +suffice to ensure that the continued functioning of the modified object +code is in no case prevented or interfered with solely because +modification has been made. + + If you convey an object code work under this section in, or with, or +specifically for use in, a User Product, and the conveying occurs as +part of a transaction in which the right of possession and use of the +User Product is transferred to the recipient in perpetuity or for a +fixed term (regardless of how the transaction is characterized), the +Corresponding Source conveyed under this section must be accompanied +by the Installation Information. But this requirement does not apply +if neither you nor any third party retains the ability to install +modified object code on the User Product (for example, the work has +been installed in ROM). + + The requirement to provide Installation Information does not include a +requirement to continue to provide support service, warranty, or updates +for a work that has been modified or installed by the recipient, or for +the User Product in which it has been modified or installed. Access to a +network may be denied when the modification itself materially and +adversely affects the operation of the network or violates the rules and +protocols for communication across the network. + + Corresponding Source conveyed, and Installation Information provided, +in accord with this section must be in a format that is publicly +documented (and with an implementation available to the public in +source code form), and must require no special password or key for +unpacking, reading or copying. + + 7. Additional Terms. + + "Additional permissions" are terms that supplement the terms of this +License by making exceptions from one or more of its conditions. +Additional permissions that are applicable to the entire Program shall +be treated as though they were included in this License, to the extent +that they are valid under applicable law. If additional permissions +apply only to part of the Program, that part may be used separately +under those permissions, but the entire Program remains governed by +this License without regard to the additional permissions. + + When you convey a copy of a covered work, you may at your option +remove any additional permissions from that copy, or from any part of +it. (Additional permissions may be written to require their own +removal in certain cases when you modify the work.) You may place +additional permissions on material, added by you to a covered work, +for which you have or can give appropriate copyright permission. + + Notwithstanding any other provision of this License, for material you +add to a covered work, you may (if authorized by the copyright holders of +that material) supplement the terms of this License with terms: + + a) Disclaiming warranty or limiting liability differently from the + terms of sections 15 and 16 of this License; or + + b) Requiring preservation of specified reasonable legal notices or + author attributions in that material or in the Appropriate Legal + Notices displayed by works containing it; or + + c) Prohibiting misrepresentation of the origin of that material, or + requiring that modified versions of such material be marked in + reasonable ways as different from the original version; or + + d) Limiting the use for publicity purposes of names of licensors or + authors of the material; or + + e) Declining to grant rights under trademark law for use of some + trade names, trademarks, or service marks; or + + f) Requiring indemnification of licensors and authors of that + material by anyone who conveys the material (or modified versions of + it) with contractual assumptions of liability to the recipient, for + any liability that these contractual assumptions directly impose on + those licensors and authors. + + All other non-permissive additional terms are considered "further +restrictions" within the meaning of section 10. If the Program as you +received it, or any part of it, contains a notice stating that it is +governed by this License along with a term that is a further +restriction, you may remove that term. If a license document contains +a further restriction but permits relicensing or conveying under this +License, you may add to a covered work material governed by the terms +of that license document, provided that the further restriction does +not survive such relicensing or conveying. + + If you add terms to a covered work in accord with this section, you +must place, in the relevant source files, a statement of the +additional terms that apply to those files, or a notice indicating +where to find the applicable terms. + + Additional terms, permissive or non-permissive, may be stated in the +form of a separately written license, or stated as exceptions; +the above requirements apply either way. + + 8. Termination. + + You may not propagate or modify a covered work except as expressly +provided under this License. Any attempt otherwise to propagate or +modify it is void, and will automatically terminate your rights under +this License (including any patent licenses granted under the third +paragraph of section 11). + + However, if you cease all violation of this License, then your +license from a particular copyright holder is reinstated (a) +provisionally, unless and until the copyright holder explicitly and +finally terminates your license, and (b) permanently, if the copyright +holder fails to notify you of the violation by some reasonable means +prior to 60 days after the cessation. + + Moreover, your license from a particular copyright holder is +reinstated permanently if the copyright holder notifies you of the +violation by some reasonable means, this is the first time you have +received notice of violation of this License (for any work) from that +copyright holder, and you cure the violation prior to 30 days after +your receipt of the notice. + + Termination of your rights under this section does not terminate the +licenses of parties who have received copies or rights from you under +this License. If your rights have been terminated and not permanently +reinstated, you do not qualify to receive new licenses for the same +material under section 10. + + 9. Acceptance Not Required for Having Copies. + + You are not required to accept this License in order to receive or +run a copy of the Program. Ancillary propagation of a covered work +occurring solely as a consequence of using peer-to-peer transmission +to receive a copy likewise does not require acceptance. However, +nothing other than this License grants you permission to propagate or +modify any covered work. These actions infringe copyright if you do +not accept this License. Therefore, by modifying or propagating a +covered work, you indicate your acceptance of this License to do so. + + 10. Automatic Licensing of Downstream Recipients. + + Each time you convey a covered work, the recipient automatically +receives a license from the original licensors, to run, modify and +propagate that work, subject to this License. You are not responsible +for enforcing compliance by third parties with this License. + + An "entity transaction" is a transaction transferring control of an +organization, or substantially all assets of one, or subdividing an +organization, or merging organizations. If propagation of a covered +work results from an entity transaction, each party to that +transaction who receives a copy of the work also receives whatever +licenses to the work the party's predecessor in interest had or could +give under the previous paragraph, plus a right to possession of the +Corresponding Source of the work from the predecessor in interest, if +the predecessor has it or can get it with reasonable efforts. + + You may not impose any further restrictions on the exercise of the +rights granted or affirmed under this License. For example, you may +not impose a license fee, royalty, or other charge for exercise of +rights granted under this License, and you may not initiate litigation +(including a cross-claim or counterclaim in a lawsuit) alleging that +any patent claim is infringed by making, using, selling, offering for +sale, or importing the Program or any portion of it. + + 11. Patents. + + A "contributor" is a copyright holder who authorizes use under this +License of the Program or a work on which the Program is based. The +work thus licensed is called the contributor's "contributor version". + + A contributor's "essential patent claims" are all patent claims +owned or controlled by the contributor, whether already acquired or +hereafter acquired, that would be infringed by some manner, permitted +by this License, of making, using, or selling its contributor version, +but do not include claims that would be infringed only as a +consequence of further modification of the contributor version. For +purposes of this definition, "control" includes the right to grant +patent sublicenses in a manner consistent with the requirements of +this License. + + Each contributor grants you a non-exclusive, worldwide, royalty-free +patent license under the contributor's essential patent claims, to +make, use, sell, offer for sale, import and otherwise run, modify and +propagate the contents of its contributor version. + + In the following three paragraphs, a "patent license" is any express +agreement or commitment, however denominated, not to enforce a patent +(such as an express permission to practice a patent or covenant not to +sue for patent infringement). To "grant" such a patent license to a +party means to make such an agreement or commitment not to enforce a +patent against the party. + + If you convey a covered work, knowingly relying on a patent license, +and the Corresponding Source of the work is not available for anyone +to copy, free of charge and under the terms of this License, through a +publicly available network server or other readily accessible means, +then you must either (1) cause the Corresponding Source to be so +available, or (2) arrange to deprive yourself of the benefit of the +patent license for this particular work, or (3) arrange, in a manner +consistent with the requirements of this License, to extend the patent +license to downstream recipients. "Knowingly relying" means you have +actual knowledge that, but for the patent license, your conveying the +covered work in a country, or your recipient's use of the covered work +in a country, would infringe one or more identifiable patents in that +country that you have reason to believe are valid. + + If, pursuant to or in connection with a single transaction or +arrangement, you convey, or propagate by procuring conveyance of, a +covered work, and grant a patent license to some of the parties +receiving the covered work authorizing them to use, propagate, modify +or convey a specific copy of the covered work, then the patent license +you grant is automatically extended to all recipients of the covered +work and works based on it. + + A patent license is "discriminatory" if it does not include within +the scope of its coverage, prohibits the exercise of, or is +conditioned on the non-exercise of one or more of the rights that are +specifically granted under this License. You may not convey a covered +work if you are a party to an arrangement with a third party that is +in the business of distributing software, under which you make payment +to the third party based on the extent of your activity of conveying +the work, and under which the third party grants, to any of the +parties who would receive the covered work from you, a discriminatory +patent license (a) in connection with copies of the covered work +conveyed by you (or copies made from those copies), or (b) primarily +for and in connection with specific products or compilations that +contain the covered work, unless you entered into that arrangement, +or that patent license was granted, prior to 28 March 2007. + + Nothing in this License shall be construed as excluding or limiting +any implied license or other defenses to infringement that may +otherwise be available to you under applicable patent law. + + 12. No Surrender of Others' Freedom. + + If conditions are imposed on you (whether by court order, agreement or +otherwise) that contradict the conditions of this License, they do not +excuse you from the conditions of this License. If you cannot convey a +covered work so as to satisfy simultaneously your obligations under this +License and any other pertinent obligations, then as a consequence you may +not convey it at all. For example, if you agree to terms that obligate you +to collect a royalty for further conveying from those to whom you convey +the Program, the only way you could satisfy both those terms and this +License would be to refrain entirely from conveying the Program. + + 13. Use with the GNU Affero General Public License. + + Notwithstanding any other provision of this License, you have +permission to link or combine any covered work with a work licensed +under version 3 of the GNU Affero General Public License into a single +combined work, and to convey the resulting work. The terms of this +License will continue to apply to the part which is the covered work, +but the special requirements of the GNU Affero General Public License, +section 13, concerning interaction through a network will apply to the +combination as such. + + 14. Revised Versions of this License. + + The Free Software Foundation may publish revised and/or new versions of +the GNU General Public License from time to time. Such new versions will +be similar in spirit to the present version, but may differ in detail to +address new problems or concerns. + + Each version is given a distinguishing version number. If the +Program specifies that a certain numbered version of the GNU General +Public License "or any later version" applies to it, you have the +option of following the terms and conditions either of that numbered +version or of any later version published by the Free Software +Foundation. If the Program does not specify a version number of the +GNU General Public License, you may choose any version ever published +by the Free Software Foundation. + + If the Program specifies that a proxy can decide which future +versions of the GNU General Public License can be used, that proxy's +public statement of acceptance of a version permanently authorizes you +to choose that version for the Program. + + Later license versions may give you additional or different +permissions. However, no additional obligations are imposed on any +author or copyright holder as a result of your choosing to follow a +later version. + + 15. Disclaimer of Warranty. + + THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY +APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT +HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY +OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, +THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR +PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM +IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF +ALL NECESSARY SERVICING, REPAIR OR CORRECTION. + + 16. Limitation of Liability. + + IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING +WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS +THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY +GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE +USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF +DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD +PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS), +EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF +SUCH DAMAGES. + + 17. Interpretation of Sections 15 and 16. + + If the disclaimer of warranty and limitation of liability provided +above cannot be given local legal effect according to their terms, +reviewing courts shall apply local law that most closely approximates +an absolute waiver of all civil liability in connection with the +Program, unless a warranty or assumption of liability accompanies a +copy of the Program in return for a fee. + + END OF TERMS AND CONDITIONS + + How to Apply These Terms to Your New Programs + + If you develop a new program, and you want it to be of the greatest +possible use to the public, the best way to achieve this is to make it +free software which everyone can redistribute and change under these terms. + + To do so, attach the following notices to the program. It is safest +to attach them to the start of each source file to most effectively +state the exclusion of warranty; and each file should have at least +the "copyright" line and a pointer to where the full notice is found. + + + Copyright (C) + + This program is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see . + +Also add information on how to contact you by electronic and paper mail. + + If the program does terminal interaction, make it output a short +notice like this when it starts in an interactive mode: + + Copyright (C) + This program comes with ABSOLUTELY NO WARRANTY; for details type `show w'. + This is free software, and you are welcome to redistribute it + under certain conditions; type `show c' for details. + +The hypothetical commands `show w' and `show c' should show the appropriate +parts of the General Public License. Of course, your program's commands +might be different; for a GUI interface, you would use an "about box". + + You should also get your employer (if you work as a programmer) or school, +if any, to sign a "copyright disclaimer" for the program, if necessary. +For more information on this, and how to apply and follow the GNU GPL, see +. + + The GNU General Public License does not permit incorporating your program +into proprietary programs. If your program is a subroutine library, you +may consider it more useful to permit linking proprietary applications with +the library. If this is what you want to do, use the GNU Lesser General +Public License instead of this License. But first, please read +. diff --git a/GPSTrackerPhp/Phone/GPSTracker2.0/build.xml b/GPSTrackerPhp/Phone/GPSTracker2.0/build.xml new file mode 100755 index 0000000..16d19d5 --- /dev/null +++ b/GPSTrackerPhp/Phone/GPSTracker2.0/build.xml @@ -0,0 +1,83 @@ + + + + + + Builds, tests, and runs the project . + + + diff --git a/GPSTrackerPhp/Phone/GPSTracker2.0/build/.timestamp b/GPSTrackerPhp/Phone/GPSTracker2.0/build/.timestamp new file mode 100755 index 0000000..999b584 --- /dev/null +++ b/GPSTrackerPhp/Phone/GPSTracker2.0/build/.timestamp @@ -0,0 +1 @@ +ignore me \ No newline at end of file diff --git a/GPSTrackerPhp/Phone/GPSTracker2.0/build/compiled/gps32.png b/GPSTrackerPhp/Phone/GPSTracker2.0/build/compiled/gps32.png new file mode 100755 index 0000000..68dcc1b --- /dev/null +++ b/GPSTrackerPhp/Phone/GPSTracker2.0/build/compiled/gps32.png Binary files differ diff --git a/GPSTrackerPhp/Phone/GPSTracker2.0/build/manifest.mf b/GPSTrackerPhp/Phone/GPSTracker2.0/build/manifest.mf new file mode 100755 index 0000000..aef0378 --- /dev/null +++ b/GPSTrackerPhp/Phone/GPSTracker2.0/build/manifest.mf @@ -0,0 +1,9 @@ +MIDlet-1: GPSTracker,/res/gps32.png,GPSTracker +MIDlet-Permissions: javax.microedition.io.Connector.http, javax.microedition.location.Location +MIDlet-Vendor: Websmithing +MIDlet-Info-URL: www.websmithing.com +MIDlet-Name: GPSTracker2.0 +MIDlet-Icon: /res/gps32.png +MIDlet-Version: 2.0 +MicroEdition-Configuration: CLDC-1.1 +MicroEdition-Profile: MIDP-2.0 diff --git a/GPSTrackerPhp/Phone/GPSTracker2.0/build/obfuscated/META-INF/MANIFEST.MF b/GPSTrackerPhp/Phone/GPSTracker2.0/build/obfuscated/META-INF/MANIFEST.MF new file mode 100755 index 0000000..24ff3cc --- /dev/null +++ b/GPSTrackerPhp/Phone/GPSTracker2.0/build/obfuscated/META-INF/MANIFEST.MF @@ -0,0 +1,4 @@ +Manifest-Version: 1.0 +Ant-Version: Apache Ant 1.7.0 +Created-By: 1.6.0_01-b06 (Sun Microsystems Inc.) + diff --git a/GPSTrackerPhp/Phone/GPSTracker2.0/build/obfuscated/gps32.png b/GPSTrackerPhp/Phone/GPSTracker2.0/build/obfuscated/gps32.png new file mode 100755 index 0000000..68dcc1b --- /dev/null +++ b/GPSTrackerPhp/Phone/GPSTracker2.0/build/obfuscated/gps32.png Binary files differ diff --git a/GPSTrackerPhp/Phone/GPSTracker2.0/build/preprocessed/GPS.java b/GPSTrackerPhp/Phone/GPSTracker2.0/build/preprocessed/GPS.java new file mode 100755 index 0000000..776a420 --- /dev/null +++ b/GPSTrackerPhp/Phone/GPSTracker2.0/build/preprocessed/GPS.java @@ -0,0 +1,156 @@ +// Please leave the link below with the source code, thank you. +// http://www.websmithing.com/portal/Programming/tabid/55/articleType/ArticleView/articleId/6/Google-Map-GPS-Cell-Phone-Tracker-Version-2.aspx + +import javax.microedition.location.*; +import java.util.Calendar; +import java.util.Date; + +public class GPS implements LocationListener { + + private LocationProvider locationProvider = null; + private Coordinates oldCoordinates = null, currentCoordinates = null; + private float distance = 0; + private int azimuth = 0; + private String uploadWebsite; + private String queryString; + private GPSTracker midlet; + private int interval; + protected Calendar currentTime; + protected long sessionID; + + + public GPS(GPSTracker Midlet, int Interval, String UploadWebsite){ + currentTime = Calendar.getInstance(); + sessionID = System.currentTimeMillis(); + this.midlet = Midlet; + this.interval = Interval; + this.uploadWebsite = UploadWebsite; + } + + // getting the gps location is based on an interval in seconds. for instance, + // the location is gotten once a minute, sent to the website to be stored in + // the DB (and then viewed on Google map) and used to retrieve a map tile (image) + // to be diplayed on the phone + + public void startGPS() { + if (locationProvider == null) { + createLocationProvider(); + + Thread locationThread = new Thread() { + public void run(){ + createLocationListener(); + } + }; + locationThread.start(); + } + } + + // this allows us to change how often the gps location is gotten + public void changeInterval(int Interval) { + if (locationProvider != null) { + locationProvider.setLocationListener(this, Interval, -1, -1); + } + } + + private void createLocationProvider() { + Criteria cr = new Criteria(); + + try { + locationProvider = LocationProvider.getInstance(cr); + } catch (Exception e) { + midlet.log("GPS.createLocationProvider: " + e); + } + } + + private void createLocationListener(){ + // 2cd value is interval in seconds + try { + locationProvider.setLocationListener(this, interval, -1, -1); + } catch (Exception e) { + midlet.log("GPS.createLocationListener: " + e); + } + } + + public void locationUpdated(LocationProvider provider, final Location location) { + // get new location from locationProvider + + try { + Thread getLocationThread = new Thread(){ + public void run(){ + getLocation(location); + } + }; + + getLocationThread.start(); + } catch (Exception e) { + midlet.log("GPS.locationUpdated: " + e); + } + } + + public void providerStateChanged(LocationProvider provider, int newState) {} + + private void getLocation(Location location){ + float speed = 0; + + try { + QualifiedCoordinates qualifiedCoordinates = location.getQualifiedCoordinates(); + + qualifiedCoordinates.getLatitude(); + + if (oldCoordinates == null){ + oldCoordinates = new Coordinates(qualifiedCoordinates.getLatitude(), + qualifiedCoordinates.getLongitude(), + qualifiedCoordinates.getAltitude()); + } else { + if (!Float.isNaN( qualifiedCoordinates.distance(oldCoordinates))) { + distance += qualifiedCoordinates.distance(oldCoordinates); + } + + currentCoordinates = new Coordinates(qualifiedCoordinates.getLatitude(), + qualifiedCoordinates.getLongitude(), + qualifiedCoordinates.getAltitude()); + azimuth = (int)oldCoordinates.azimuthTo(currentCoordinates); + oldCoordinates.setAltitude(qualifiedCoordinates.getAltitude()); + oldCoordinates.setLatitude(qualifiedCoordinates.getLatitude()); + oldCoordinates.setLongitude(qualifiedCoordinates.getLongitude()); + + } + + if (qualifiedCoordinates != null){ + Date d = new Date(); + + if (!Float.isNaN(location.getSpeed())) { + speed = location.getSpeed(); + } + + queryString = "?lat=" + String.valueOf(qualifiedCoordinates.getLatitude()) + + "&lng=" + String.valueOf(qualifiedCoordinates.getLongitude()) + + "&mph=" + String.valueOf((int)(speed/1609*3600)) + + "&dir=" + String.valueOf(azimuth) + + "&dis=" + String.valueOf((int)(distance/1609)) + + "&dt=" + d.toString() + + "&lm=" + location.getLocationMethod() + + "&pn=" + midlet.phoneNumber + + "&sid=" + String.valueOf(sessionID) + + "&acc=" + String.valueOf((int)(qualifiedCoordinates.getHorizontalAccuracy()*3.28)) + + "&iv=" + String.valueOf(location.isValid()) + + "&info=" + location.getExtraInfo("text/plain") + + "&zm=" + midlet.zoomLevel + + "&h=" + midlet.height + + "&w=" + midlet.width; + + // with our query string built, we create a networker object to send the + // query to our website and get the map image and update the DB + NetWorker worker = new NetWorker(midlet, uploadWebsite); + worker.getUrl(queryString); + + } + + } catch (Exception e) { + midlet.log("GPS.getLocation: " + e); + } + } +} + + + diff --git a/GPSTrackerPhp/Phone/GPSTracker2.0/build/preprocessed/GPSTracker.java b/GPSTrackerPhp/Phone/GPSTracker2.0/build/preprocessed/GPSTracker.java new file mode 100755 index 0000000..f81c350 --- /dev/null +++ b/GPSTrackerPhp/Phone/GPSTracker2.0/build/preprocessed/GPSTracker.java @@ -0,0 +1,279 @@ +// Please leave the link below with the source code, thank you. +// http://www.websmithing.com/portal/Programming/tabid/55/articleType/ArticleView/articleId/6/Google-Map-GPS-Cell-Phone-Tracker-Version-2.aspx + +import javax.microedition.midlet.*; +import javax.microedition.lcdui.*; +import javax.microedition.location.*; +import java.util.Calendar; + +public class GPSTracker extends MIDlet implements CommandListener, ItemStateListener { + private Display display; + private Form form; + private Form zoomScreen; + private Form settingsScreen; + private Command exitCmd; + private Command saveCmd; + private Command zoomCmd; + private Command settingsCmd; + private Command backCmd; + private TextField phoneNumberTextField; + private TextField uploadWebsiteTextField; + private Gauge zoomGauge; + private StringItem zoomStringItem; + private ChoiceGroup updateIntervalCG; + private String updateInterval; + private int[] iTimes = {60, 120, 180, 300, 600}; + + private RMS rms; + private GPS gps; + + private String uploadWebsite; + private String defaultUploadWebsite = "http://www.websmithing.com/gpstracker/GetGoogleMap2.aspx"; + + protected String phoneNumber; + protected String zoomLevel; + protected int height, width; + protected Calendar currentTime; + protected long sessionID; + protected Image im = null; + + public GPSTracker(){ + form = new Form("GPSTracker2.0"); + display = Display.getDisplay(this); + exitCmd = new Command("Exit", Command.EXIT, 1); + zoomCmd = new Command("Zoom", Command.SCREEN, 2); + settingsCmd = new Command("Settings", Command.SCREEN, 3); + + form.addCommand(exitCmd); + form.addCommand(zoomCmd); + form.addCommand(settingsCmd); + form.setCommandListener(this); + + display.setCurrent(form); + currentTime = Calendar.getInstance(); + sessionID = System.currentTimeMillis(); + height = form.getHeight(); + width = form.getWidth(); + + // RMS is the phone's built in storage, kind of like a database, but + // it only stores name-value pairs (like an associative array or hashtable). + // eveything is stored as a string. + getSettingsFromRMS(); + + // the phone number field is the only empty field when the application is + // first loaded. it does not have to be a phone number, it can be any string, + // but for uniqueness, it's best to use a phone number. this only has to be + // done once. + if (hasPhoneNumber()) { + startGPS(); + displayInterval(); + } + } + + public void startApp() { + if ( form != null ) { + display.setCurrent(form); + } + } + + // let the user know how often map will be updated + private void displayInterval() { + int tempTime = iTimes[Integer.parseInt(updateInterval)]/60; + + display.setCurrent(form); + form.deleteAll(); + + if (tempTime == 1) { + log("Getting map once a minute..."); + } + else { + log("Getting map every " + String.valueOf(tempTime) + " minutes..."); + } + } + + private void loadZoomScreen() { + zoomScreen = new Form("Zoom"); + zoomGauge = new Gauge("Google Map Zoom", true, 17, Integer.parseInt(zoomLevel)); + zoomStringItem = new StringItem(null, ""); + zoomStringItem.setText("Zoom level: " + zoomGauge.getValue()); + backCmd = new Command("Back", Command.SCREEN, 1); + + zoomScreen.append(zoomGauge); + zoomScreen.append(zoomStringItem); + zoomScreen.addCommand(backCmd); + zoomScreen.setItemStateListener(this); + zoomScreen.setCommandListener(this); + + display.setCurrent(zoomScreen); + } + + // this method is called every time the zoom guage changes value. the zoom level is + // reset and saved + public void itemStateChanged(Item item) { + if (item == zoomGauge) { + zoomStringItem.setText("Zoom level: " + zoomGauge.getValue()); + zoomLevel = String.valueOf(zoomGauge.getValue()); + + try { + rms.put("zoomLevel", zoomLevel); + rms.save(); + } + catch (Exception e) { + log("GPSTracker.itemStateChanged: " + e); + } + } + } + + private void loadSettingsScreen() { + settingsScreen = new Form("Settings"); + + phoneNumberTextField = new TextField("Phone number or user name", phoneNumber, 20, TextField.ANY); + uploadWebsiteTextField = new TextField("Upload website", uploadWebsite, 100, TextField.ANY); + settingsScreen.append(phoneNumberTextField); + settingsScreen.append(uploadWebsiteTextField); + + String[] times = { "1 minute", "2 minutes", "3 minutes", "5 minutes", "10 minutes"}; + updateIntervalCG = new ChoiceGroup("Update map how often?", ChoiceGroup.EXCLUSIVE, times, null); + updateIntervalCG.setSelectedIndex(Integer.parseInt(updateInterval), true); + settingsScreen.append(updateIntervalCG); + + saveCmd = new Command("Save", Command.SCREEN, 1); + settingsScreen.addCommand(saveCmd); + + settingsScreen.setCommandListener(this); + display.setCurrent(settingsScreen); + } + + // get the settings from the phone's storage and load 4 global variables + public void getSettingsFromRMS() { + try { + rms = new RMS(this, "GPSTracker"); + + phoneNumber = rms.get("phoneNumber"); + uploadWebsite = rms.get("uploadWebsite"); + zoomLevel = rms.get("zoomLevel"); + updateInterval = rms.get("updateInterval"); + } + catch (Exception e) { + log("GPSTracker.getSettingsFromRMS: " + e); + } + + if ((uploadWebsite == null) || (uploadWebsite.trim().length() == 0)) { + uploadWebsite = defaultUploadWebsite; + } + + if ((zoomLevel == null) || (zoomLevel.trim().length() == 0)) { + zoomLevel = "12"; + } + if ((updateInterval == null) || (updateInterval.trim().length() == 0)) { + updateInterval = "1"; + } + } + + private boolean hasPhoneNumber() { + if ((phoneNumber == null) || (phoneNumber.trim().length() == 0)) { + log("Phone number required. Please go to settings."); + return false; + } + else { + return true; + } + } + + // gps is started with the update interval. the interval is the time in between + // map updates + private void startGPS() { + if (gps == null) { + gps = new GPS(this, iTimes[Integer.parseInt(updateInterval)], uploadWebsite); + gps.startGPS(); + } + } + + // this is called when the user changes the interval in the settings screen + private void changeInterval() { + if (gps == null) { + startGPS(); + } + else { + gps.changeInterval(iTimes[Integer.parseInt(updateInterval)]); + } + } + + // save settings back to phone memory + private void saveSettingsToRMS() { + try { + phoneNumber = phoneNumberTextField.getString(); + uploadWebsite = uploadWebsiteTextField.getString(); + updateInterval = String.valueOf(updateIntervalCG.getSelectedIndex()); + + rms.put("phoneNumber", phoneNumber); + rms.put("uploadWebsite", uploadWebsite); + rms.put("updateInterval", updateInterval); + + rms.save(); + } + catch (Exception e) { + log("GPSTracker.saveSettings: " + e); + } + display.setCurrent(form); + } + + // this method displays the map image, it is called from the networker object + public void showMap(boolean flag) + { + if (flag == false) { + log("Map could not be downloaded."); + } + else { + ImageItem imageitem = new ImageItem(null, im, ImageItem.LAYOUT_DEFAULT, null); + + if(form.size()!= 0) { + form.set(0, imageitem); + } + else { + form.append(imageitem); + } + } + } + + public void log(String text) { + StringItem si = new StringItem(null, text); + si.setLayout(Item.LAYOUT_NEWLINE_AFTER); + form.append(si); + } + + public void commandAction(Command cmd, Displayable screen) { + if (cmd == exitCmd) { + shutDownApp(); + } + else if (cmd == saveCmd) { + saveSettingsToRMS(); + + if (hasPhoneNumber()) { + changeInterval(); + displayInterval(); + } + } + else if (cmd == settingsCmd) { + loadSettingsScreen(); + } + else if (cmd == zoomCmd) { + loadZoomScreen(); + } + else if (cmd == backCmd) { + displayInterval(); + } + } + + public void pauseApp() {} + + public void destroyApp(boolean unconditional) {} + + protected void shutDownApp() { + destroyApp(true); + notifyDestroyed(); + } +} + + + diff --git a/GPSTrackerPhp/Phone/GPSTracker2.0/build/preprocessed/NetWorker.java b/GPSTrackerPhp/Phone/GPSTracker2.0/build/preprocessed/NetWorker.java new file mode 100755 index 0000000..ebae7f4 --- /dev/null +++ b/GPSTrackerPhp/Phone/GPSTracker2.0/build/preprocessed/NetWorker.java @@ -0,0 +1,112 @@ +// Please leave the link below with the source code, thank you. +// http://www.websmithing.com/portal/Programming/tabid/55/articleType/ArticleView/articleId/6/Google-Map-GPS-Cell-Phone-Tracker-Version-2.aspx + +import javax.microedition.io.*; +import java.io.*; +import javax.microedition.lcdui.Image; + +public class NetWorker { + private GPSTracker midlet; + private String uploadWebsite; + int i = 1; + + public NetWorker(GPSTracker lbsMidlet, String UploadWebsite){ + this.midlet = lbsMidlet; + this.uploadWebsite = UploadWebsite; + } + + public void getUrl(String queryString) { + queryString = URLencodeSpaces(queryString); + String url = uploadWebsite + queryString; + HttpConnection httpConn = null; + InputStream inputStream = null; + DataInputStream iStrm = null; + ByteArrayOutputStream bStrm = null; + Image im = null; + + try{ + httpConn = (HttpConnection)Connector.open(url); + + if(httpConn.getResponseCode() == HttpConnection.HTTP_OK){ + inputStream = httpConn.openInputStream(); + iStrm = new DataInputStream(inputStream); + + byte imageData[]; + int length = (int)httpConn.getLength(); + + if(length != -1) { + imageData = new byte[length]; + iStrm.readFully(imageData); + } + else { //Length not available + bStrm = new ByteArrayOutputStream(); + int ch; + + while((ch = iStrm.read())!= -1) { + bStrm.write(ch); + } + imageData = bStrm.toByteArray(); + + } + im = Image.createImage(imageData, 0, imageData.length); + } + else { + midlet.log("NetWorker.getUrl responseCode: " + httpConn.getResponseCode()); + } + + } catch (Exception e) { + midlet.log("NetWorker.getUrl: " + e); + } + finally{ // Clean up + try{ + if(bStrm != null) + bStrm.close(); + if(iStrm != null) + iStrm.close(); + if(inputStream != null) + inputStream.close(); + if(httpConn != null) + httpConn.close(); + } + catch(Exception e){} + } + + // if we have successfully gotten a map image, then we want to display it + if( im == null) { + midlet.showMap(false); + } + else { + midlet.im = im; + midlet.showMap(true); + } + + } + + // http://forum.java.sun.com/thread.jspa?threadID=341790&messageID=1408555 + private String URLencodeSpaces(String s) + { + if (s != null) { + StringBuffer tmp = new StringBuffer(); + int i = 0; + try { + while (true) { + int b = (int)s.charAt(i++); + + if (b != 0x20) { + tmp.append((char)b); + } + else { + tmp.append("%"); + if (b <= 0xf) { + tmp.append("0"); + } + tmp.append(Integer.toHexString(b)); + } + } + } + catch (Exception e) {} + return tmp.toString(); + } + return null; + } +} diff --git a/GPSTrackerPhp/Phone/GPSTracker2.0/build/preprocessed/RMS.java b/GPSTrackerPhp/Phone/GPSTracker2.0/build/preprocessed/RMS.java new file mode 100755 index 0000000..da626ff --- /dev/null +++ b/GPSTrackerPhp/Phone/GPSTracker2.0/build/preprocessed/RMS.java @@ -0,0 +1,79 @@ +// Wireless Java Developing with J2ME, Jonathan Knudsen + +import java.util.*; +import javax.microedition.rms.*; + +public class RMS { + private GPSTracker midlet; + private String mRecordStoreName; + private Hashtable mHashtable; + + public RMS(GPSTracker Midlet, String recordStoreName) throws RecordStoreException { + this.midlet = Midlet; + this.mRecordStoreName = recordStoreName; + this.mHashtable = new Hashtable(); + load(); + } + + public String get(String key) { + return (String)mHashtable.get(key); + } + + public void put(String key, String value) { + if (value == null) value = ""; + mHashtable.put(key, value); + } + + private void load() throws RecordStoreException { + RecordStore rs = null; + RecordEnumeration re = null; + + try { + rs = RecordStore.openRecordStore(mRecordStoreName, true); + re = rs.enumerateRecords(null, null, false); + while (re.hasNextElement()) { + byte[] raw = re.nextRecord(); + String pref = new String(raw); + // Parse out the name. + int index = pref.indexOf('|'); + String name = pref.substring(0, index); + String value = pref.substring(index + 1); + put(name, value); + } + } + finally { + if (re != null) re.destroy(); + if (rs != null) rs.closeRecordStore(); + } + } + + public void save() throws RecordStoreException { + RecordStore rs = null; + RecordEnumeration re = null; + try { + rs = RecordStore.openRecordStore(mRecordStoreName, true); + re = rs.enumerateRecords(null, null, false); + + // First remove all records, a little clumsy. + while (re.hasNextElement()) { + int id = re.nextRecordId(); + rs.deleteRecord(id); + } + + // Now save the preferences records. + Enumeration keys = mHashtable.keys(); + while (keys.hasMoreElements()) { + String key = (String)keys.nextElement(); + String value = get(key); + String pref = key + "|" + value; + byte[] raw = pref.getBytes(); + rs.addRecord(raw, 0, raw.length); + } + } + finally { + if (re != null) re.destroy(); + if (rs != null) rs.closeRecordStore(); + } + } + +} diff --git a/GPSTrackerPhp/Phone/GPSTracker2.0/build/preverified/META-INF/MANIFEST.MF b/GPSTrackerPhp/Phone/GPSTracker2.0/build/preverified/META-INF/MANIFEST.MF new file mode 100755 index 0000000..24ff3cc --- /dev/null +++ b/GPSTrackerPhp/Phone/GPSTracker2.0/build/preverified/META-INF/MANIFEST.MF @@ -0,0 +1,4 @@ +Manifest-Version: 1.0 +Ant-Version: Apache Ant 1.7.0 +Created-By: 1.6.0_01-b06 (Sun Microsystems Inc.) + diff --git a/GPSTrackerPhp/Phone/GPSTracker2.0/build/preverified/gps32.png b/GPSTrackerPhp/Phone/GPSTracker2.0/build/preverified/gps32.png new file mode 100755 index 0000000..68dcc1b --- /dev/null +++ b/GPSTrackerPhp/Phone/GPSTracker2.0/build/preverified/gps32.png Binary files differ diff --git a/GPSTrackerPhp/Phone/GPSTracker2.0/dist/GPST2.0.jad b/GPSTrackerPhp/Phone/GPSTracker2.0/dist/GPST2.0.jad new file mode 100755 index 0000000..1ccf57c --- /dev/null +++ b/GPSTrackerPhp/Phone/GPSTracker2.0/dist/GPST2.0.jad @@ -0,0 +1,11 @@ +MIDlet-1: GPSTracker,/res/gps32.png,GPSTracker +MIDlet-Icon: /res/gps32.png +MIDlet-Info-URL: www.websmithing.com +MIDlet-Jar-Size: 9179 +MIDlet-Jar-URL: GPST2.0.jar +MIDlet-Name: GPSTracker2.0 +MIDlet-Permissions: javax.microedition.io.Connector.http, javax.microedition.location.Location +MIDlet-Vendor: Websmithing +MIDlet-Version: 2.0 +MicroEdition-Configuration: CLDC-1.1 +MicroEdition-Profile: MIDP-2.0 diff --git a/GPSTrackerPhp/Phone/GPSTracker2.0/nbproject/build-impl.xml b/GPSTrackerPhp/Phone/GPSTracker2.0/nbproject/build-impl.xml new file mode 100755 index 0000000..6fe56bb --- /dev/null +++ b/GPSTrackerPhp/Phone/GPSTracker2.0/nbproject/build-impl.xml @@ -0,0 +1,1151 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Classpath to J2ME Ant extension library (libs.j2me_ant_ext.classpath property) is not set. For example: location of mobility/modules/org-netbeans-mobility-antext.jar file in the IDE installation directory. + Platform home (platform.home property) is not set. Value of this property should be ${platform.active.description} emulator home directory location. + Platform boot classpath (platform.bootclasspath property) is not set. Value of this property should be ${platform.active.description} emulator boot classpath containing all J2ME classes provided by emulator. + Must set src.dir + Must set build.dir + Must set dist.dir + Must set dist.jar + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Must set preprocessed.dir + + + + + + + + + + + + + + + + + + Must set build.classes.dir + + + + + + + + + + + + + + + + + + + + + Must select some files in the IDE or set javac.includes + + + + + + + + + + + + + + + + + + + + + + + + + + Must set obfuscated.classes.dir + + + + Must set obfuscated.classes.dir + Must set obfuscator.srcjar + Must set obfuscator.destjar + + + + + + + + + + + + + + + + + + + + Must set preverify.classes.dir + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + MicroEdition-Configuration: ${platform.configuration} + + MicroEdition-Configuration: ${platform.configuration} + + + + MicroEdition-Profile: ${platform.profile} + + MicroEdition-Profile: ${platform.profile} + + + + Must set dist.jad + + + + + + + + + + + + + + + + + + + + + + + + ${manifest.midlets}${evaluated.manifest.apipermissions}${evaluated.manifest.pushregistry}${manifest.others}${manifest.jad} + ${manifest.midlets}${evaluated.manifest.apipermissions}${evaluated.manifest.pushregistry}${manifest.others}${manifest.manifest} + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Must set dist.javadoc.dir + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Property deployment.${deployment.method}.scriptfile not set. The property should point to an Ant script providing ${deployment.method} deployment. + + + + + + + + Classpath to Ant Contrib library (libs.ant-contrib.classpath property) is not set. + + + + + + + + + Active project configuration: @{cfg} + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Property build.root.dir is not set. By default its value should be \"build\". + Property dist.root.dir is not set. By default its value should be \"dist\". + + + + + + + diff --git a/GPSTrackerPhp/Phone/GPSTracker2.0/nbproject/genfiles.properties b/GPSTrackerPhp/Phone/GPSTracker2.0/nbproject/genfiles.properties new file mode 100755 index 0000000..415f660 --- /dev/null +++ b/GPSTrackerPhp/Phone/GPSTracker2.0/nbproject/genfiles.properties @@ -0,0 +1,8 @@ +# This file is used by a NetBeans-based IDE to track changes in generated files such as build-impl.xml. +# Do not edit this file. You may delete it but then the IDE will never regenerate such files for you. +build.xml.data.CRC32=45da0bd0 +build.xml.script.CRC32=0d45f2af +build.xml.stylesheet.CRC32=03eab09b +nbproject/build-impl.xml.data.CRC32=45da0bd0 +nbproject/build-impl.xml.script.CRC32=7ceefb47 +nbproject/build-impl.xml.stylesheet.CRC32=2a2b5990 diff --git a/GPSTrackerPhp/Phone/GPSTracker2.0/nbproject/private/private.properties b/GPSTrackerPhp/Phone/GPSTracker2.0/nbproject/private/private.properties new file mode 100755 index 0000000..2b716d1 --- /dev/null +++ b/GPSTrackerPhp/Phone/GPSTracker2.0/nbproject/private/private.properties @@ -0,0 +1,8 @@ +#Sun Apr 20 18:21:27 PDT 2008 +netbeans.user=C\:\\Documents and Settings\\nick\\.netbeans\\6.0 +javadoc.preview=true +config.active= +deployment.counter=96 +app-version.autoincrement=true +deployment.number=0.0.95 +file.reference.GPSTracker2.0-res=C\:\\Documents and Settings\\nick\\My Documents\\NetBeansProjects\\GPSTracker2.0\\res diff --git a/GPSTrackerPhp/Phone/GPSTracker2.0/nbproject/private/private.xml b/GPSTrackerPhp/Phone/GPSTracker2.0/nbproject/private/private.xml new file mode 100755 index 0000000..cc2c0e5 --- /dev/null +++ b/GPSTrackerPhp/Phone/GPSTracker2.0/nbproject/private/private.xml @@ -0,0 +1,4 @@ + + + + diff --git a/GPSTrackerPhp/Phone/GPSTracker2.0/nbproject/project.properties b/GPSTrackerPhp/Phone/GPSTracker2.0/nbproject/project.properties new file mode 100755 index 0000000..08d1fed --- /dev/null +++ b/GPSTrackerPhp/Phone/GPSTracker2.0/nbproject/project.properties @@ -0,0 +1,142 @@ +abilities=MMAPI=1.1,SATSAJCRMI=1.0,SATSACRYPTO=1.0,JSR82=1.1,JSR226=1.0,MIDP=2.1,JSR229=1.1.0,SATSAAPDU=1.0,CLDC=1.1,JSR177=1.0,JSR179=1.0.1,J2MEWS=1.0,WMA=2.0,JSR172=1.0,OBEX=1.0,ColorScreen,JSR238=1.0,JSR239=1.0,JSR211=1.0,JSR234=1.0,ScreenWidth=240,JSR75=1.0,JSR184=1.1,SATSAPKI=1.0,ScreenHeight=320,ScreenColorDepth=8,JSR180=1.0.1,J2MEXMLRPC=1.0, +all.configurations=\ +application.args= +application.description= +application.description.detail= +application.name= +application.vendor=Vendor +build.classes.dir=${build.dir}/compiled +build.classes.excludes=**/*.java,**/*.form,**/*.class,**/.nbintdb,**/*.mvd,**/*.wsclient,**/*.vmd +build.dir=build/${config.active} +build.root.dir=build +debug.level=debug +deployment.copy.target=deploy +deployment.instance=default +deployment.jarurl=${dist.jar} +deployment.method=NONE +deployment.override.jarurl=false +dist.dir=dist/${config.active} +dist.jad=GPST2.0.jad +dist.jar=GPST2.0.jar +dist.javadoc.dir=${dist.dir}/doc +dist.root.dir=dist +extra.classpath= +file.reference.builtin.ks=${netbeans.user}/config/j2me/builtin.ks +file.reference.GPSTracker2.0-res=res +filter.exclude.tests=false +filter.excludes= +filter.more.excludes= +filter.use.standard=true +jar.compress=true +javac.debug=true +javac.deprecation=false +javac.encoding=windows-1255 +javac.optimize=false +javac.source=1.3 +javac.target=1.3 +javadoc.author=false +javadoc.encoding= +javadoc.noindex=false +javadoc.nonavbar=false +javadoc.notree=false +javadoc.private=false +javadoc.splitindex=true +javadoc.use=true +javadoc.version=false +javadoc.windowtitle= +libs.classpath=${file.reference.GPSTracker2.0-res} +main.class= +main.class.class=applet +manifest.apipermissions=MIDlet-Permissions: javax.microedition.io.Connector.http, javax.microedition.location.Location\n +manifest.file=manifest.mf +manifest.jad= +manifest.manifest= +manifest.midlets=MIDlet-1: GPSTracker,/res/gps32.png,GPSTracker\n +manifest.others=MIDlet-Vendor: Websmithing\nMIDlet-Info-URL: www.websmithing.com\nMIDlet-Name: GPSTracker2.0\nMIDlet-Icon: /res/gps32.png\nMIDlet-Version: 2.0\n +manifest.pushregistry= +name=GPSTracker2.0 +no.dependencies=false +nokiaS80.application.icon= +nsicom.application.monitorhost= +nsicom.application.runremote= +nsicom.application.runverbose= +nsicom.remoteapp.location=\\My Documents\\NetBeans Applications +nsicom.remotevm.location=\\Windows\\creme\\bin\\CrEme.exe +obfuscated.classes.dir=${build.dir}/obfuscated +obfuscation.custom= +obfuscation.level=9 +obfuscator.destjar=${build.dir}/obfuscated.jar +obfuscator.srcjar=${build.dir}/before-obfuscation.jar +platform.active=Sun_Java_TM__Wireless_Toolkit_2_5_2_for_CLDC +platform.active.description=Sun Java(TM) Wireless Toolkit 2.5.2 for CLDC +platform.apis=JSR179-1.0.1 +platform.bootclasspath=${platform.home}/lib/jsr179.jar:${platform.home}/lib/cldcapi11.jar:${platform.home}/lib/midpapi20.jar +platform.configuration=CLDC-1.1 +platform.device=DefaultColorPhone +platform.fat.jar=true +platform.profile=MIDP-2.0 +platform.trigger=CLDC +platform.type=UEI-1.0.1 +preprocessed.dir=${build.dir}/preprocessed +preverify.classes.dir=${build.dir}/preverified +preverify.sources.dir=${build.dir}/preverifysrc +resources.dir=resources +ricoh.application.email= +ricoh.application.fax= +ricoh.application.icon= +ricoh.application.target-jar= +ricoh.application.telephone= +ricoh.application.uid=24148073 +ricoh.application.version= +ricoh.dalp.application-desc.auto-run=false +ricoh.dalp.application-desc.energy-save= +ricoh.dalp.application-desc.exec-auth= +ricoh.dalp.application-desc.visible=true +ricoh.dalp.argument= +ricoh.dalp.codebase= +ricoh.dalp.display-mode.color=true +ricoh.dalp.display-mode.is-4line-support=false +ricoh.dalp.display-mode.is-hvga-support=true +ricoh.dalp.display-mode.is-vga-support=false +ricoh.dalp.display-mode.is-wvga-support=false +ricoh.dalp.information.abbreviation= +ricoh.dalp.information.icon.basepath= +ricoh.dalp.information.icon.location= +ricoh.dalp.information.is-icon-used=true +ricoh.dalp.install.destination=hdd +ricoh.dalp.install.mode.auto=true +ricoh.dalp.install.work-dir=hdd +ricoh.dalp.is-managed=true +ricoh.dalp.resources.dsdk.version=2.0 +ricoh.dalp.resources.jar.basepath= +ricoh.dalp.resources.jar.version= +ricoh.dalp.version= +ricoh.icon.invert=false +ricoh.platform.target.version= +run.cmd.options= +run.jvmargs= +run.method=STANDARD +run.security.domain=trusted +run.use.security.domain=false +savaje.application.icon= +savaje.application.icon.focused= +savaje.application.icon.small= +savaje.application.uid=TBD +savaje.bundle.base= +savaje.bundle.debug=false +savaje.bundle.debug.port= +semc.application.caps= +semc.application.icon= +semc.application.icon.count= +semc.application.icon.splash= +semc.application.icon.splash.installonly=false +semc.application.uid=E1156475 +semc.certificate.path= +semc.private.key.password= +semc.private.key.path= +sign.alias=sprintadp +sign.enabled=false +sign.keystore=${file.reference.builtin.ks} +src.dir=src +use.emptyapis=true +use.preprocessor=true diff --git a/GPSTrackerPhp/Phone/GPSTracker2.0/nbproject/project.xml b/GPSTrackerPhp/Phone/GPSTracker2.0/nbproject/project.xml new file mode 100755 index 0000000..234ab96 --- /dev/null +++ b/GPSTrackerPhp/Phone/GPSTracker2.0/nbproject/project.xml @@ -0,0 +1,10 @@ + + + org.netbeans.modules.kjava.j2meproject + + + GPSTracker2.0 + 1.6 + + + diff --git a/GPSTrackerPhp/Phone/GPSTracker2.0/res/gps32.png b/GPSTrackerPhp/Phone/GPSTracker2.0/res/gps32.png new file mode 100755 index 0000000..68dcc1b --- /dev/null +++ b/GPSTrackerPhp/Phone/GPSTracker2.0/res/gps32.png Binary files differ diff --git a/GPSTrackerPhp/Phone/GPSTracker2.0/src/GPS.java b/GPSTrackerPhp/Phone/GPSTracker2.0/src/GPS.java new file mode 100755 index 0000000..776a420 --- /dev/null +++ b/GPSTrackerPhp/Phone/GPSTracker2.0/src/GPS.java @@ -0,0 +1,156 @@ +// Please leave the link below with the source code, thank you. +// http://www.websmithing.com/portal/Programming/tabid/55/articleType/ArticleView/articleId/6/Google-Map-GPS-Cell-Phone-Tracker-Version-2.aspx + +import javax.microedition.location.*; +import java.util.Calendar; +import java.util.Date; + +public class GPS implements LocationListener { + + private LocationProvider locationProvider = null; + private Coordinates oldCoordinates = null, currentCoordinates = null; + private float distance = 0; + private int azimuth = 0; + private String uploadWebsite; + private String queryString; + private GPSTracker midlet; + private int interval; + protected Calendar currentTime; + protected long sessionID; + + + public GPS(GPSTracker Midlet, int Interval, String UploadWebsite){ + currentTime = Calendar.getInstance(); + sessionID = System.currentTimeMillis(); + this.midlet = Midlet; + this.interval = Interval; + this.uploadWebsite = UploadWebsite; + } + + // getting the gps location is based on an interval in seconds. for instance, + // the location is gotten once a minute, sent to the website to be stored in + // the DB (and then viewed on Google map) and used to retrieve a map tile (image) + // to be diplayed on the phone + + public void startGPS() { + if (locationProvider == null) { + createLocationProvider(); + + Thread locationThread = new Thread() { + public void run(){ + createLocationListener(); + } + }; + locationThread.start(); + } + } + + // this allows us to change how often the gps location is gotten + public void changeInterval(int Interval) { + if (locationProvider != null) { + locationProvider.setLocationListener(this, Interval, -1, -1); + } + } + + private void createLocationProvider() { + Criteria cr = new Criteria(); + + try { + locationProvider = LocationProvider.getInstance(cr); + } catch (Exception e) { + midlet.log("GPS.createLocationProvider: " + e); + } + } + + private void createLocationListener(){ + // 2cd value is interval in seconds + try { + locationProvider.setLocationListener(this, interval, -1, -1); + } catch (Exception e) { + midlet.log("GPS.createLocationListener: " + e); + } + } + + public void locationUpdated(LocationProvider provider, final Location location) { + // get new location from locationProvider + + try { + Thread getLocationThread = new Thread(){ + public void run(){ + getLocation(location); + } + }; + + getLocationThread.start(); + } catch (Exception e) { + midlet.log("GPS.locationUpdated: " + e); + } + } + + public void providerStateChanged(LocationProvider provider, int newState) {} + + private void getLocation(Location location){ + float speed = 0; + + try { + QualifiedCoordinates qualifiedCoordinates = location.getQualifiedCoordinates(); + + qualifiedCoordinates.getLatitude(); + + if (oldCoordinates == null){ + oldCoordinates = new Coordinates(qualifiedCoordinates.getLatitude(), + qualifiedCoordinates.getLongitude(), + qualifiedCoordinates.getAltitude()); + } else { + if (!Float.isNaN( qualifiedCoordinates.distance(oldCoordinates))) { + distance += qualifiedCoordinates.distance(oldCoordinates); + } + + currentCoordinates = new Coordinates(qualifiedCoordinates.getLatitude(), + qualifiedCoordinates.getLongitude(), + qualifiedCoordinates.getAltitude()); + azimuth = (int)oldCoordinates.azimuthTo(currentCoordinates); + oldCoordinates.setAltitude(qualifiedCoordinates.getAltitude()); + oldCoordinates.setLatitude(qualifiedCoordinates.getLatitude()); + oldCoordinates.setLongitude(qualifiedCoordinates.getLongitude()); + + } + + if (qualifiedCoordinates != null){ + Date d = new Date(); + + if (!Float.isNaN(location.getSpeed())) { + speed = location.getSpeed(); + } + + queryString = "?lat=" + String.valueOf(qualifiedCoordinates.getLatitude()) + + "&lng=" + String.valueOf(qualifiedCoordinates.getLongitude()) + + "&mph=" + String.valueOf((int)(speed/1609*3600)) + + "&dir=" + String.valueOf(azimuth) + + "&dis=" + String.valueOf((int)(distance/1609)) + + "&dt=" + d.toString() + + "&lm=" + location.getLocationMethod() + + "&pn=" + midlet.phoneNumber + + "&sid=" + String.valueOf(sessionID) + + "&acc=" + String.valueOf((int)(qualifiedCoordinates.getHorizontalAccuracy()*3.28)) + + "&iv=" + String.valueOf(location.isValid()) + + "&info=" + location.getExtraInfo("text/plain") + + "&zm=" + midlet.zoomLevel + + "&h=" + midlet.height + + "&w=" + midlet.width; + + // with our query string built, we create a networker object to send the + // query to our website and get the map image and update the DB + NetWorker worker = new NetWorker(midlet, uploadWebsite); + worker.getUrl(queryString); + + } + + } catch (Exception e) { + midlet.log("GPS.getLocation: " + e); + } + } +} + + + diff --git a/GPSTrackerPhp/Phone/GPSTracker2.0/src/GPSTracker.java b/GPSTrackerPhp/Phone/GPSTracker2.0/src/GPSTracker.java new file mode 100755 index 0000000..f81c350 --- /dev/null +++ b/GPSTrackerPhp/Phone/GPSTracker2.0/src/GPSTracker.java @@ -0,0 +1,279 @@ +// Please leave the link below with the source code, thank you. +// http://www.websmithing.com/portal/Programming/tabid/55/articleType/ArticleView/articleId/6/Google-Map-GPS-Cell-Phone-Tracker-Version-2.aspx + +import javax.microedition.midlet.*; +import javax.microedition.lcdui.*; +import javax.microedition.location.*; +import java.util.Calendar; + +public class GPSTracker extends MIDlet implements CommandListener, ItemStateListener { + private Display display; + private Form form; + private Form zoomScreen; + private Form settingsScreen; + private Command exitCmd; + private Command saveCmd; + private Command zoomCmd; + private Command settingsCmd; + private Command backCmd; + private TextField phoneNumberTextField; + private TextField uploadWebsiteTextField; + private Gauge zoomGauge; + private StringItem zoomStringItem; + private ChoiceGroup updateIntervalCG; + private String updateInterval; + private int[] iTimes = {60, 120, 180, 300, 600}; + + private RMS rms; + private GPS gps; + + private String uploadWebsite; + private String defaultUploadWebsite = "http://www.websmithing.com/gpstracker/GetGoogleMap2.aspx"; + + protected String phoneNumber; + protected String zoomLevel; + protected int height, width; + protected Calendar currentTime; + protected long sessionID; + protected Image im = null; + + public GPSTracker(){ + form = new Form("GPSTracker2.0"); + display = Display.getDisplay(this); + exitCmd = new Command("Exit", Command.EXIT, 1); + zoomCmd = new Command("Zoom", Command.SCREEN, 2); + settingsCmd = new Command("Settings", Command.SCREEN, 3); + + form.addCommand(exitCmd); + form.addCommand(zoomCmd); + form.addCommand(settingsCmd); + form.setCommandListener(this); + + display.setCurrent(form); + currentTime = Calendar.getInstance(); + sessionID = System.currentTimeMillis(); + height = form.getHeight(); + width = form.getWidth(); + + // RMS is the phone's built in storage, kind of like a database, but + // it only stores name-value pairs (like an associative array or hashtable). + // eveything is stored as a string. + getSettingsFromRMS(); + + // the phone number field is the only empty field when the application is + // first loaded. it does not have to be a phone number, it can be any string, + // but for uniqueness, it's best to use a phone number. this only has to be + // done once. + if (hasPhoneNumber()) { + startGPS(); + displayInterval(); + } + } + + public void startApp() { + if ( form != null ) { + display.setCurrent(form); + } + } + + // let the user know how often map will be updated + private void displayInterval() { + int tempTime = iTimes[Integer.parseInt(updateInterval)]/60; + + display.setCurrent(form); + form.deleteAll(); + + if (tempTime == 1) { + log("Getting map once a minute..."); + } + else { + log("Getting map every " + String.valueOf(tempTime) + " minutes..."); + } + } + + private void loadZoomScreen() { + zoomScreen = new Form("Zoom"); + zoomGauge = new Gauge("Google Map Zoom", true, 17, Integer.parseInt(zoomLevel)); + zoomStringItem = new StringItem(null, ""); + zoomStringItem.setText("Zoom level: " + zoomGauge.getValue()); + backCmd = new Command("Back", Command.SCREEN, 1); + + zoomScreen.append(zoomGauge); + zoomScreen.append(zoomStringItem); + zoomScreen.addCommand(backCmd); + zoomScreen.setItemStateListener(this); + zoomScreen.setCommandListener(this); + + display.setCurrent(zoomScreen); + } + + // this method is called every time the zoom guage changes value. the zoom level is + // reset and saved + public void itemStateChanged(Item item) { + if (item == zoomGauge) { + zoomStringItem.setText("Zoom level: " + zoomGauge.getValue()); + zoomLevel = String.valueOf(zoomGauge.getValue()); + + try { + rms.put("zoomLevel", zoomLevel); + rms.save(); + } + catch (Exception e) { + log("GPSTracker.itemStateChanged: " + e); + } + } + } + + private void loadSettingsScreen() { + settingsScreen = new Form("Settings"); + + phoneNumberTextField = new TextField("Phone number or user name", phoneNumber, 20, TextField.ANY); + uploadWebsiteTextField = new TextField("Upload website", uploadWebsite, 100, TextField.ANY); + settingsScreen.append(phoneNumberTextField); + settingsScreen.append(uploadWebsiteTextField); + + String[] times = { "1 minute", "2 minutes", "3 minutes", "5 minutes", "10 minutes"}; + updateIntervalCG = new ChoiceGroup("Update map how often?", ChoiceGroup.EXCLUSIVE, times, null); + updateIntervalCG.setSelectedIndex(Integer.parseInt(updateInterval), true); + settingsScreen.append(updateIntervalCG); + + saveCmd = new Command("Save", Command.SCREEN, 1); + settingsScreen.addCommand(saveCmd); + + settingsScreen.setCommandListener(this); + display.setCurrent(settingsScreen); + } + + // get the settings from the phone's storage and load 4 global variables + public void getSettingsFromRMS() { + try { + rms = new RMS(this, "GPSTracker"); + + phoneNumber = rms.get("phoneNumber"); + uploadWebsite = rms.get("uploadWebsite"); + zoomLevel = rms.get("zoomLevel"); + updateInterval = rms.get("updateInterval"); + } + catch (Exception e) { + log("GPSTracker.getSettingsFromRMS: " + e); + } + + if ((uploadWebsite == null) || (uploadWebsite.trim().length() == 0)) { + uploadWebsite = defaultUploadWebsite; + } + + if ((zoomLevel == null) || (zoomLevel.trim().length() == 0)) { + zoomLevel = "12"; + } + if ((updateInterval == null) || (updateInterval.trim().length() == 0)) { + updateInterval = "1"; + } + } + + private boolean hasPhoneNumber() { + if ((phoneNumber == null) || (phoneNumber.trim().length() == 0)) { + log("Phone number required. Please go to settings."); + return false; + } + else { + return true; + } + } + + // gps is started with the update interval. the interval is the time in between + // map updates + private void startGPS() { + if (gps == null) { + gps = new GPS(this, iTimes[Integer.parseInt(updateInterval)], uploadWebsite); + gps.startGPS(); + } + } + + // this is called when the user changes the interval in the settings screen + private void changeInterval() { + if (gps == null) { + startGPS(); + } + else { + gps.changeInterval(iTimes[Integer.parseInt(updateInterval)]); + } + } + + // save settings back to phone memory + private void saveSettingsToRMS() { + try { + phoneNumber = phoneNumberTextField.getString(); + uploadWebsite = uploadWebsiteTextField.getString(); + updateInterval = String.valueOf(updateIntervalCG.getSelectedIndex()); + + rms.put("phoneNumber", phoneNumber); + rms.put("uploadWebsite", uploadWebsite); + rms.put("updateInterval", updateInterval); + + rms.save(); + } + catch (Exception e) { + log("GPSTracker.saveSettings: " + e); + } + display.setCurrent(form); + } + + // this method displays the map image, it is called from the networker object + public void showMap(boolean flag) + { + if (flag == false) { + log("Map could not be downloaded."); + } + else { + ImageItem imageitem = new ImageItem(null, im, ImageItem.LAYOUT_DEFAULT, null); + + if(form.size()!= 0) { + form.set(0, imageitem); + } + else { + form.append(imageitem); + } + } + } + + public void log(String text) { + StringItem si = new StringItem(null, text); + si.setLayout(Item.LAYOUT_NEWLINE_AFTER); + form.append(si); + } + + public void commandAction(Command cmd, Displayable screen) { + if (cmd == exitCmd) { + shutDownApp(); + } + else if (cmd == saveCmd) { + saveSettingsToRMS(); + + if (hasPhoneNumber()) { + changeInterval(); + displayInterval(); + } + } + else if (cmd == settingsCmd) { + loadSettingsScreen(); + } + else if (cmd == zoomCmd) { + loadZoomScreen(); + } + else if (cmd == backCmd) { + displayInterval(); + } + } + + public void pauseApp() {} + + public void destroyApp(boolean unconditional) {} + + protected void shutDownApp() { + destroyApp(true); + notifyDestroyed(); + } +} + + + diff --git a/GPSTrackerPhp/Phone/GPSTracker2.0/src/NetWorker.java b/GPSTrackerPhp/Phone/GPSTracker2.0/src/NetWorker.java new file mode 100755 index 0000000..ebae7f4 --- /dev/null +++ b/GPSTrackerPhp/Phone/GPSTracker2.0/src/NetWorker.java @@ -0,0 +1,112 @@ +// Please leave the link below with the source code, thank you. +// http://www.websmithing.com/portal/Programming/tabid/55/articleType/ArticleView/articleId/6/Google-Map-GPS-Cell-Phone-Tracker-Version-2.aspx + +import javax.microedition.io.*; +import java.io.*; +import javax.microedition.lcdui.Image; + +public class NetWorker { + private GPSTracker midlet; + private String uploadWebsite; + int i = 1; + + public NetWorker(GPSTracker lbsMidlet, String UploadWebsite){ + this.midlet = lbsMidlet; + this.uploadWebsite = UploadWebsite; + } + + public void getUrl(String queryString) { + queryString = URLencodeSpaces(queryString); + String url = uploadWebsite + queryString; + HttpConnection httpConn = null; + InputStream inputStream = null; + DataInputStream iStrm = null; + ByteArrayOutputStream bStrm = null; + Image im = null; + + try{ + httpConn = (HttpConnection)Connector.open(url); + + if(httpConn.getResponseCode() == HttpConnection.HTTP_OK){ + inputStream = httpConn.openInputStream(); + iStrm = new DataInputStream(inputStream); + + byte imageData[]; + int length = (int)httpConn.getLength(); + + if(length != -1) { + imageData = new byte[length]; + iStrm.readFully(imageData); + } + else { //Length not available + bStrm = new ByteArrayOutputStream(); + int ch; + + while((ch = iStrm.read())!= -1) { + bStrm.write(ch); + } + imageData = bStrm.toByteArray(); + + } + im = Image.createImage(imageData, 0, imageData.length); + } + else { + midlet.log("NetWorker.getUrl responseCode: " + httpConn.getResponseCode()); + } + + } catch (Exception e) { + midlet.log("NetWorker.getUrl: " + e); + } + finally{ // Clean up + try{ + if(bStrm != null) + bStrm.close(); + if(iStrm != null) + iStrm.close(); + if(inputStream != null) + inputStream.close(); + if(httpConn != null) + httpConn.close(); + } + catch(Exception e){} + } + + // if we have successfully gotten a map image, then we want to display it + if( im == null) { + midlet.showMap(false); + } + else { + midlet.im = im; + midlet.showMap(true); + } + + } + + // http://forum.java.sun.com/thread.jspa?threadID=341790&messageID=1408555 + private String URLencodeSpaces(String s) + { + if (s != null) { + StringBuffer tmp = new StringBuffer(); + int i = 0; + try { + while (true) { + int b = (int)s.charAt(i++); + + if (b != 0x20) { + tmp.append((char)b); + } + else { + tmp.append("%"); + if (b <= 0xf) { + tmp.append("0"); + } + tmp.append(Integer.toHexString(b)); + } + } + } + catch (Exception e) {} + return tmp.toString(); + } + return null; + } +} diff --git a/GPSTrackerPhp/Phone/GPSTracker2.0/src/RMS.java b/GPSTrackerPhp/Phone/GPSTracker2.0/src/RMS.java new file mode 100755 index 0000000..da626ff --- /dev/null +++ b/GPSTrackerPhp/Phone/GPSTracker2.0/src/RMS.java @@ -0,0 +1,79 @@ +// Wireless Java Developing with J2ME, Jonathan Knudsen + +import java.util.*; +import javax.microedition.rms.*; + +public class RMS { + private GPSTracker midlet; + private String mRecordStoreName; + private Hashtable mHashtable; + + public RMS(GPSTracker Midlet, String recordStoreName) throws RecordStoreException { + this.midlet = Midlet; + this.mRecordStoreName = recordStoreName; + this.mHashtable = new Hashtable(); + load(); + } + + public String get(String key) { + return (String)mHashtable.get(key); + } + + public void put(String key, String value) { + if (value == null) value = ""; + mHashtable.put(key, value); + } + + private void load() throws RecordStoreException { + RecordStore rs = null; + RecordEnumeration re = null; + + try { + rs = RecordStore.openRecordStore(mRecordStoreName, true); + re = rs.enumerateRecords(null, null, false); + while (re.hasNextElement()) { + byte[] raw = re.nextRecord(); + String pref = new String(raw); + // Parse out the name. + int index = pref.indexOf('|'); + String name = pref.substring(0, index); + String value = pref.substring(index + 1); + put(name, value); + } + } + finally { + if (re != null) re.destroy(); + if (rs != null) rs.closeRecordStore(); + } + } + + public void save() throws RecordStoreException { + RecordStore rs = null; + RecordEnumeration re = null; + try { + rs = RecordStore.openRecordStore(mRecordStoreName, true); + re = rs.enumerateRecords(null, null, false); + + // First remove all records, a little clumsy. + while (re.hasNextElement()) { + int id = re.nextRecordId(); + rs.deleteRecord(id); + } + + // Now save the preferences records. + Enumeration keys = mHashtable.keys(); + while (keys.hasMoreElements()) { + String key = (String)keys.nextElement(); + String value = get(key); + String pref = key + "|" + value; + byte[] raw = pref.getBytes(); + rs.addRecord(raw, 0, raw.length); + } + } + finally { + if (re != null) re.destroy(); + if (rs != null) rs.closeRecordStore(); + } + } + +} diff --git a/GPSTrackerPhp/ReadMe.txt b/GPSTrackerPhp/ReadMe.txt new file mode 100755 index 0000000..2ca6eeb --- /dev/null +++ b/GPSTrackerPhp/ReadMe.txt @@ -0,0 +1,107 @@ + +Google Map GPS Cell Phone Tracker, Version 2.0 + +Installation + +There are 3 parts to this project, the website, the database and the phone app. I will describe the installation for all 3 parts. First unzip the files. There are some basic requirements for using this app. The first is that you have a GPS cellphone that has a data plan (so that you can access your website). Your carrier must support GPS, I used Sprint/Nextel with the Motorola i355 phone. + +The second is an webserver running PHP and the MySQLi.dll extension. + +http://www.php.net/ + +The MySQLi extension is required so that stored procedures in the database can be called from php. Here are the instructions on how to intall it: + +http://forge.mysql.com/wiki/PHP_FAQ#Loading_the_MySQLi_extension_into_PHP + +and here is where you can find the MySQLi.dll: + +http://dev.mysql.com/get/Downloads/Connector-PHP-mysqlnd/php_5.2.1-mysqlnd-5.0.1-beta.zip/from/pick + +when the extension is properly installed, the extension section will show up on the php_info.php webpage which is included in this distribution. + +The third is MySQL 5.0 or higher: + +http://dev.mysql.com/downloads/mysql/5.0.html#downloads + +Version 5.0 or greater is required for stored procedures. + +******************************************************* + +Website: + +Go to http://www.google.com/apis/maps/signup.html and get your API key for your website. You must have your own domain name. You cannot use localhost on your home computer unless it has it's own domain name. The key needs to be added to the 2 following files: + +displaymap2.php +getgooglemap2.php + +You may need to add a new mime type to Apache so that jad files are recognized. This can be done in httpd.conf file (someone please correct me if I am wrong). If you try to browse with your phone to the jad file and it is not recognized, then you probably need to add this mime type. + +For example: + + +AddType text/vnd.sun.j2me.app-descriptor .jad + + +in the file dbconnect2.php, you need to change the host, username and password for your mysql installation. + +******************************************************* + +Database: + +There are 2 ways to create the database. Create a database called GPSTracker2 and then restore the database with the file GPSTracker2.sql using MySQL Administrator. There is some sample GPS data in this database. + +If you are using phpMyAdmin, you may need to change the import file. Look at the stored procedures in the GPSTracker.sql file, this is the first line of one them: + +CREATE DEFINER=`root`@`localhost` PROCEDURE `prcDeleteRoute`( + +If phpMyAdmin complains about trying to intall the 4 procedures, then remove the DEFINER of all 4 procedures like this: + +CREATE PROCEDURE `prcDeleteRoute`( + +They should install then. The file data.sql contains sample data. + +******************************************************* + +Phone: + +The best thing about version 2 of the gps tracker is that the phone application does not need to be compiled. Version 1 required everyone to download netbeans and compile the app. You can still compile the application if you want, the instructions for that are below. + +The first thing you need to do is get the application onto your phone. If you have installed the website and set the mime type for jad files (see above), you can then browse to the application with your phone. For example: + +http://www.mywebsite.com/gpstracker/phone/ + +Download the app and go to settings and set the phone number, download website and interval. The phone number can be any string, for instance, someone's name. If you want to uniquely identify routes, use an actual phone number. + +If you try using the phone with the default download website (websmithing), you can test if your phone is working by going to: + +http://www.websmithing.com/gpstracker/DisplayMap2.aspx + +and viewing the route you created with your phone. + +The second way to get the app onto your phone is to use a cable and your cell phone's application loader software that comes with your cell phone. + +For those of you who need to alter or recompile the phone application, here's what you need. + +Download netbeans from here: + +http://download.netbeans.org/netbeans/6.0/final/ + +choose the one that says Mobility. + +Go to http://java.sun.com/products/sjwtoolkit/download-2_5_1.html and download: + +Sun Java Wireless Toolkit 2.5.1 for CLDC + +The link is about 3/4 of the way down the page. The directory must be in the root (C:\) with *no spaces*. It defaults to C:\WTK25. I would use that... Start Net Beans IDE and go to File/Open Project menu and open up the GPSTracker2.0 project. In netbeans, right click on the word GPSTracker2.0, you will find it up in the upper left hand corner. Click on the Platform menu item and then the button that says manage emulators. cLick "add platform" and select "Java Micro Edition Platform Emulator" and click next. A list will be generated, then click the C:\WTK25 2.5.1 Wireless Toolket that you installed earlier. + +Now go ahead and build the application. The 2 files that you need are in the Phone/dist folder. They are GPST2.0.jar and GPST2.0.jad. + +******************************************************* + +Please leave the link below with the source code, thank you. +http://www.websmithing.com/portal/Programming/tabid/55/articleType/ArticleView/articleId/6/Google-Map-GPS-Cell-Phone-Tracker-Version-2.aspx + + + + + \ No newline at end of file diff --git a/GPSTrackerPhp/Website/GPSTracker/dbconnect2.php b/GPSTrackerPhp/Website/GPSTracker/dbconnect2.php new file mode 100755 index 0000000..3976c4b --- /dev/null +++ b/GPSTrackerPhp/Website/GPSTracker/dbconnect2.php @@ -0,0 +1,17 @@ + \ No newline at end of file diff --git a/GPSTrackerPhp/Website/GPSTracker/deleteroute.php b/GPSTrackerPhp/Website/GPSTracker/deleteroute.php new file mode 100755 index 0000000..48d7c17 --- /dev/null +++ b/GPSTrackerPhp/Website/GPSTracker/deleteroute.php @@ -0,0 +1,15 @@ +multi_query($query)) { + die('$mysqli->multi_query: ' . $mysqli->error); + } + + $mysqli->close(); +?> diff --git a/GPSTrackerPhp/Website/GPSTracker/displaymap2.php b/GPSTrackerPhp/Website/GPSTracker/displaymap2.php new file mode 100755 index 0000000..b8b152e --- /dev/null +++ b/GPSTrackerPhp/Website/GPSTracker/displaymap2.php @@ -0,0 +1,106 @@ + + + + Google Map GPS Cell Phone Tracker + + + + + + + + + + + +
GPS Tracker
+
+ + + + + + + + + + + + + + + + + + + + + + diff --git a/GPSTrackerPhp/Website/GPSTracker/getgooglemap2.php b/GPSTrackerPhp/Website/GPSTracker/getgooglemap2.php new file mode 100755 index 0000000..7510bf4 --- /dev/null +++ b/GPSTrackerPhp/Website/GPSTracker/getgooglemap2.php @@ -0,0 +1,92 @@ +multi_query($query)) { + die('$mysqli->multi_query: ' . $mysqli->error); + } + + $mysqli->close(); + + // build the Google map url + $mapUrl = $url + . '?markers=' + . $lat + . ',' + . $lng + . ',blueu&zoom=' + . $zoom + . '&size=' + . $width + . 'x' + . $height + . '&maptype=mobile&key=' + . $key; + + // get the map image + $map = imageCreateFromGIF($mapUrl); + + // send the map put as a png, java me is required to handle png images + header('Content-type: image/png'); + imagePNG($map); + imageDestroy($map); + + + function getDateFromJavaDate($theDate) { + // need to convert from this: Fri May 19 21:03:48 GMT-08:00 2007 + // to this: 2008-04-17 12:07:02, MySQL DATETIME + + $months = array("1"=>"Jan", "2"=>"Feb", "3"=>"Mar", "4"=>"Apr", "5"=>"May", "6"=>"Jun", + "7"=>"Jul" ,"8"=>"Aug", "9"=>"Sep", "10"=>"Oct", "11"=>"Nov", "12"=>"Dec"); + + $hour = substr($theDate, 11, 2); + $minute = substr($theDate, 14, 2); + $day = substr($theDate, 8, 2); + $month = substr($theDate, 4, 3); + $year = substr($theDate, strlen($theDate) - 4, 4); + + $format = '%Y-%m-%d %I:%M:%S'; + + return strftime($format, mktime($hour, $minute, 0, array_search($month, $months), $day, $year)); + } + +?> diff --git a/GPSTrackerPhp/Website/GPSTracker/getgpslocations2.php b/GPSTrackerPhp/Website/GPSTracker/getgpslocations2.php new file mode 100755 index 0000000..85214fa --- /dev/null +++ b/GPSTrackerPhp/Website/GPSTracker/getgpslocations2.php @@ -0,0 +1,33 @@ +'; + + // execute query + if ($mysqli->multi_query($query)) { + + do { + if ($result = $mysqli->store_result()) { + while ($row = $result->fetch_row()) { + $xml .= $row[0]; + } + $result->close(); + } + } while ($mysqli->next_result()); + } + else { + die('$mysqli->multi_query: ' . $mysqli->error); + } + + $xml .= ''; + + header('Content-Type: text/xml'); + echo $xml; + + $mysqli->close(); +?> diff --git a/GPSTrackerPhp/Website/GPSTracker/getroutes.php b/GPSTrackerPhp/Website/GPSTracker/getroutes.php new file mode 100755 index 0000000..64f969e --- /dev/null +++ b/GPSTrackerPhp/Website/GPSTracker/getroutes.php @@ -0,0 +1,33 @@ +'; + + // execute query + if ($mysqli->multi_query($query)) { + + do { + if ($result = $mysqli->store_result()) { + while ($row = $result->fetch_row()) { + $xml .= $row[0]; + } + $result->close(); + } + } while ($mysqli->next_result()); + } + else { + die('$mysqli->multi_query: ' . $mysqli->error); + } + + $xml .= ''; + + header('Content-Type: text/xml'); + echo $xml; + + $mysqli->close(); +?> diff --git a/GPSTrackerPhp/Website/GPSTracker/images/ajax-loader.gif b/GPSTrackerPhp/Website/GPSTracker/images/ajax-loader.gif new file mode 100755 index 0000000..3c2f7c0 --- /dev/null +++ b/GPSTrackerPhp/Website/GPSTracker/images/ajax-loader.gif Binary files differ diff --git a/GPSTrackerPhp/Website/GPSTracker/images/compassE.jpg b/GPSTrackerPhp/Website/GPSTracker/images/compassE.jpg new file mode 100755 index 0000000..e7ef937 --- /dev/null +++ b/GPSTrackerPhp/Website/GPSTracker/images/compassE.jpg Binary files differ diff --git a/GPSTrackerPhp/Website/GPSTracker/images/compassN.jpg b/GPSTrackerPhp/Website/GPSTracker/images/compassN.jpg new file mode 100755 index 0000000..03f4998 --- /dev/null +++ b/GPSTrackerPhp/Website/GPSTracker/images/compassN.jpg Binary files differ diff --git a/GPSTrackerPhp/Website/GPSTracker/images/compassNE.jpg b/GPSTrackerPhp/Website/GPSTracker/images/compassNE.jpg new file mode 100755 index 0000000..fd8d380 --- /dev/null +++ b/GPSTrackerPhp/Website/GPSTracker/images/compassNE.jpg Binary files differ diff --git a/GPSTrackerPhp/Website/GPSTracker/images/compassNW.jpg b/GPSTrackerPhp/Website/GPSTracker/images/compassNW.jpg new file mode 100755 index 0000000..6ef421d --- /dev/null +++ b/GPSTrackerPhp/Website/GPSTracker/images/compassNW.jpg Binary files differ diff --git a/GPSTrackerPhp/Website/GPSTracker/images/compassS.jpg b/GPSTrackerPhp/Website/GPSTracker/images/compassS.jpg new file mode 100755 index 0000000..841f24c --- /dev/null +++ b/GPSTrackerPhp/Website/GPSTracker/images/compassS.jpg Binary files differ diff --git a/GPSTrackerPhp/Website/GPSTracker/images/compassSE.jpg b/GPSTrackerPhp/Website/GPSTracker/images/compassSE.jpg new file mode 100755 index 0000000..1253e8b --- /dev/null +++ b/GPSTrackerPhp/Website/GPSTracker/images/compassSE.jpg Binary files differ diff --git a/GPSTrackerPhp/Website/GPSTracker/images/compassSW.jpg b/GPSTrackerPhp/Website/GPSTracker/images/compassSW.jpg new file mode 100755 index 0000000..62ddf3d --- /dev/null +++ b/GPSTrackerPhp/Website/GPSTracker/images/compassSW.jpg Binary files differ diff --git a/GPSTrackerPhp/Website/GPSTracker/images/compassW.jpg b/GPSTrackerPhp/Website/GPSTracker/images/compassW.jpg new file mode 100755 index 0000000..f694a4d --- /dev/null +++ b/GPSTrackerPhp/Website/GPSTracker/images/compassW.jpg Binary files differ diff --git a/GPSTrackerPhp/Website/GPSTracker/images/coolblue_small.png b/GPSTrackerPhp/Website/GPSTracker/images/coolblue_small.png new file mode 100755 index 0000000..597a53e --- /dev/null +++ b/GPSTrackerPhp/Website/GPSTracker/images/coolblue_small.png Binary files differ diff --git a/GPSTrackerPhp/Website/GPSTracker/images/coolred_small.png b/GPSTrackerPhp/Website/GPSTracker/images/coolred_small.png new file mode 100755 index 0000000..47384e2 --- /dev/null +++ b/GPSTrackerPhp/Website/GPSTracker/images/coolred_small.png Binary files differ diff --git a/GPSTrackerPhp/Website/GPSTracker/images/coolshadow_small.png b/GPSTrackerPhp/Website/GPSTracker/images/coolshadow_small.png new file mode 100755 index 0000000..3a89759 --- /dev/null +++ b/GPSTrackerPhp/Website/GPSTracker/images/coolshadow_small.png Binary files differ diff --git a/GPSTrackerPhp/Website/GPSTracker/images/cooltransparent_small.png b/GPSTrackerPhp/Website/GPSTracker/images/cooltransparent_small.png new file mode 100755 index 0000000..ba7ed91 --- /dev/null +++ b/GPSTrackerPhp/Website/GPSTracker/images/cooltransparent_small.png Binary files differ diff --git a/GPSTrackerPhp/Website/GPSTracker/javascript/maps2.js b/GPSTrackerPhp/Website/GPSTracker/javascript/maps2.js new file mode 100755 index 0000000..697bdc4 --- /dev/null +++ b/GPSTrackerPhp/Website/GPSTracker/javascript/maps2.js @@ -0,0 +1,301 @@ +// Please leave the link below with the source code, thank you. +// http://www.websmithing.com/portal/Programming/tabid/55/articleType/ArticleView/articleId/6/Google-Map-GPS-Cell-Phone-Tracker-Version-2.aspx + +function loadRoutes(data, responseCode) { + if (data.length == 0) { + showMessage('There are no routes available to view.'); + map.innerHTML = ''; + } + else { + // get list of routes + var xml = GXml.parse(data); + + var routes = xml.getElementsByTagName("route"); + + // create the first option of the dropdown box + var option = document.createElement('option'); + option.setAttribute('value', '0'); + option.innerHTML = 'Select Route...'; + routeSelect.appendChild(option); + + // iterate through the routes and load them into the dropdwon box. + for (i = 0; i < routes.length; i++) { + var option = document.createElement('option'); + option.setAttribute('value', '?sessionID=' + routes[i].getAttribute("sessionID") + + '&phoneNumber=' + routes[i].getAttribute("phoneNumber")); + option.innerHTML = routes[i].getAttribute("phoneNumber") + " " + routes[i].getAttribute("times"); + routeSelect.appendChild(option); + } + + // need to reset this for firefox + routeSelect.selectedIndex = 0; + + hideWait(); + showMessage('Please select a route below.'); + } + +} + +// this will get the map and route, the route is selected from the dropdown box +function getRouteForMap() { + if (hasMap()) { + showWait('Getting map...'); + var url = 'getgpslocations2.php' + routeSelect.options[routeSelect.selectedIndex].value; + GDownloadUrl(url, loadGPSLocations); + } + else { + alert("Please select a route before trying to refresh map."); + } +} + +// check to see if we have a map loaded, don't want to autorefresh or delete without it +function hasMap() { + if (routeSelect.selectedIndex == 0) { // means no map + return false; + } + else { + return true; + } +} + +function loadGPSLocations(data, responseCode) { + if (data.length == 0) { + showMessage('There is no tracking data to view.'); + map.innerHTML = ''; + } + else { + if (GBrowserIsCompatible()) { + + // create list of GPS data locations from our XML + var xml = GXml.parse(data); + + // markers that we will display on Google map + var markers = xml.getElementsByTagName("locations"); + + // get rid of the wait gif + hideWait(); + + // create new map and add zoom control and type of map control + var map = new GMap2(document.getElementById("map")); + map.addControl(new GSmallMapControl()); + map.addControl(new GMapTypeControl()); + + var length = markers.length; + + // center map on last marker so we can see progress during refreshes + map.setCenter(new GLatLng(parseFloat(markers[length-1].getAttribute("latitude")), + parseFloat(markers[length-1].getAttribute("longitude"))), zoomLevel); + + // interate through all our GPS data, create markers and add them to map + for (var i = 0; i < length; i++) { + var point = new GLatLng(parseFloat(markers[i].getAttribute("latitude")), + parseFloat(markers[i].getAttribute("longitude"))); + + var marker = createMarker(i, length, point, + markers[i].getAttribute("speed"), + markers[i].getAttribute("direction"), + markers[i].getAttribute("distance"), + markers[i].getAttribute("locationMethod"), + markers[i].getAttribute("gpsTime"), + markers[i].getAttribute("phoneNumber"), + markers[i].getAttribute("sessionID"), + markers[i].getAttribute("accuracy"), + markers[i].getAttribute("isLocationValid"), + markers[i].getAttribute("extraInfo")); + + // add markers to map + map.addOverlay(marker); + } + } + + // show route name + showMessage(routeSelect.options[routeSelect.selectedIndex].innerHTML); + } +} + +function createMarker(i, length, point, speed, direction, distance, locationMethod, gpsTime, + phoneNumber, sessionID, accuracy, isLocationValid, extraInfo) { + var icon = new GIcon(); + + // make the most current marker red + if (i == length - 1) { + icon.image = "images/coolred_small.png"; + } + else { + icon.image = "images/coolblue_small.png"; + } + + icon.shadow = "images/coolshadow_small.png"; + icon.iconSize = new GSize(12, 20); + icon.shadowSize = new GSize(22, 20); + icon.iconAnchor = new GPoint(6, 20); + icon.infoWindowAnchor = new GPoint(5, 1); + + var marker = new GMarker(point,icon); + + // this describes how we got our location data, either by satellite or by cell phone tower + var lm = ""; + if (locationMethod == "8") { + lm = "Cell Tower"; + } else if (locationMethod == "327681") { + lm = "Satellite"; + } else { + lm = locationMethod; + } + + var str = ""; + + // when a user clicks on last marker, let them know it's final one + if (i == length - 1) { + str = " Final location"; + } + + // this creates the pop up bubble that displays info when a user clicks on a marker + GEvent.addListener(marker, "click", function() { + marker.openInfoWindowHtml( + "" + + "" + + "" + + "" + + "" + + "" + + "" + + "" + + "" + + "" + + + "
  " + + "/" + + str + + "
Speed:" + speed + " mph
Distance:" + distance + " mi 
Time:" + gpsTime + "
Method:" + lm + " 
Phone #:" + phoneNumber + " 
Session ID:" + sessionID + " 
Accuracy:" + accuracy + " ft 
Location Valid:" + isLocationValid + " 
Extra Info:" + extraInfo + " 
" + ); + }); + + return marker; +} + +// this chooses the proper image for our litte compass in the popup window +function getCompassImage(azimuth) { + if ((azimuth >= 337 && azimuth <= 360) || (azimuth >= 0 && azimuth < 23)) + return "compassN"; + if (azimuth >= 23 && azimuth < 68) + return "compassNE"; + if (azimuth >= 68 && azimuth < 113) + return "compassE"; + if (azimuth >= 113 && azimuth < 158) + return "compassSE"; + if (azimuth >= 158 && azimuth < 203) + return "compassS"; + if (azimuth >= 203 && azimuth < 248) + return "compassSW"; + if (azimuth >= 248 && azimuth < 293) + return "compassW"; + if (azimuth >= 293 && azimuth < 337) + return "compassNW"; + + return ""; +} + +function deleteRoute() { + if (hasMap()) { + var answer = confirm("This will permanently delete this route\n from the database. Do you want to delete?") + if (answer){ + showWait('Deleting route...'); + var url = 'deleteroute.php' + routeSelect.options[routeSelect.selectedIndex].value; + GDownloadUrl(url, deleteRouteResponse); + } + else { + return false; + } + } + else { + alert("Please select a route before trying to delete."); + } +} + +function deleteRouteResponse(data, responseCode) { + map.innerHTML = ''; + routeSelect.length = 0; + GDownloadUrl('getroutes.php', loadRoutes); +} + +// auto refresh the map. there are 3 transitions (shown below). transitions happen when a user +// selects an option in the auto refresh dropdown box. an interval is an amount of time in between +// refreshes of the map. for instance, auto refresh once a minute. in the method below, the 3 numbers +// in the code show where the 3 transitions are handled. setInterval turns on a timer that calls +// the getRouteForMap() method every so many seconds based on the value of newInterval. +// clearInterval turns off the timer. if newInterval is 5, then the value passed to setInterval is +// 5000 milliseconds or 5 seconds. +function autoRefresh() { + /* + 1) going from off to any interval + 2) going from any interval to off + 3) going from one interval to another + */ + + if (hasMap()) { + newInterval = refreshSelect.options[refreshSelect.selectedIndex].value; + + if (currentInterval > 0) { // currently running at an interval + + if (newInterval > 0) { // moving to another interval (3) + clearInterval(intervalID); + intervalID = setInterval("getRouteForMap();", newInterval * 1000); + currentInterval = newInterval; + } + else { // we are turning off (2) + clearInterval(intervalID); + newInterval = 0; + currentInterval = 0; + } + } + else { // off and going to an interval (1) + intervalID = setInterval("getRouteForMap();", newInterval * 1000); + currentInterval = newInterval; + } + + // show what auto refresh action was taken and after 5 seconds, display the route name again + showMessage(refreshSelect.options[refreshSelect.selectedIndex].innerHTML); + setTimeout('showRouteName();', 5000); + } + else { + alert("Please select a route before trying to refresh map."); + refreshSelect.selectedIndex = 0; + } +} + +function changeZoomLevel() { + if (hasMap()) { + zoomLevel = zoomLevelSelect.selectedIndex + 1; + + getRouteForMap(); + + // show what zoom level action was taken and after 5 seconds, display the route name again + showMessage(zoomLevelSelect.options[zoomLevelSelect.selectedIndex].innerHTML); + setTimeout('showRouteName();', 5000); + } + else { + alert("Please select a route before selecting zoom level."); + zoomLevelSelect.selectedIndex = zoomLevel - 1; + } +} + +function showMessage(message) { + messages.innerHTML = 'GPS Tracker: ' + message + ''; +} + +function showRouteName() { + showMessage(routeSelect.options[routeSelect.selectedIndex].innerHTML); +} + +function showWait(theMessage) { + map.innerHTML = ''; + showMessage(theMessage); +} + +function hideWait() { + map.innerHTML = ''; + messages.innerHTML = 'GPS Tracker'; +} + diff --git a/GPSTrackerPhp/Website/GPSTracker/phone/GPST2.0.jad b/GPSTrackerPhp/Website/GPSTracker/phone/GPST2.0.jad new file mode 100755 index 0000000..1ccf57c --- /dev/null +++ b/GPSTrackerPhp/Website/GPSTracker/phone/GPST2.0.jad @@ -0,0 +1,11 @@ +MIDlet-1: GPSTracker,/res/gps32.png,GPSTracker +MIDlet-Icon: /res/gps32.png +MIDlet-Info-URL: www.websmithing.com +MIDlet-Jar-Size: 9179 +MIDlet-Jar-URL: GPST2.0.jar +MIDlet-Name: GPSTracker2.0 +MIDlet-Permissions: javax.microedition.io.Connector.http, javax.microedition.location.Location +MIDlet-Vendor: Websmithing +MIDlet-Version: 2.0 +MicroEdition-Configuration: CLDC-1.1 +MicroEdition-Profile: MIDP-2.0 diff --git a/GPSTrackerPhp/Website/GPSTracker/phone/download.html b/GPSTrackerPhp/Website/GPSTracker/phone/download.html new file mode 100755 index 0000000..8c57d30 --- /dev/null +++ b/GPSTrackerPhp/Website/GPSTracker/phone/download.html @@ -0,0 +1,15 @@ + + + + + Google Map GPS Cell Phone Tracker + + +
+ GPS Tracker download for cell phones. +
+ GPST2.0.jad + +
+ + diff --git a/GPSTrackerPhp/Website/GPSTracker/php_info.php b/GPSTrackerPhp/Website/GPSTracker/php_info.php new file mode 100755 index 0000000..008e91f --- /dev/null +++ b/GPSTrackerPhp/Website/GPSTracker/php_info.php @@ -0,0 +1,5 @@ + \ No newline at end of file diff --git a/GPSTrackerPhp/Website/GPSTracker/styles/styles.css b/GPSTrackerPhp/Website/GPSTracker/styles/styles.css new file mode 100755 index 0000000..ed7f8d8 --- /dev/null +++ b/GPSTrackerPhp/Website/GPSTracker/styles/styles.css @@ -0,0 +1,71 @@ +/* +Please leave the link below with the source code, thank you. +http://www.websmithing.com/portal/Programming/tabid/55/articleType/ArticleView/articleId/6/Google-Map-GPS-Cell-Phone-Tracker-Version-2.aspx +*/ + +* { + margin: 0; + padding: 0; +} +body { + font-family: arial, helvetica, sans-serif; +} +#messages +{ + position:absolute; + left: 10px; + top: 10px; + width:700px; +} +#map +{ + position:absolute; + left: 10px; + top: 40px; + width:700px; + height:450px; + border:1px; + border-style:solid; + background-color:#FFF; +} + +#selectRoute +{ + position:absolute; + left: 10px; + top: 510px; + width: 575px; +} + +#selectRefresh +{ + position:absolute; + left: 10px; + top: 550px; + width: 250px; +} + +#selectZoomLevel +{ + position:absolute; + left: 335px; + top: 550px; + width: 250px; +} + +#delete +{ + position:absolute; + left: 625px; + top: 510px; + width: 75px; +} + +#refresh +{ + position:absolute; + left: 625px; + top: 550px; + width: 75px; +} + diff --git a/LICENSE b/LICENSE deleted file mode 100644 index 2db9bce..0000000 --- a/LICENSE +++ /dev/null @@ -1,20 +0,0 @@ -The MIT License (MIT) - -Copyright (c) 2013 Nick Fox - -Permission is hereby granted, free of charge, to any person obtaining a copy of -this software and associated documentation files (the "Software"), to deal in -the Software without restriction, including without limitation the rights to -use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of -the Software, and to permit persons to whom the Software is furnished to do so, -subject to the following conditions: - -The above copyright notice and this permission notice shall be included in all -copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS -FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR -COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER -IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN -CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. diff --git a/README.md b/README.md deleted file mode 100644 index 95a8cd3..0000000 --- a/README.md +++ /dev/null @@ -1,41 +0,0 @@ -![gpstracker](https://raw2.github.com/nickfox/GpsTracker/master/gpstracker_small.png)GpsTracker -------------- - -##### Google Map Gps Cell Phone Tracker - -This project allows you to track cell phones periodically. For instance every minute or every five minutes. You can watch the cell phone being tracked in real time using google maps and you can store and reload routes easily. - -You have the choice of two server stacks. Either using asp.net and sql server or using php and mysql. Historically, devs have downloaded the asp.net server project 2 to 1 over the php project. I have included both now in the same download but you only need to use one. - -If you need help, please go to: - -http://www.websmithing.com/gps-tracker/ - -************* - -##### Status update for Jan 14, 2014 -Version 3 of GpsTracker is complete. This was a very big change from the last version. It's been updated with ios, android, windowsPhone and java me/j2me phone clients and the servers have all been updated as well. Please let me know how it works, good or bad and create an issue if you find a problem. Thanks and enjoy the software, Nick. - -ps. I will be writing tutorials and documentation shortly. - -************* - -##### Status update for Jan 11, 2014 -Have updated the .NET server code to visual studio 2012 for web and the database code to sql server express. All four phone clients are now complete and are fully functional with the .NET website. - -The php version should be finished in the next day or so. - -************* - -##### Status update for Dec 23, 2013 -Just finished the android project so that's 3 down and one more to go, the ios project. That should be done within a few days. - -************* - -##### Status update for Dec 20, 2013 -I'm building the android project right now using the new google play services. Absolutely amazing new library by google. I hope to have it posted before the new year. - -Check out this google IO talk by the guys who wrote this excellent library. - -https://developers.google.com/events/io/sessions/325337477 - diff --git a/gpstracker_small.png b/gpstracker_small.png deleted file mode 100644 index dbc6444..0000000 --- a/gpstracker_small.png +++ /dev/null Binary files differ diff --git a/phoneClients/android/.gitignore b/phoneClients/android/.gitignore deleted file mode 100644 index d6bfc95..0000000 --- a/phoneClients/android/.gitignore +++ /dev/null @@ -1,4 +0,0 @@ -.gradle -/local.properties -/.idea/workspace.xml -.DS_Store diff --git a/phoneClients/android/.idea/.name b/phoneClients/android/.idea/.name deleted file mode 100644 index 37cdced..0000000 --- a/phoneClients/android/.idea/.name +++ /dev/null @@ -1 +0,0 @@ -GpsTracker \ No newline at end of file diff --git a/phoneClients/android/.idea/compiler.xml b/phoneClients/android/.idea/compiler.xml deleted file mode 100644 index 217af47..0000000 --- a/phoneClients/android/.idea/compiler.xml +++ /dev/null @@ -1,23 +0,0 @@ - - - - - - diff --git a/phoneClients/android/.idea/copyright/profiles_settings.xml b/phoneClients/android/.idea/copyright/profiles_settings.xml deleted file mode 100644 index 3572571..0000000 --- a/phoneClients/android/.idea/copyright/profiles_settings.xml +++ /dev/null @@ -1,5 +0,0 @@ - - - - - \ No newline at end of file diff --git a/phoneClients/android/.idea/encodings.xml b/phoneClients/android/.idea/encodings.xml deleted file mode 100644 index e206d70..0000000 --- a/phoneClients/android/.idea/encodings.xml +++ /dev/null @@ -1,5 +0,0 @@ - - - - - diff --git a/phoneClients/android/.idea/gradle.xml b/phoneClients/android/.idea/gradle.xml deleted file mode 100644 index aa006ab..0000000 --- a/phoneClients/android/.idea/gradle.xml +++ /dev/null @@ -1,12 +0,0 @@ - - - - - - - diff --git a/phoneClients/android/.idea/libraries/ComAndroidSupportAppcompatV71900_aar.xml b/phoneClients/android/.idea/libraries/ComAndroidSupportAppcompatV71900_aar.xml deleted file mode 100644 index 2a05343..0000000 --- a/phoneClients/android/.idea/libraries/ComAndroidSupportAppcompatV71900_aar.xml +++ /dev/null @@ -1,9 +0,0 @@ - - - - - - - - - \ No newline at end of file diff --git a/phoneClients/android/.idea/libraries/ComGoogleAndroidGmsPlayServices4030_aar.xml b/phoneClients/android/.idea/libraries/ComGoogleAndroidGmsPlayServices4030_aar.xml deleted file mode 100644 index 7c84dc8..0000000 --- a/phoneClients/android/.idea/libraries/ComGoogleAndroidGmsPlayServices4030_aar.xml +++ /dev/null @@ -1,9 +0,0 @@ - - - - - - - - - \ No newline at end of file diff --git a/phoneClients/android/.idea/libraries/android_async_http_1_4_4.xml b/phoneClients/android/.idea/libraries/android_async_http_1_4_4.xml deleted file mode 100644 index 57498e3..0000000 --- a/phoneClients/android/.idea/libraries/android_async_http_1_4_4.xml +++ /dev/null @@ -1,9 +0,0 @@ - - - - - - - - - \ No newline at end of file diff --git a/phoneClients/android/.idea/libraries/support_v4_19_0_0.xml b/phoneClients/android/.idea/libraries/support_v4_19_0_0.xml deleted file mode 100644 index 0279a24..0000000 --- a/phoneClients/android/.idea/libraries/support_v4_19_0_0.xml +++ /dev/null @@ -1,9 +0,0 @@ - - - - - - - - - \ No newline at end of file diff --git a/phoneClients/android/.idea/misc.xml b/phoneClients/android/.idea/misc.xml deleted file mode 100644 index b153e48..0000000 --- a/phoneClients/android/.idea/misc.xml +++ /dev/null @@ -1,10 +0,0 @@ - - - - - - - - - - diff --git a/phoneClients/android/.idea/modules.xml b/phoneClients/android/.idea/modules.xml deleted file mode 100644 index 0348e67..0000000 --- a/phoneClients/android/.idea/modules.xml +++ /dev/null @@ -1,11 +0,0 @@ - - - - - - - - - - - diff --git a/phoneClients/android/.idea/scopes/scope_settings.xml b/phoneClients/android/.idea/scopes/scope_settings.xml deleted file mode 100644 index 922003b..0000000 --- a/phoneClients/android/.idea/scopes/scope_settings.xml +++ /dev/null @@ -1,5 +0,0 @@ - - - - \ No newline at end of file diff --git a/phoneClients/android/.idea/vcs.xml b/phoneClients/android/.idea/vcs.xml deleted file mode 100644 index a5dd086..0000000 --- a/phoneClients/android/.idea/vcs.xml +++ /dev/null @@ -1,8 +0,0 @@ - - - - - - - - diff --git a/phoneClients/android/.idea/workspace.xml b/phoneClients/android/.idea/workspace.xml deleted file mode 100644 index 1721efe..0000000 --- a/phoneClients/android/.idea/workspace.xml +++ /dev/null @@ -1,1281 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - Nexus 4 - @android:style/Theme.Black - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Abstraction issues - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - localhost - 5050 - - - - - - - - - 1387345487865 - 1387345487865 - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Android - - - - - - - - - - - - - - - Android API 19 Platform - - - - - - - - GpsTracker - - - - - - - - android-async-http-1.4.4 - - - - - - - - - diff --git a/phoneClients/android/GpsTracker/.gitignore b/phoneClients/android/GpsTracker/.gitignore deleted file mode 100644 index 796b96d..0000000 --- a/phoneClients/android/GpsTracker/.gitignore +++ /dev/null @@ -1 +0,0 @@ -/build diff --git a/phoneClients/android/GpsTracker/GpsTracker.iml b/phoneClients/android/GpsTracker/GpsTracker.iml deleted file mode 100644 index 9281d30..0000000 --- a/phoneClients/android/GpsTracker/GpsTracker.iml +++ /dev/null @@ -1,79 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/phoneClients/android/GpsTracker/build.gradle b/phoneClients/android/GpsTracker/build.gradle deleted file mode 100644 index 06a694c..0000000 --- a/phoneClients/android/GpsTracker/build.gradle +++ /dev/null @@ -1,35 +0,0 @@ -buildscript { - repositories { - mavenCentral() - } - dependencies { - classpath 'com.android.tools.build:gradle:0.7.+' - } -} -apply plugin: 'android' - -repositories { - mavenCentral() -} - -dependencies { - // check here and change the version (1.4.4) below if necessary. http://loopj.com/android-async-http/ - compile group: 'com.loopj.android', name: 'android-async-http', version: '1.4.4' -} - -android { - compileSdkVersion 19 - buildToolsVersion '19.0.0' - - defaultConfig { - minSdkVersion 10 - targetSdkVersion 19 - } -} - -dependencies { - compile 'com.android.support:appcompat-v7:+' - // check here and change the version (4.0.30) below if necessary. http://developer.android.com/google/play-services/setup.html - compile 'com.google.android.gms:play-services:4.0.30' -} - diff --git a/phoneClients/android/GpsTracker/src/main/AndroidManifest.xml b/phoneClients/android/GpsTracker/src/main/AndroidManifest.xml deleted file mode 100644 index f75ccf1..0000000 --- a/phoneClients/android/GpsTracker/src/main/AndroidManifest.xml +++ /dev/null @@ -1,35 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - diff --git a/phoneClients/android/GpsTracker/src/main/ic_launcher-web.png b/phoneClients/android/GpsTracker/src/main/ic_launcher-web.png deleted file mode 100644 index 5c63bc5..0000000 --- a/phoneClients/android/GpsTracker/src/main/ic_launcher-web.png +++ /dev/null Binary files differ diff --git a/phoneClients/android/GpsTracker/src/main/java/com/websmithing/gpstracker/GpsTrackerActivity.java b/phoneClients/android/GpsTracker/src/main/java/com/websmithing/gpstracker/GpsTrackerActivity.java deleted file mode 100644 index 37a68dc..0000000 --- a/phoneClients/android/GpsTracker/src/main/java/com/websmithing/gpstracker/GpsTrackerActivity.java +++ /dev/null @@ -1,264 +0,0 @@ -package com.websmithing.gpstracker; - -import android.location.Location; -import android.os.Bundle; -import android.support.v4.app.Fragment; -import android.support.v7.app.ActionBarActivity; -import android.util.Log; -import android.view.LayoutInflater; -import android.view.Menu; -import android.view.MenuItem; -import android.view.View; -import android.view.ViewGroup; -import android.widget.Button; -import android.widget.TextView; - -import com.google.android.gms.common.ConnectionResult; -import com.google.android.gms.common.GooglePlayServicesClient; -import com.google.android.gms.common.GooglePlayServicesUtil; -import com.google.android.gms.location.LocationClient; -import com.google.android.gms.location.LocationListener; -import com.google.android.gms.location.LocationRequest; -import com.loopj.android.http.AsyncHttpResponseHandler; -import com.loopj.android.http.RequestParams; - -import java.io.UnsupportedEncodingException; -import java.net.URLEncoder; -import java.text.DateFormat; -import java.text.SimpleDateFormat; -import java.util.Date; -import java.util.TimeZone; -import java.util.UUID; - -public class GpsTrackerActivity extends ActionBarActivity implements LocationListener, GooglePlayServicesClient.ConnectionCallbacks, - GooglePlayServicesClient.OnConnectionFailedListener { - - private static final String TAG = "GpsTrackerActivity"; - private static TextView longitudeTextView; - private static TextView latitudeTextView; - private static TextView accuracyTextView; - private static TextView providerTextView; - private static TextView timeStampTextView; - - private LocationRequest locationRequest; - private LocationClient locationClient; - private Location previousLocation; - private float totalDistanceInMeters = 0.0f; - private boolean firstTimeGettingPosition = true; - private String sessionID; - - @Override - protected void onCreate(Bundle savedInstanceState) { - super.onCreate(savedInstanceState); - setContentView(R.layout.activity_gpstracker); - - if (savedInstanceState == null) { - getSupportFragmentManager().beginTransaction() - .add(R.id.container, new PlaceholderFragment()) - .commit(); - } - - int response = GooglePlayServicesUtil.isGooglePlayServicesAvailable(this); - if(response == ConnectionResult.SUCCESS){ - locationClient = new LocationClient(this,this,this); - locationClient.connect(); - } - else{ - Log.e(TAG, "google play service error: " + response); - } - } - - // called when startTrackingButton is tapped - public void startTracking(View v) { - ((Button) v).setText("stop tracking"); - - sessionID = UUID.randomUUID().toString(); - totalDistanceInMeters = 0.0f; - - locationRequest = LocationRequest.create(); - locationRequest.setInterval(60 * 1000); - locationRequest.setFastestInterval(60 * 1000); // the fastest rate in milliseconds at which your app can handle location updates - locationRequest.setPriority(LocationRequest.PRIORITY_BALANCED_POWER_ACCURACY); - locationClient.requestLocationUpdates(locationRequest, this); - - //oneTimeLocationUpdate(); - } - - protected void changeInterval(int intervalInMinutes) { - locationRequest.setInterval(intervalInMinutes * 1000); - locationRequest.setFastestInterval(intervalInMinutes * 1000); - } - - protected void oneTimeLocationUpdate() { - Log.e(TAG, "oneTimeLocationUpdate"); - - if (locationClient != null && locationClient.isConnected()) { - Location location = locationClient.getLastLocation(); - displayLocationData(location); - } - } - - @Override - public void onLocationChanged(Location location) { - if (location != null) { - displayLocationData(location); - sendLocationDataToWebsite(location); - } - } - - protected void sendLocationDataToWebsite(Location location) { - // formatted for mysql datetime format - DateFormat dateFormat = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); - dateFormat.setTimeZone(TimeZone.getDefault()); - Date date = new Date(location.getTime()); - - if (firstTimeGettingPosition) { - firstTimeGettingPosition = false; - } else { - float distance = location.distanceTo(previousLocation); - totalDistanceInMeters += distance; - } - - previousLocation = location; - - RequestParams requestParams = new RequestParams(); - requestParams.put("latitude", Double.toString(location.getLatitude())); - requestParams.put("longitude", Double.toString(location.getLongitude())); - requestParams.put("speed", Double.toString(location.getSpeed())); // in miles per hour - - try { - requestParams.put("date", URLEncoder.encode(dateFormat.format(date), "UTF-8")); - } catch (UnsupportedEncodingException e) {} - - requestParams.put("locationmethod", location.getProvider()); - - if ( totalDistanceInMeters > 0) { - requestParams.put("distance", totalDistanceInMeters / 1609); // in miles - } else { - requestParams.put("distance", 0); // in miles - } - - requestParams.put("phonenumber", "androidUser"); - requestParams.put("sessionid", sessionID); // uuid - requestParams.put("accuracy", Float.toString(location.getAccuracy())); // in meters - requestParams.put("extrainfo", Double.toString(location.getAltitude())); - requestParams.put("eventtype", "android"); - requestParams.put("direction", Float.toString(location.getBearing())); - - MyHttpClient.post(null, requestParams, new AsyncHttpResponseHandler() { - @Override - public void onSuccess(int statusCode, org.apache.http.Header[] headers, byte[] responseBody) { - try { - String response = new String(responseBody, "UTF-8"); - Log.e(TAG, "onSuccess statusCode: " + statusCode + " responseBody: " + response); - } catch (UnsupportedEncodingException e) {} - } - @Override - public void onFailure(int statusCode, org.apache.http.Header[] headers, byte[] errorResponse, Throwable e) { - Log.e(TAG, "onFailure statusCode: " + statusCode + " errorResponse: " + errorResponse); - } - }); - } - - protected void displayLocationData(Location location) { - DateFormat dateFormat = new SimpleDateFormat("hh:mm:ss"); - dateFormat.setTimeZone(TimeZone.getDefault()); - Date date = new Date(location.getTime()); - - longitudeTextView.setText("longitude: " + location.getLongitude()); - latitudeTextView.setText("latitude: " + location.getLatitude()); - accuracyTextView.setText("accuracy: " + location.getAccuracy()); - providerTextView.setText("provider: " + location.getProvider()); - timeStampTextView.setText("timeStamp: " + dateFormat.format(date)); - - Log.e(TAG, dateFormat.format(date) + " accuracy: " + location.getAccuracy()); - } - - public void stopTracking(View v) { - Log.e(TAG, "stopTracking"); - ((Button) v).setText("start tracking"); - } - - @Override - protected void onStart() { - Log.e(TAG, "onStart"); - super.onStart(); - // Connect the client. - //mLocationClient.connect(); - } - - @Override - protected void onStop() { - Log.e(TAG, "onStop"); - - if (locationClient != null && locationClient.isConnected()) { - locationClient.removeLocationUpdates(this); - locationClient.disconnect(); - } - - super.onStop(); - } - - /** - * Called by Location Services when the request to connect the - * client finishes successfully. At this point, you can - * request the current location or start periodic updates - */ - @Override - public void onConnected(Bundle bundle) { - Log.e(TAG, "onConnected"); - - } - - /** - * Called by Location Services if the connection to the - * location client drops because of an error. - */ - @Override - public void onDisconnected() { - Log.e(TAG, "onDisconnected"); - - } - - @Override - public void onConnectionFailed(ConnectionResult connectionResult) { - Log.e(TAG, "onConnectionFailed"); - - } - - @Override - public boolean onCreateOptionsMenu(Menu menu) { - getMenuInflater().inflate(R.menu.gps_tracker, menu); - return true; - } - - @Override - public boolean onOptionsItemSelected(MenuItem item) { - // Handle action bar item clicks here. The action bar will - // automatically handle clicks on the Home/Up button, so long - // as you specify a parent activity in AndroidManifest.xml. - switch (item.getItemId()) { - case R.id.action_settings: - return true; - } - return super.onOptionsItemSelected(item); - } - - public static class PlaceholderFragment extends Fragment { - - public PlaceholderFragment() { - } - - @Override - public View onCreateView(LayoutInflater inflater, ViewGroup container, - Bundle savedInstanceState) { - View rootView = inflater.inflate(R.layout.fragment_gpstracker, container, false); - longitudeTextView = (TextView)rootView.findViewById(R.id.longitudeTextView); - latitudeTextView = (TextView)rootView.findViewById(R.id.latitudeTextView); - accuracyTextView = (TextView)rootView.findViewById(R.id.accuracyTextView); - providerTextView = (TextView)rootView.findViewById(R.id.providerTextView); - timeStampTextView = (TextView)rootView.findViewById(R.id.timeStampTextView); - return rootView; - } - } -} diff --git a/phoneClients/android/GpsTracker/src/main/java/com/websmithing/gpstracker/MyHttpClient.java b/phoneClients/android/GpsTracker/src/main/java/com/websmithing/gpstracker/MyHttpClient.java deleted file mode 100644 index c58cb87..0000000 --- a/phoneClients/android/GpsTracker/src/main/java/com/websmithing/gpstracker/MyHttpClient.java +++ /dev/null @@ -1,18 +0,0 @@ -package com.websmithing.gpstracker; - -import com.loopj.android.http.AsyncHttpClient; -import com.loopj.android.http.AsyncHttpResponseHandler; -import com.loopj.android.http.RequestParams; - -public class MyHttpClient { - - // use the websmithing defaultUploadWebsite for testing, change the *phoneNumber* form variable to something you - // know and then check your location with your browser here: http://www.websmithing.com/gpstracker/displaymap.php - - private static final String defaultUploadWebsite = "http://www.websmithing.com/gpstracker/updatelocation.php"; - private static AsyncHttpClient client = new AsyncHttpClient(); - - public static void post(String url, RequestParams requestParams, AsyncHttpResponseHandler responseHandler) { - client.post(defaultUploadWebsite, requestParams, responseHandler); - } -} diff --git a/phoneClients/android/GpsTracker/src/main/res/drawable-hdpi/ic_launcher.png b/phoneClients/android/GpsTracker/src/main/res/drawable-hdpi/ic_launcher.png deleted file mode 100644 index 55621cc..0000000 --- a/phoneClients/android/GpsTracker/src/main/res/drawable-hdpi/ic_launcher.png +++ /dev/null Binary files differ diff --git a/phoneClients/android/GpsTracker/src/main/res/drawable-mdpi/ic_launcher.png b/phoneClients/android/GpsTracker/src/main/res/drawable-mdpi/ic_launcher.png deleted file mode 100644 index 11ec206..0000000 --- a/phoneClients/android/GpsTracker/src/main/res/drawable-mdpi/ic_launcher.png +++ /dev/null Binary files differ diff --git a/phoneClients/android/GpsTracker/src/main/res/drawable-xhdpi/ic_launcher.png b/phoneClients/android/GpsTracker/src/main/res/drawable-xhdpi/ic_launcher.png deleted file mode 100644 index 7c02b78..0000000 --- a/phoneClients/android/GpsTracker/src/main/res/drawable-xhdpi/ic_launcher.png +++ /dev/null Binary files differ diff --git a/phoneClients/android/GpsTracker/src/main/res/drawable-xxhdpi/ic_launcher.png b/phoneClients/android/GpsTracker/src/main/res/drawable-xxhdpi/ic_launcher.png deleted file mode 100644 index 915d914..0000000 --- a/phoneClients/android/GpsTracker/src/main/res/drawable-xxhdpi/ic_launcher.png +++ /dev/null Binary files differ diff --git a/phoneClients/android/GpsTracker/src/main/res/layout/activity_gpstracker.xml b/phoneClients/android/GpsTracker/src/main/res/layout/activity_gpstracker.xml deleted file mode 100644 index 33784e1..0000000 --- a/phoneClients/android/GpsTracker/src/main/res/layout/activity_gpstracker.xml +++ /dev/null @@ -1,7 +0,0 @@ - diff --git a/phoneClients/android/GpsTracker/src/main/res/layout/fragment_gpstracker.xml b/phoneClients/android/GpsTracker/src/main/res/layout/fragment_gpstracker.xml deleted file mode 100644 index b8cd5d7..0000000 --- a/phoneClients/android/GpsTracker/src/main/res/layout/fragment_gpstracker.xml +++ /dev/null @@ -1,64 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/phoneClients/ios/GpsTracker/GpsTracker-Info.plist b/phoneClients/ios/GpsTracker/GpsTracker-Info.plist deleted file mode 100644 index 076b570..0000000 --- a/phoneClients/ios/GpsTracker/GpsTracker-Info.plist +++ /dev/null @@ -1,42 +0,0 @@ - - - - - CFBundleDevelopmentRegion - en - CFBundleDisplayName - ${PRODUCT_NAME} - CFBundleExecutable - ${EXECUTABLE_NAME} - CFBundleIdentifier - com.websmithing.${PRODUCT_NAME:rfc1034identifier} - CFBundleInfoDictionaryVersion - 6.0 - CFBundleName - ${PRODUCT_NAME} - CFBundlePackageType - APPL - CFBundleShortVersionString - 3.0.0 - CFBundleSignature - ???? - CFBundleVersion - 1 - LSRequiresIPhoneOS - - UIBackgroundModes - - location - - UIMainStoryboardFile - Main - UIRequiredDeviceCapabilities - - armv7 - - UISupportedInterfaceOrientations - - UIInterfaceOrientationPortrait - - - diff --git a/phoneClients/ios/GpsTracker/GpsTracker-Prefix.pch b/phoneClients/ios/GpsTracker/GpsTracker-Prefix.pch deleted file mode 100644 index 82a2bb4..0000000 --- a/phoneClients/ios/GpsTracker/GpsTracker-Prefix.pch +++ /dev/null @@ -1,16 +0,0 @@ -// -// Prefix header -// -// The contents of this file are implicitly included at the beginning of every source file. -// - -#import - -#ifndef __IPHONE_5_0 -#warning "This project uses features only available in iOS SDK 5.0 and later." -#endif - -#ifdef __OBJC__ - #import - #import -#endif diff --git a/phoneClients/ios/GpsTracker/Images.xcassets/AppIcon.appiconset/Contents.json b/phoneClients/ios/GpsTracker/Images.xcassets/AppIcon.appiconset/Contents.json deleted file mode 100644 index a396706..0000000 --- a/phoneClients/ios/GpsTracker/Images.xcassets/AppIcon.appiconset/Contents.json +++ /dev/null @@ -1,23 +0,0 @@ -{ - "images" : [ - { - "idiom" : "iphone", - "size" : "29x29", - "scale" : "2x" - }, - { - "idiom" : "iphone", - "size" : "40x40", - "scale" : "2x" - }, - { - "idiom" : "iphone", - "size" : "60x60", - "scale" : "2x" - } - ], - "info" : { - "version" : 1, - "author" : "xcode" - } -} \ No newline at end of file diff --git a/phoneClients/ios/GpsTracker/Images.xcassets/LaunchImage.launchimage/Contents.json b/phoneClients/ios/GpsTracker/Images.xcassets/LaunchImage.launchimage/Contents.json deleted file mode 100644 index c79ebd3..0000000 --- a/phoneClients/ios/GpsTracker/Images.xcassets/LaunchImage.launchimage/Contents.json +++ /dev/null @@ -1,23 +0,0 @@ -{ - "images" : [ - { - "orientation" : "portrait", - "idiom" : "iphone", - "extent" : "full-screen", - "minimum-system-version" : "7.0", - "scale" : "2x" - }, - { - "orientation" : "portrait", - "idiom" : "iphone", - "subtype" : "retina4", - "extent" : "full-screen", - "minimum-system-version" : "7.0", - "scale" : "2x" - } - ], - "info" : { - "version" : 1, - "author" : "xcode" - } -} \ No newline at end of file diff --git a/phoneClients/ios/GpsTracker/WSAppDelegate.h b/phoneClients/ios/GpsTracker/WSAppDelegate.h deleted file mode 100644 index c8af465..0000000 --- a/phoneClients/ios/GpsTracker/WSAppDelegate.h +++ /dev/null @@ -1,15 +0,0 @@ -// -// WSAppDelegate.h -// GpsTracker -// -// Created by Nick Fox on 1/1/14. -// Copyright (c) 2014 Nick Fox. All rights reserved. -// - -#import - -@interface WSAppDelegate : UIResponder - -@property (strong, nonatomic) UIWindow *window; - -@end diff --git a/phoneClients/ios/GpsTracker/WSAppDelegate.m b/phoneClients/ios/GpsTracker/WSAppDelegate.m deleted file mode 100644 index 8971275..0000000 --- a/phoneClients/ios/GpsTracker/WSAppDelegate.m +++ /dev/null @@ -1,46 +0,0 @@ -// -// WSAppDelegate.m -// GpsTracker -// -// Created by Nick Fox on 1/1/14. -// Copyright (c) 2014 Nick Fox. All rights reserved. -// - -#import "WSAppDelegate.h" - -@implementation WSAppDelegate - -- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions -{ - // Override point for customization after application launch. - return YES; -} - -- (void)applicationWillResignActive:(UIApplication *)application -{ - // Sent when the application is about to move from active to inactive state. This can occur for certain types of temporary interruptions (such as an incoming phone call or SMS message) or when the user quits the application and it begins the transition to the background state. - // Use this method to pause ongoing tasks, disable timers, and throttle down OpenGL ES frame rates. Games should use this method to pause the game. -} - -- (void)applicationDidEnterBackground:(UIApplication *)application -{ - // Use this method to release shared resources, save user data, invalidate timers, and store enough application state information to restore your application to its current state in case it is terminated later. - // If your application supports background execution, this method is called instead of applicationWillTerminate: when the user quits. -} - -- (void)applicationWillEnterForeground:(UIApplication *)application -{ - // Called as part of the transition from the background to the inactive state; here you can undo many of the changes made on entering the background. -} - -- (void)applicationDidBecomeActive:(UIApplication *)application -{ - // Restart any tasks that were paused (or not yet started) while the application was inactive. If the application was previously in the background, optionally refresh the user interface. -} - -- (void)applicationWillTerminate:(UIApplication *)application -{ - // Called when the application is about to terminate. Save data if appropriate. See also applicationDidEnterBackground:. -} - -@end diff --git a/phoneClients/ios/GpsTracker/WSViewController.h b/phoneClients/ios/GpsTracker/WSViewController.h deleted file mode 100644 index 293ff05..0000000 --- a/phoneClients/ios/GpsTracker/WSViewController.h +++ /dev/null @@ -1,13 +0,0 @@ -// -// WSViewController.h -// GpsTracker -// -// Created by Nick Fox on 1/1/14. -// Copyright (c) 2014 Nick Fox. All rights reserved. -// - -#import - -@interface WSViewController : UIViewController - -@end diff --git a/phoneClients/ios/GpsTracker/WSViewController.m b/phoneClients/ios/GpsTracker/WSViewController.m deleted file mode 100644 index 7f6c0c1..0000000 --- a/phoneClients/ios/GpsTracker/WSViewController.m +++ /dev/null @@ -1,211 +0,0 @@ -// -// WSViewController.m -// GpsTracker -// -// Created by Nick Fox on 1/1/14. -// Copyright (c) 2014 Nick Fox. All rights reserved. -// - -#import "WSViewController.h" -#import -#import "AFHTTPRequestOperationManager.h" - -@interface WSViewController () -@property (weak, nonatomic) IBOutlet UILabel *latitudeLabel; -@property (weak, nonatomic) IBOutlet UILabel *longitudeLabel; -@property (weak, nonatomic) IBOutlet UILabel *accuracyLabel; -@property (weak, nonatomic) IBOutlet UILabel *timestampLabel; -@property (weak, nonatomic) IBOutlet UIButton *trackingButton; -@property (weak, nonatomic) IBOutlet UILabel *accuracyLevelLabel; -@property (weak, nonatomic) IBOutlet UILabel *sessionIDLabel; -@end - -@implementation WSViewController -{ - CLLocationManager *locationManager; - CLLocation *previousLocation; - double totalDistanceInMeters; - bool currentlyTracking; - bool firstTimeGettingPosition; - NSUUID *guid; - NSDate *lastWebsiteUpdateTime; - int timeIntervalInSeconds; - bool increasedAccuracy; -} - -- (void)viewDidLoad -{ - [super viewDidLoad]; - currentlyTracking = NO; - - timeIntervalInSeconds = 60; // change this to the time interval you want -} - -- (void)startTracking -{ - NSLog(@"start tracking"); - - locationManager = [[CLLocationManager alloc] init]; - locationManager.desiredAccuracy = kCLLocationAccuracyNearestTenMeters; - locationManager.distanceFilter = 0; // meters - //locationManager.pausesLocationUpdatesAutomatically = NO; // YES is default - locationManager.activityType = CLActivityTypeAutomotiveNavigation; - locationManager.delegate = self; - - guid = [NSUUID UUID]; - totalDistanceInMeters = 0; - increasedAccuracy = YES; - firstTimeGettingPosition = YES; - lastWebsiteUpdateTime = [NSDate date]; // new timestamp - [self updateAccuracyLevel:@"high"]; - - [self sessionIDLabel].text = [guid UUIDString]; - - [locationManager startUpdatingLocation]; -} - -- (void)stopTracking -{ - NSLog(@"stop tracking"); - - [self sessionIDLabel].text = @""; - [locationManager stopUpdatingLocation]; - locationManager = nil; -} -- (IBAction)handleTrackingButton:(id)sender { - if (currentlyTracking) { - [self stopTracking]; - currentlyTracking = NO; - [self.trackingButton setTitle:@"start tracking" forState:UIControlStateNormal]; - } else { - [self startTracking]; - currentlyTracking = YES; - [self.trackingButton setTitle:@"stop tracking" forState:UIControlStateNormal]; - } -} - -- (void)reduceTrackingAccuracy -{ - locationManager.desiredAccuracy = kCLLocationAccuracyThreeKilometers; - locationManager.distanceFilter = 5; - increasedAccuracy = NO; - [self updateAccuracyLevel:@"low"]; -} - -- (void)increaseTrackingAccuracy -{ - locationManager.desiredAccuracy = kCLLocationAccuracyNearestTenMeters; - locationManager.distanceFilter = 0; - increasedAccuracy = YES; - [self updateAccuracyLevel:@"high"]; -} - -- (void)locationManager:(CLLocationManager *)manager didUpdateLocations:(NSArray *)locations -{ - CLLocation *location = [locations lastObject]; - - NSTimeInterval secondsSinceLastWebsiteUpdate = fabs([lastWebsiteUpdateTime timeIntervalSinceNow]); - if (firstTimeGettingPosition || (secondsSinceLastWebsiteUpdate > timeIntervalInSeconds)) // currently one minute - { - if (location.horizontalAccuracy < 100.0 && location.coordinate.latitude != 0 && location.coordinate.longitude != 0) { - - if (increasedAccuracy) { - [self reduceTrackingAccuracy]; - } - - if (firstTimeGettingPosition) { - firstTimeGettingPosition = NO; - } else { - CLLocationDistance distance = [location distanceFromLocation:previousLocation]; - totalDistanceInMeters += distance; - - - } - - previousLocation = location; - - NSDateFormatter *dateFormatter = [[NSDateFormatter alloc] init]; - [dateFormatter setDateFormat:@"yyyy-MM-dd%20HH:mm:ss"]; // mysql format - NSString *timeStamp = [dateFormatter stringFromDate:location.timestamp]; - NSString *latitude = [NSString stringWithFormat:@"%f", location.coordinate.latitude]; - NSString *longitude = [NSString stringWithFormat:@"%f", location.coordinate.longitude]; - NSString *speed = [NSString stringWithFormat:@"%d", (int)location.speed]; - NSString *accuracy = [NSString stringWithFormat:@"%d", (int)location.horizontalAccuracy]; - NSString *direction = [NSString stringWithFormat:@"%d", (int)location.course]; - NSString *altitude = [NSString stringWithFormat:@"altitude: %dm", (int)location.altitude]; - NSString *totalDistanceString = [NSString stringWithFormat:@"%d", (int)totalDistanceInMeters]; - - // note that the guid is created in startTracking method above - [self updateWebsiteWithLatitde:latitude longitude:longitude speed:speed date:timeStamp distance:totalDistanceString sessionID:[guid UUIDString] accuracy:accuracy extraInfo:altitude direction:direction]; - - lastWebsiteUpdateTime = [NSDate date]; // new timestamp - - } else if (!increasedAccuracy) { - [self increaseTrackingAccuracy]; - } - } - - NSString *trackingAccuracy = (increasedAccuracy) ? @"high" : @"low"; - NSLog(@"tracking accuracy: %@ lat/lng: %f/%f accuracy: %dm", trackingAccuracy, location.coordinate.latitude, location.coordinate.longitude, (int)location.horizontalAccuracy); - - if ([[UIApplication sharedApplication] applicationState] == UIApplicationStateActive) { - [self updateUIWithLocationData:location]; - } -} - -- (void)updateAccuracyLevel:(NSString *)accuracyLevel -{ - [self accuracyLevelLabel].text= [NSString stringWithFormat:@"accuracy level: %@", accuracyLevel]; -} - -- (void)updateUIWithLocationData:(CLLocation *)location -{ - NSDateFormatter *dateFormatter = [[NSDateFormatter alloc] init]; - [dateFormatter setDateFormat:@"dd/MM/yyyy HH:mm"]; - [self timestampLabel].text = [NSString stringWithFormat:@"timestamp: %@",[dateFormatter stringFromDate:location.timestamp]]; - [self latitudeLabel].text = [NSString stringWithFormat:@"latitude: %f", location.coordinate.latitude]; - [self longitudeLabel].text = [NSString stringWithFormat:@"longitude: %f", location.coordinate.longitude]; - [self accuracyLabel].text= [NSString stringWithFormat:@"accuracy: %dm", (int)location.horizontalAccuracy]; -} - -- (void)locationManager:(CLLocationManager *)manager didFailWithError:(NSError *)error -{ - NSLog(@"locationManager error: %@", [error description]); -} - -- (void)updateWebsiteWithLatitde:(NSString *)latitude longitude:(NSString *)longitude speed:(NSString *)speed date:(NSString *)date distance:(NSString *)distance sessionID:(NSString *)sessionID accuracy:(NSString *)accuracy extraInfo:(NSString *)extraInfo direction:(NSString *)direction -{ - // use the websmithing defaultUploadWebsite for testing, change the *phoneNumber* form variable to something you - // know and then check your location with your browser here: http://www.websmithing.com/gpstracker/displaymap.php - - NSString *defaultUploadWebsite = @"http://www.websmithing.com/gpstracker/updatelocation.php"; - - AFHTTPRequestOperationManager *manager = [AFHTTPRequestOperationManager manager]; - manager.responseSerializer = [AFHTTPResponseSerializer serializer]; - - NSDictionary *parameters = @{@"latitude": latitude, - @"longitude": longitude, - @"speed": speed, - @"date": date, - @"locationmethod": @"n/a", - @"distance": distance, - @"phonenumber": @"iosUser", - @"sessionid": sessionID, - @"extrainfo": extraInfo, - @"accuracy": accuracy, - @"eventtype": @"ios", - @"direction": direction}; - - [manager POST:defaultUploadWebsite parameters:parameters success:^(AFHTTPRequestOperation *operation, id responseObject) { - NSLog(@"location sent to website."); - } failure:^(AFHTTPRequestOperation *operation, NSError *error) { - NSLog(@"AFHTTPRequestOperation Error: %@", [error description]); - }]; -} - -- (void)didReceiveMemoryWarning -{ - [super didReceiveMemoryWarning]; -} - -@end diff --git a/phoneClients/ios/GpsTracker/en.lproj/InfoPlist.strings b/phoneClients/ios/GpsTracker/en.lproj/InfoPlist.strings deleted file mode 100644 index 477b28f..0000000 --- a/phoneClients/ios/GpsTracker/en.lproj/InfoPlist.strings +++ /dev/null @@ -1,2 +0,0 @@ -/* Localized versions of Info.plist keys */ - diff --git a/phoneClients/ios/GpsTracker/main.m b/phoneClients/ios/GpsTracker/main.m deleted file mode 100644 index 0a1517b..0000000 --- a/phoneClients/ios/GpsTracker/main.m +++ /dev/null @@ -1,18 +0,0 @@ -// -// main.m -// GpsTracker -// -// Created by Nick Fox on 1/1/14. -// Copyright (c) 2014 Nick Fox. All rights reserved. -// - -#import - -#import "WSAppDelegate.h" - -int main(int argc, char * argv[]) -{ - @autoreleasepool { - return UIApplicationMain(argc, argv, nil, NSStringFromClass([WSAppDelegate class])); - } -} diff --git a/phoneClients/ios/Podfile b/phoneClients/ios/Podfile deleted file mode 100644 index 6d5aa37..0000000 --- a/phoneClients/ios/Podfile +++ /dev/null @@ -1,2 +0,0 @@ -platform :ios, '6.0' -pod "AFNetworking/NSURLConnection", "~> 2.0" diff --git a/phoneClients/ios/Podfile.lock b/phoneClients/ios/Podfile.lock deleted file mode 100644 index d0f7cf7..0000000 --- a/phoneClients/ios/Podfile.lock +++ /dev/null @@ -1,16 +0,0 @@ -PODS: - - AFNetworking/NSURLConnection (2.0.3): - - AFNetworking/Reachability - - AFNetworking/Security - - AFNetworking/Serialization - - AFNetworking/Reachability (2.0.3) - - AFNetworking/Security (2.0.3) - - AFNetworking/Serialization (2.0.3) - -DEPENDENCIES: - - AFNetworking/NSURLConnection (~> 2.0) - -SPEC CHECKSUMS: - AFNetworking: e499052cbf3d743e9bb727bb37adb9dc2547ba15 - -COCOAPODS: 0.29.0 diff --git a/phoneClients/ios/README.md b/phoneClients/ios/README.md deleted file mode 100644 index c5b981f..0000000 --- a/phoneClients/ios/README.md +++ /dev/null @@ -1,11 +0,0 @@ -this is the ios client for gpstracker. Remember that you need to open this project with GpsTracker.xcworkspace since you are using AFNetworking cocoapods. - -use the websmithing defaultUploadWebsite: - -http://www.websmithing.com/gpstracker/updatelocation.php - -for testing - -change the *phoneNumber* form variable to something you know and then check your location with your browser here: - -http://www.websmithing.com/gpstracker/displaymap.php diff --git a/phoneClients/javaMe/.gitignore b/phoneClients/javaMe/.gitignore deleted file mode 100644 index 27beeaa..0000000 --- a/phoneClients/javaMe/.gitignore +++ /dev/null @@ -1,11 +0,0 @@ -*.class - -# Mobile Tools for Java (J2ME) -.mtj.tmp/ - -# Package Files # -*.jar -*.war -*.ear -*.jad - diff --git a/phoneClients/javaMe/README.md b/phoneClients/javaMe/README.md deleted file mode 100644 index 3330ab3..0000000 --- a/phoneClients/javaMe/README.md +++ /dev/null @@ -1,11 +0,0 @@ -this is the javaMe / j2me client for gpstracker. This project was built with NetBeans 7.4 and java ME sdk 3.4. - -use the websmithing defaultUploadWebsite: - -http://www.websmithing.com/gpstracker/updatelocation.php - -for testing - -change the *phoneNumber* form variable to something you know and then check your location with your browser here: - -http://www.websmithing.com/gpstracker/displaymap.php diff --git a/phoneClients/javaMe/build.xml b/phoneClients/javaMe/build.xml deleted file mode 100644 index 46a50e0..0000000 --- a/phoneClients/javaMe/build.xml +++ /dev/null @@ -1,83 +0,0 @@ - - - - - - Builds, tests, and runs the project . - - - diff --git a/phoneClients/javaMe/build/.timestamp b/phoneClients/javaMe/build/.timestamp deleted file mode 100644 index 999b584..0000000 --- a/phoneClients/javaMe/build/.timestamp +++ /dev/null @@ -1 +0,0 @@ -ignore me \ No newline at end of file diff --git a/phoneClients/javaMe/build/JavaMEPhone1/.timestamp b/phoneClients/javaMe/build/JavaMEPhone1/.timestamp deleted file mode 100644 index 999b584..0000000 --- a/phoneClients/javaMe/build/JavaMEPhone1/.timestamp +++ /dev/null @@ -1 +0,0 @@ -ignore me \ No newline at end of file diff --git a/phoneClients/javaMe/build/JavaMEPhone1/manifest.mf b/phoneClients/javaMe/build/JavaMEPhone1/manifest.mf deleted file mode 100644 index bd06b7b..0000000 --- a/phoneClients/javaMe/build/JavaMEPhone1/manifest.mf +++ /dev/null @@ -1,6 +0,0 @@ -MIDlet-1: GpsTracker, , com.websmithing.gpstracker.GpsTracker -MIDlet-Vendor: Vendor -MIDlet-Name: GpsTracker -MIDlet-Version: 1.0 -MicroEdition-Configuration: CLDC-1.1 -MicroEdition-Profile: MIDP-2.1 diff --git a/phoneClients/javaMe/build/JavaMEPhone1/preprocessed/com/websmithing/gpstracker/GpsHelper.java b/phoneClients/javaMe/build/JavaMEPhone1/preprocessed/com/websmithing/gpstracker/GpsHelper.java deleted file mode 100644 index e10bd3a..0000000 --- a/phoneClients/javaMe/build/JavaMEPhone1/preprocessed/com/websmithing/gpstracker/GpsHelper.java +++ /dev/null @@ -1,171 +0,0 @@ -// -// GpsHelper.java -// GpsTracker -// -// Created by Nick Fox on 11/7/13. -// Copyright (c) 2013 Nick Fox. All rights reserved. -// - -package com.websmithing.gpstracker; - -import javax.microedition.location.*; -import java.util.Calendar; -import java.util.Date; - -public class GpsHelper implements LocationListener { - - private LocationProvider locationProvider = null; - private Coordinates oldCoordinates = null, currentCoordinates = null; - private float distance = 0; - private int azimuth = 0; - private String uploadWebsite; - private GpsTracker midlet; - private int interval; - protected long sessionID; - - public GpsHelper(GpsTracker Midlet, int Interval, String UploadWebsite){ - sessionID = System.currentTimeMillis(); - this.midlet = Midlet; - this.interval = Interval; - this.uploadWebsite = UploadWebsite; - } - - // getting the gps location is based on an interval in seconds. for instance, - // the location is gotten once a minute, sent to the website to be stored in - // the DB (and then viewed on Google map) and used to retrieve a map tile (image) - // to be diplayed on the phone - - public void startGPS() { - if (locationProvider == null) { - createLocationProvider(); - - Thread locationThread = new Thread() { - public void run(){ - createLocationListener(); - } - }; - locationThread.start(); - } - } - - // this allows us to change how often the gps location is gotten - public void changeInterval(int Interval) { - if (locationProvider != null) { - locationProvider.setLocationListener(this, Interval, -1, -1); - } - } - - private void createLocationProvider() { - Criteria cr = new Criteria(); - - try { - locationProvider = LocationProvider.getInstance(cr); - } catch (Exception e) { - midlet.log("GPS.createLocationProvider: " + e); - } - } - - private void createLocationListener(){ - // 2cd value is interval in seconds - try { - locationProvider.setLocationListener(this, interval, -1, -1); - } catch (Exception e) { - midlet.log("GPS.createLocationListener: " + e); - } - } - - public void locationUpdated(LocationProvider provider, final Location location) { - // get new location from locationProvider - - try { - Thread getLocationThread = new Thread(){ - public void run(){ - sendLocationToWebsite(location); - } - }; - - getLocationThread.start(); - } catch (Exception e) { - midlet.log("GPS.locationUpdated: " + e); - } - } - - public void providerStateChanged(LocationProvider provider, int newState) {} - - private void sendLocationToWebsite(Location location){ - float speed = 0; - - try { - QualifiedCoordinates qualifiedCoordinates = location.getQualifiedCoordinates(); - - qualifiedCoordinates.getLatitude(); - - if (oldCoordinates == null){ - oldCoordinates = new Coordinates(qualifiedCoordinates.getLatitude(), - qualifiedCoordinates.getLongitude(), - qualifiedCoordinates.getAltitude()); - } else { - if (!Float.isNaN( qualifiedCoordinates.distance(oldCoordinates))) { - distance += qualifiedCoordinates.distance(oldCoordinates); - } - - currentCoordinates = new Coordinates(qualifiedCoordinates.getLatitude(), - qualifiedCoordinates.getLongitude(), - qualifiedCoordinates.getAltitude()); - azimuth = (int)oldCoordinates.azimuthTo(currentCoordinates); - oldCoordinates.setAltitude(qualifiedCoordinates.getAltitude()); - oldCoordinates.setLatitude(qualifiedCoordinates.getLatitude()); - oldCoordinates.setLongitude(qualifiedCoordinates.getLongitude()); - - } - - if (qualifiedCoordinates != null){ - // we are trying to get mySql datetime in the following format with a space (%20) - // 2008-04-17%2012:07:02 - - Calendar currentTime = Calendar.getInstance(); - StringBuffer mySqlDateTimeString = new StringBuffer(); - mySqlDateTimeString.append(currentTime.get(Calendar.YEAR)).append("-"); - mySqlDateTimeString.append(currentTime.get(Calendar.DATE)).append("-"); - mySqlDateTimeString.append(currentTime.get(Calendar.MONTH)+1).append("%20"); - mySqlDateTimeString.append(currentTime.get(Calendar.HOUR_OF_DAY)).append(':'); - mySqlDateTimeString.append(currentTime.get(Calendar.MINUTE)).append(':'); - mySqlDateTimeString.append(currentTime.get(Calendar.SECOND)); - - if (!Float.isNaN(location.getSpeed())) { - speed = location.getSpeed(); - } - - /* example url - http://www.websmithing.com/gpstracker2/getgooglemap3.php?lat=47.473349&lng=-122.025035&mph=137&dir=0&mi=0& - dt=2008-04-17%2012:07:02&lm=0&h=291&w=240&zm=12&dis=25&pn=momosity&sid=11137&acc=95&iv=yes&info=momostuff - */ - - String gpsData = "latitude=" + String.valueOf(qualifiedCoordinates.getLatitude()) - + "&longitude=" + String.valueOf(qualifiedCoordinates.getLongitude()) - + "&speed=" + String.valueOf((int)(speed/1609*3600)) // in miles per hour - + "&direction=" + String.valueOf(azimuth) - + "&date=" + mySqlDateTimeString - + "&locationmethod=" + location.getLocationMethod() - + "&distance=" + String.valueOf((int)(distance/1609)) // in miles - + "&phonenumber=" + midlet.phoneNumber - + "&sessionid=" + String.valueOf(sessionID) // System.currentTimeMillis(); - + "&accuracy=" + String.valueOf((int)(qualifiedCoordinates.getHorizontalAccuracy())) // in meters - + "&locationisvalid=yes" - + "&extrainfo=" + location.getExtraInfo("text/plain") - + "&eventtype=javaMe"; - - // with our query string built, we create a networker object to send the - // gps data to our website and update the DB - NetWorker netWorker = new NetWorker(midlet, uploadWebsite); - netWorker.postGpsData(gpsData); - } - - } catch (Exception e) { - midlet.log("GPS.getLocation: " + e); - } - } -} - - - diff --git a/phoneClients/javaMe/build/JavaMEPhone1/preprocessed/com/websmithing/gpstracker/GpsTracker.java b/phoneClients/javaMe/build/JavaMEPhone1/preprocessed/com/websmithing/gpstracker/GpsTracker.java deleted file mode 100644 index a40f1c2..0000000 --- a/phoneClients/javaMe/build/JavaMEPhone1/preprocessed/com/websmithing/gpstracker/GpsTracker.java +++ /dev/null @@ -1,225 +0,0 @@ -// -// GpsTracker.java -// GpsTracker -// -// Created by Nick Fox on 11/7/13. -// Copyright (c) 2013 Nick Fox. All rights reserved. -// - -package com.websmithing.gpstracker; - -import javax.microedition.midlet.*; -import javax.microedition.lcdui.*; -import java.util.Calendar; - -public class GpsTracker extends MIDlet implements CommandListener { - private Display display; - private Form form; - private Form settingsScreen; - private Command exitCmd; - private Command saveCmd; - private Command zoomCmd; - private Command settingsCmd; - private Command backCmd; - private TextField phoneNumberTextField; - private TextField uploadWebsiteTextField; - private ChoiceGroup updateIntervalCG; - private String updateInterval; - private int[] iTimes = {60, 300, 900}; - - private RmsHelper rms; - private GpsHelper gps; - - private String uploadWebsite; - private String defaultUploadWebsite = "http://www.websmithing.com/gpstracker2/getgooglemap3.php"; - - protected String phoneNumber; - protected String zoomLevel; - protected int height, width; - protected Calendar currentTime; - protected long sessionID; - - public GpsTracker(){ - form = new Form("GpsTracker"); - display = Display.getDisplay(this); - exitCmd = new Command("Exit", Command.EXIT, 1); - settingsCmd = new Command("Settings", Command.SCREEN, 2); - - form.addCommand(exitCmd); - form.addCommand(settingsCmd); - form.setCommandListener(this); - - display.setCurrent(form); - currentTime = Calendar.getInstance(); - sessionID = System.currentTimeMillis(); - height = form.getHeight(); - width = form.getWidth(); - - // RMS is the phone's built in storage, kind of like a database, but - // it only stores name-value pairs (like an associative array or hashtable). - // eveything is stored as a string. - getSettingsFromRMS(); - - // the phone number field is the only empty field when the application is - // first loaded. it does not have to be a phone number, it can be any string, - // but for uniqueness, it's best to use a phone number. this only has to be - // done once. - if (hasPhoneNumber()) { - startGPS(); - displayInterval(); - } - } - - public void startApp() { - if ( form != null ) { - display.setCurrent(form); - } - } - - // let the user know how often map will be updated - private void displayInterval() { - int tempTime = iTimes[Integer.parseInt(updateInterval)]/60; - - display.setCurrent(form); - form.deleteAll(); - - if (tempTime == 1) { - log("Getting map once a minute..."); - } - else { - log("Getting map every " + String.valueOf(tempTime) + " minutes..."); - } - } - - private void loadSettingsScreen() { - settingsScreen = new Form("Settings"); - - phoneNumberTextField = new TextField("Phone number or user name", phoneNumber, 20, TextField.ANY); - uploadWebsiteTextField = new TextField("Upload website", uploadWebsite, 100, TextField.ANY); - settingsScreen.append(phoneNumberTextField); - settingsScreen.append(uploadWebsiteTextField); - - String[] times = { "1 minute", "5 minutes", "15 minutes"}; - updateIntervalCG = new ChoiceGroup("Update map how often?", ChoiceGroup.EXCLUSIVE, times, null); - updateIntervalCG.setSelectedIndex(Integer.parseInt(updateInterval), true); - settingsScreen.append(updateIntervalCG); - - saveCmd = new Command("Save", Command.SCREEN, 1); - settingsScreen.addCommand(saveCmd); - - settingsScreen.setCommandListener(this); - display.setCurrent(settingsScreen); - } - - // get the settings from the phone's storage and load 4 global variables - public void getSettingsFromRMS() { - try { - rms = new RmsHelper(this, "GPSTracker"); - - phoneNumber = rms.get("phoneNumber"); - uploadWebsite = rms.get("uploadWebsite"); - zoomLevel = rms.get("zoomLevel"); - updateInterval = rms.get("updateInterval"); - } - catch (Exception e) { - log("GPSTracker.getSettingsFromRMS: " + e); - } - - if ((uploadWebsite == null) || (uploadWebsite.trim().length() == 0)) { - uploadWebsite = defaultUploadWebsite; - } - - if ((zoomLevel == null) || (zoomLevel.trim().length() == 0)) { - zoomLevel = "12"; - } - if ((updateInterval == null) || (updateInterval.trim().length() == 0)) { - updateInterval = "1"; - } - } - - private boolean hasPhoneNumber() { - if ((phoneNumber == null) || (phoneNumber.trim().length() == 0)) { - log("Phone number required. Please go to settings."); - return false; - } - else { - return true; - } - } - - // gps is started with the update interval. the interval is the time in between - // map updates - private void startGPS() { - if (gps == null) { - gps = new GpsHelper(this, iTimes[Integer.parseInt(updateInterval)], uploadWebsite); - gps.startGPS(); - } - } - - // this is called when the user changes the interval in the settings screen - private void changeInterval() { - if (gps == null) { - startGPS(); - } - else { - gps.changeInterval(iTimes[Integer.parseInt(updateInterval)]); - } - } - - // save settings back to phone memory - private void saveSettingsToRMS() { - try { - phoneNumber = phoneNumberTextField.getString(); - uploadWebsite = uploadWebsiteTextField.getString(); - updateInterval = String.valueOf(updateIntervalCG.getSelectedIndex()); - - rms.put("phoneNumber", phoneNumber); - rms.put("uploadWebsite", uploadWebsite); - rms.put("updateInterval", updateInterval); - - rms.save(); - } - catch (Exception e) { - log("GPSTracker.saveSettings: " + e); - } - display.setCurrent(form); - } - - public void log(String text) { - StringItem si = new StringItem(null, text); - si.setLayout(Item.LAYOUT_NEWLINE_AFTER); - form.append(si); - } - - public void commandAction(Command cmd, Displayable screen) { - if (cmd == exitCmd) { - shutDownApp(); - } - else if (cmd == saveCmd) { - saveSettingsToRMS(); - - if (hasPhoneNumber()) { - changeInterval(); - displayInterval(); - } - } - else if (cmd == settingsCmd) { - loadSettingsScreen(); - } - else if (cmd == backCmd) { - displayInterval(); - } - } - - public void pauseApp() {} - - public void destroyApp(boolean unconditional) {} - - protected void shutDownApp() { - destroyApp(true); - notifyDestroyed(); - } -} - - - diff --git a/phoneClients/javaMe/build/JavaMEPhone1/preprocessed/com/websmithing/gpstracker/NetWorker.java b/phoneClients/javaMe/build/JavaMEPhone1/preprocessed/com/websmithing/gpstracker/NetWorker.java deleted file mode 100644 index 26e8b8a..0000000 --- a/phoneClients/javaMe/build/JavaMEPhone1/preprocessed/com/websmithing/gpstracker/NetWorker.java +++ /dev/null @@ -1,86 +0,0 @@ -// -// NetWorker.java -// GpsTracker -// -// Created by Nick Fox on 11/7/13. -// Copyright (c) 2013 Nick Fox. All rights reserved. -// - -package com.websmithing.gpstracker; - -import javax.microedition.io.*; -import java.io.*; - -public class NetWorker { - private GpsTracker midlet; - private String uploadWebsite; - int i = 1; - - public NetWorker(GpsTracker lbsMidlet, String UploadWebsite){ - this.midlet = lbsMidlet; - this.uploadWebsite = UploadWebsite; - } - - public void postGpsData(String queryString) { - queryString = urlEncodeString(queryString); - HttpConnection httpConnection = null; - DataOutputStream dataOutputStream = null; - - try{ - httpConnection = (HttpConnection)Connector.open(uploadWebsite); - httpConnection.setRequestMethod(HttpConnection.POST); - httpConnection.setRequestProperty("User-Agent", "Profile/MIDP-1.0 Configuration/CLDC-1.0"); - httpConnection.setRequestProperty("Content-Language", "en-US"); - httpConnection.setRequestProperty("Content-Type", "application/x-www-form-urlencoded"); - httpConnection.setRequestProperty("Content-Length", String.valueOf(queryString.length())); - - dataOutputStream = new DataOutputStream(httpConnection.openOutputStream()); - dataOutputStream.write(queryString.getBytes()); - - // some mobile devices have unexpected behavior with flush(), test before using - //dataOutputStream.flush(); - - if(httpConnection.getResponseCode() != HttpConnection.HTTP_OK){ - midlet.log("NetWorker.postGpsData responseCode: " + httpConnection.getResponseCode()); - } - } catch (Exception e) { - midlet.log("NetWorker.postGpsData error: " + e); - } - finally{ // clean up - try{ - if(httpConnection != null) - httpConnection.close(); - if(dataOutputStream != null) - dataOutputStream.close(); - } - catch(Exception e){} - } - } - - private String urlEncodeString(String s) - { - if (s != null) { - StringBuffer tmp = new StringBuffer(); - int i = 0; - try { - while (true) { - int b = (int)s.charAt(i++); - - if (b != 0x20) { - tmp.append((char)b); - } - else { - tmp.append("%"); - if (b <= 0xf) { - tmp.append("0"); - } - tmp.append(Integer.toHexString(b)); - } - } - } - catch (Exception e) {} - return tmp.toString(); - } - return null; - } -} diff --git a/phoneClients/javaMe/build/JavaMEPhone1/preprocessed/com/websmithing/gpstracker/RmsHelper.java b/phoneClients/javaMe/build/JavaMEPhone1/preprocessed/com/websmithing/gpstracker/RmsHelper.java deleted file mode 100644 index 6a904c6..0000000 --- a/phoneClients/javaMe/build/JavaMEPhone1/preprocessed/com/websmithing/gpstracker/RmsHelper.java +++ /dev/null @@ -1,88 +0,0 @@ -// -// RmsHelper.java -// GpsTracker -// -// Created by Nick Fox on 11/7/13. -// Copyright (c) 2013 Nick Fox. All rights reserved. -// - -package com.websmithing.gpstracker; - -import java.util.*; -import javax.microedition.rms.*; - -public class RmsHelper { - private GpsTracker midlet; - private String mRecordStoreName; - private Hashtable mHashtable; - - public RmsHelper(GpsTracker Midlet, String recordStoreName) throws RecordStoreException { - this.midlet = Midlet; - this.mRecordStoreName = recordStoreName; - this.mHashtable = new Hashtable(); - load(); - } - - public String get(String key) { - return (String)mHashtable.get(key); - } - - public void put(String key, String value) { - if (value == null) value = ""; - mHashtable.put(key, value); - } - - private void load() throws RecordStoreException { - RecordStore rs = null; - RecordEnumeration re = null; - - try { - rs = RecordStore.openRecordStore(mRecordStoreName, true); - re = rs.enumerateRecords(null, null, false); - while (re.hasNextElement()) { - byte[] raw = re.nextRecord(); - String pref = new String(raw); - // Parse out the name. - int index = pref.indexOf('|'); - String name = pref.substring(0, index); - String value = pref.substring(index + 1); - put(name, value); - } - } - finally { - if (re != null) re.destroy(); - if (rs != null) rs.closeRecordStore(); - } - } - - public void save() throws RecordStoreException { - RecordStore rs = null; - RecordEnumeration re = null; - try { - rs = RecordStore.openRecordStore(mRecordStoreName, true); - re = rs.enumerateRecords(null, null, false); - - // First remove all records, a little clumsy. - while (re.hasNextElement()) { - int id = re.nextRecordId(); - rs.deleteRecord(id); - } - - // Now save the preferences records. - Enumeration keys = mHashtable.keys(); - while (keys.hasMoreElements()) { - String key = (String)keys.nextElement(); - String value = get(key); - String pref = key + "|" + value; - byte[] raw = pref.getBytes(); - rs.addRecord(raw, 0, raw.length); - } - } - finally { - if (re != null) re.destroy(); - if (rs != null) rs.closeRecordStore(); - } - } - -} - diff --git a/phoneClients/javaMe/build/manifest.mf b/phoneClients/javaMe/build/manifest.mf deleted file mode 100644 index bd06b7b..0000000 --- a/phoneClients/javaMe/build/manifest.mf +++ /dev/null @@ -1,6 +0,0 @@ -MIDlet-1: GpsTracker, , com.websmithing.gpstracker.GpsTracker -MIDlet-Vendor: Vendor -MIDlet-Name: GpsTracker -MIDlet-Version: 1.0 -MicroEdition-Configuration: CLDC-1.1 -MicroEdition-Profile: MIDP-2.1 diff --git a/phoneClients/javaMe/build/preprocessed/com/websmithing/gpstracker/GpsHelper.java b/phoneClients/javaMe/build/preprocessed/com/websmithing/gpstracker/GpsHelper.java deleted file mode 100644 index c8e8be8..0000000 --- a/phoneClients/javaMe/build/preprocessed/com/websmithing/gpstracker/GpsHelper.java +++ /dev/null @@ -1,164 +0,0 @@ -// -// GpsHelper.java -// GpsTracker -// -// Created by Nick Fox on 11/7/13. -// Copyright (c) 2013 Nick Fox. All rights reserved. -// - -package com.websmithing.gpstracker; - - -import javax.microedition.location.*; -import java.util.Calendar; -import java.util.Date; - -public class GpsHelper implements LocationListener { - - private LocationProvider locationProvider = null; - private Coordinates oldCoordinates = null, currentCoordinates = null; - private float distance = 0; - private int azimuth = 0; - private String uploadWebsite; - private GpsTracker midlet; - private int interval; - protected Calendar currentTime; - protected long sessionID; - - - public GpsHelper(GpsTracker Midlet, int Interval, String UploadWebsite){ - currentTime = Calendar.getInstance(); - sessionID = System.currentTimeMillis(); - this.midlet = Midlet; - this.interval = Interval; - this.uploadWebsite = UploadWebsite; - } - - // getting the gps location is based on an interval in seconds. for instance, - // the location is gotten once a minute, sent to the website to be stored in - // the DB (and then viewed on Google map) and used to retrieve a map tile (image) - // to be diplayed on the phone - - public void startGPS() { - if (locationProvider == null) { - createLocationProvider(); - - Thread locationThread = new Thread() { - public void run(){ - createLocationListener(); - } - }; - locationThread.start(); - } - } - - // this allows us to change how often the gps location is gotten - public void changeInterval(int Interval) { - if (locationProvider != null) { - locationProvider.setLocationListener(this, Interval, -1, -1); - } - } - - private void createLocationProvider() { - Criteria cr = new Criteria(); - - try { - locationProvider = LocationProvider.getInstance(cr); - } catch (Exception e) { - midlet.log("GPS.createLocationProvider: " + e); - } - } - - private void createLocationListener(){ - // 2cd value is interval in seconds - try { - locationProvider.setLocationListener(this, interval, -1, -1); - } catch (Exception e) { - midlet.log("GPS.createLocationListener: " + e); - } - } - - public void locationUpdated(LocationProvider provider, final Location location) { - // get new location from locationProvider - - try { - Thread getLocationThread = new Thread(){ - public void run(){ - getLocation(location); - } - }; - - getLocationThread.start(); - } catch (Exception e) { - midlet.log("GPS.locationUpdated: " + e); - } - } - - public void providerStateChanged(LocationProvider provider, int newState) {} - - private void getLocation(Location location){ - float speed = 0; - - try { - QualifiedCoordinates qualifiedCoordinates = location.getQualifiedCoordinates(); - - qualifiedCoordinates.getLatitude(); - - if (oldCoordinates == null){ - oldCoordinates = new Coordinates(qualifiedCoordinates.getLatitude(), - qualifiedCoordinates.getLongitude(), - qualifiedCoordinates.getAltitude()); - } else { - if (!Float.isNaN( qualifiedCoordinates.distance(oldCoordinates))) { - distance += qualifiedCoordinates.distance(oldCoordinates); - } - - currentCoordinates = new Coordinates(qualifiedCoordinates.getLatitude(), - qualifiedCoordinates.getLongitude(), - qualifiedCoordinates.getAltitude()); - azimuth = (int)oldCoordinates.azimuthTo(currentCoordinates); - oldCoordinates.setAltitude(qualifiedCoordinates.getAltitude()); - oldCoordinates.setLatitude(qualifiedCoordinates.getLatitude()); - oldCoordinates.setLongitude(qualifiedCoordinates.getLongitude()); - - } - - if (qualifiedCoordinates != null){ - Date d = new Date(); - - if (!Float.isNaN(location.getSpeed())) { - speed = location.getSpeed(); - } - - /* example url - http://www.websmithing.com/gpstracker2/getgooglemap3.php?lat=47.473349&lng=-122.025035&mph=137&dir=0&mi=0& - dt=2008-04-17%2012:07:02&lm=0&h=291&w=240&zm=12&dis=25&pn=momosity&sid=11137&acc=95&iv=yes&info=momostuff - */ - - String gpsData = "lat=" + String.valueOf(qualifiedCoordinates.getLatitude()) - + "&lng=" + String.valueOf(qualifiedCoordinates.getLongitude()) - + "&mph=" + String.valueOf((int)(speed/1609*3600)) // in miles per hour - + "&dir=" + String.valueOf(azimuth) - + "&dt=2008-04-17%2012:07:02" // + d.toString() - + "&lm=" + location.getLocationMethod() - + "&dis=" + String.valueOf((int)(distance/1609)) // in miles - + "&pn=" + midlet.phoneNumber - + "&sid=" + String.valueOf(sessionID) // guid? - + "&acc=" + String.valueOf((int)(qualifiedCoordinates.getHorizontalAccuracy()*3.28)) // in feet - + "&iv=yes" - + "&info=javaMe-" + location.getExtraInfo("text/plain"); - - // with our query string built, we create a networker object to send the - // gps data to our website and update the DB - NetWorker netWorker = new NetWorker(midlet, uploadWebsite); - netWorker.postGpsData(gpsData); - } - - } catch (Exception e) { - midlet.log("GPS.getLocation: " + e); - } - } -} - - - diff --git a/phoneClients/javaMe/build/preprocessed/com/websmithing/gpstracker/GpsTracker.java b/phoneClients/javaMe/build/preprocessed/com/websmithing/gpstracker/GpsTracker.java deleted file mode 100644 index a40f1c2..0000000 --- a/phoneClients/javaMe/build/preprocessed/com/websmithing/gpstracker/GpsTracker.java +++ /dev/null @@ -1,225 +0,0 @@ -// -// GpsTracker.java -// GpsTracker -// -// Created by Nick Fox on 11/7/13. -// Copyright (c) 2013 Nick Fox. All rights reserved. -// - -package com.websmithing.gpstracker; - -import javax.microedition.midlet.*; -import javax.microedition.lcdui.*; -import java.util.Calendar; - -public class GpsTracker extends MIDlet implements CommandListener { - private Display display; - private Form form; - private Form settingsScreen; - private Command exitCmd; - private Command saveCmd; - private Command zoomCmd; - private Command settingsCmd; - private Command backCmd; - private TextField phoneNumberTextField; - private TextField uploadWebsiteTextField; - private ChoiceGroup updateIntervalCG; - private String updateInterval; - private int[] iTimes = {60, 300, 900}; - - private RmsHelper rms; - private GpsHelper gps; - - private String uploadWebsite; - private String defaultUploadWebsite = "http://www.websmithing.com/gpstracker2/getgooglemap3.php"; - - protected String phoneNumber; - protected String zoomLevel; - protected int height, width; - protected Calendar currentTime; - protected long sessionID; - - public GpsTracker(){ - form = new Form("GpsTracker"); - display = Display.getDisplay(this); - exitCmd = new Command("Exit", Command.EXIT, 1); - settingsCmd = new Command("Settings", Command.SCREEN, 2); - - form.addCommand(exitCmd); - form.addCommand(settingsCmd); - form.setCommandListener(this); - - display.setCurrent(form); - currentTime = Calendar.getInstance(); - sessionID = System.currentTimeMillis(); - height = form.getHeight(); - width = form.getWidth(); - - // RMS is the phone's built in storage, kind of like a database, but - // it only stores name-value pairs (like an associative array or hashtable). - // eveything is stored as a string. - getSettingsFromRMS(); - - // the phone number field is the only empty field when the application is - // first loaded. it does not have to be a phone number, it can be any string, - // but for uniqueness, it's best to use a phone number. this only has to be - // done once. - if (hasPhoneNumber()) { - startGPS(); - displayInterval(); - } - } - - public void startApp() { - if ( form != null ) { - display.setCurrent(form); - } - } - - // let the user know how often map will be updated - private void displayInterval() { - int tempTime = iTimes[Integer.parseInt(updateInterval)]/60; - - display.setCurrent(form); - form.deleteAll(); - - if (tempTime == 1) { - log("Getting map once a minute..."); - } - else { - log("Getting map every " + String.valueOf(tempTime) + " minutes..."); - } - } - - private void loadSettingsScreen() { - settingsScreen = new Form("Settings"); - - phoneNumberTextField = new TextField("Phone number or user name", phoneNumber, 20, TextField.ANY); - uploadWebsiteTextField = new TextField("Upload website", uploadWebsite, 100, TextField.ANY); - settingsScreen.append(phoneNumberTextField); - settingsScreen.append(uploadWebsiteTextField); - - String[] times = { "1 minute", "5 minutes", "15 minutes"}; - updateIntervalCG = new ChoiceGroup("Update map how often?", ChoiceGroup.EXCLUSIVE, times, null); - updateIntervalCG.setSelectedIndex(Integer.parseInt(updateInterval), true); - settingsScreen.append(updateIntervalCG); - - saveCmd = new Command("Save", Command.SCREEN, 1); - settingsScreen.addCommand(saveCmd); - - settingsScreen.setCommandListener(this); - display.setCurrent(settingsScreen); - } - - // get the settings from the phone's storage and load 4 global variables - public void getSettingsFromRMS() { - try { - rms = new RmsHelper(this, "GPSTracker"); - - phoneNumber = rms.get("phoneNumber"); - uploadWebsite = rms.get("uploadWebsite"); - zoomLevel = rms.get("zoomLevel"); - updateInterval = rms.get("updateInterval"); - } - catch (Exception e) { - log("GPSTracker.getSettingsFromRMS: " + e); - } - - if ((uploadWebsite == null) || (uploadWebsite.trim().length() == 0)) { - uploadWebsite = defaultUploadWebsite; - } - - if ((zoomLevel == null) || (zoomLevel.trim().length() == 0)) { - zoomLevel = "12"; - } - if ((updateInterval == null) || (updateInterval.trim().length() == 0)) { - updateInterval = "1"; - } - } - - private boolean hasPhoneNumber() { - if ((phoneNumber == null) || (phoneNumber.trim().length() == 0)) { - log("Phone number required. Please go to settings."); - return false; - } - else { - return true; - } - } - - // gps is started with the update interval. the interval is the time in between - // map updates - private void startGPS() { - if (gps == null) { - gps = new GpsHelper(this, iTimes[Integer.parseInt(updateInterval)], uploadWebsite); - gps.startGPS(); - } - } - - // this is called when the user changes the interval in the settings screen - private void changeInterval() { - if (gps == null) { - startGPS(); - } - else { - gps.changeInterval(iTimes[Integer.parseInt(updateInterval)]); - } - } - - // save settings back to phone memory - private void saveSettingsToRMS() { - try { - phoneNumber = phoneNumberTextField.getString(); - uploadWebsite = uploadWebsiteTextField.getString(); - updateInterval = String.valueOf(updateIntervalCG.getSelectedIndex()); - - rms.put("phoneNumber", phoneNumber); - rms.put("uploadWebsite", uploadWebsite); - rms.put("updateInterval", updateInterval); - - rms.save(); - } - catch (Exception e) { - log("GPSTracker.saveSettings: " + e); - } - display.setCurrent(form); - } - - public void log(String text) { - StringItem si = new StringItem(null, text); - si.setLayout(Item.LAYOUT_NEWLINE_AFTER); - form.append(si); - } - - public void commandAction(Command cmd, Displayable screen) { - if (cmd == exitCmd) { - shutDownApp(); - } - else if (cmd == saveCmd) { - saveSettingsToRMS(); - - if (hasPhoneNumber()) { - changeInterval(); - displayInterval(); - } - } - else if (cmd == settingsCmd) { - loadSettingsScreen(); - } - else if (cmd == backCmd) { - displayInterval(); - } - } - - public void pauseApp() {} - - public void destroyApp(boolean unconditional) {} - - protected void shutDownApp() { - destroyApp(true); - notifyDestroyed(); - } -} - - - diff --git a/phoneClients/javaMe/build/preprocessed/com/websmithing/gpstracker/NetWorker.java b/phoneClients/javaMe/build/preprocessed/com/websmithing/gpstracker/NetWorker.java deleted file mode 100644 index 23d1353..0000000 --- a/phoneClients/javaMe/build/preprocessed/com/websmithing/gpstracker/NetWorker.java +++ /dev/null @@ -1,87 +0,0 @@ -// -// NetWorker.java -// GpsTracker -// -// Created by Nick Fox on 11/7/13. -// Copyright (c) 2013 Nick Fox. All rights reserved. -// - -package com.websmithing.gpstracker; - -import javax.microedition.io.*; -import java.io.*; - -public class NetWorker { - private GpsTracker midlet; - private String uploadWebsite; - int i = 1; - - public NetWorker(GpsTracker lbsMidlet, String UploadWebsite){ - this.midlet = lbsMidlet; - this.uploadWebsite = UploadWebsite; - } - - public void postGpsData(String queryString) { - queryString = urlEncodeString(queryString); - HttpConnection httpConnection = null; - DataOutputStream dataOutputStream = null; - - try{ - httpConnection = (HttpConnection)Connector.open(uploadWebsite); - httpConnection.setRequestMethod(HttpConnection.POST); - httpConnection.setRequestProperty("User-Agent", "Profile/MIDP-1.0 Configuration/CLDC-1.0"); - httpConnection.setRequestProperty("Content-Language", "en-US"); - httpConnection.setRequestProperty("Content-Type", "application/x-www-form-urlencoded"); - httpConnection.setRequestProperty("Content-Length", String.valueOf(queryString.length())); - - dataOutputStream = new DataOutputStream(httpConnection.openOutputStream()); - dataOutputStream.write(queryString.getBytes()); - - // some mobile devices have unexpected behavior with flush(), test before using - //dataOutputStream.flush(); - - if(httpConnection.getResponseCode() != HttpConnection.HTTP_OK){ - midlet.log("NetWorker.postGpsData responseCode: " + httpConnection.getResponseCode()); - } - } catch (Exception e) { - midlet.log("NetWorker.postGpsData error: " + e); - } - finally{ // clean up - try{ - if(httpConnection != null) - httpConnection.close(); - if(dataOutputStream != null) - dataOutputStream.close(); - } - catch(Exception e){} - } - } - - - private String urlEncodeString(String s) - { - if (s != null) { - StringBuffer tmp = new StringBuffer(); - int i = 0; - try { - while (true) { - int b = (int)s.charAt(i++); - - if (b != 0x20) { - tmp.append((char)b); - } - else { - tmp.append("%"); - if (b <= 0xf) { - tmp.append("0"); - } - tmp.append(Integer.toHexString(b)); - } - } - } - catch (Exception e) {} - return tmp.toString(); - } - return null; - } -} diff --git a/phoneClients/javaMe/build/preprocessed/com/websmithing/gpstracker/RmsHelper.java b/phoneClients/javaMe/build/preprocessed/com/websmithing/gpstracker/RmsHelper.java deleted file mode 100644 index 6a904c6..0000000 --- a/phoneClients/javaMe/build/preprocessed/com/websmithing/gpstracker/RmsHelper.java +++ /dev/null @@ -1,88 +0,0 @@ -// -// RmsHelper.java -// GpsTracker -// -// Created by Nick Fox on 11/7/13. -// Copyright (c) 2013 Nick Fox. All rights reserved. -// - -package com.websmithing.gpstracker; - -import java.util.*; -import javax.microedition.rms.*; - -public class RmsHelper { - private GpsTracker midlet; - private String mRecordStoreName; - private Hashtable mHashtable; - - public RmsHelper(GpsTracker Midlet, String recordStoreName) throws RecordStoreException { - this.midlet = Midlet; - this.mRecordStoreName = recordStoreName; - this.mHashtable = new Hashtable(); - load(); - } - - public String get(String key) { - return (String)mHashtable.get(key); - } - - public void put(String key, String value) { - if (value == null) value = ""; - mHashtable.put(key, value); - } - - private void load() throws RecordStoreException { - RecordStore rs = null; - RecordEnumeration re = null; - - try { - rs = RecordStore.openRecordStore(mRecordStoreName, true); - re = rs.enumerateRecords(null, null, false); - while (re.hasNextElement()) { - byte[] raw = re.nextRecord(); - String pref = new String(raw); - // Parse out the name. - int index = pref.indexOf('|'); - String name = pref.substring(0, index); - String value = pref.substring(index + 1); - put(name, value); - } - } - finally { - if (re != null) re.destroy(); - if (rs != null) rs.closeRecordStore(); - } - } - - public void save() throws RecordStoreException { - RecordStore rs = null; - RecordEnumeration re = null; - try { - rs = RecordStore.openRecordStore(mRecordStoreName, true); - re = rs.enumerateRecords(null, null, false); - - // First remove all records, a little clumsy. - while (re.hasNextElement()) { - int id = re.nextRecordId(); - rs.deleteRecord(id); - } - - // Now save the preferences records. - Enumeration keys = mHashtable.keys(); - while (keys.hasMoreElements()) { - String key = (String)keys.nextElement(); - String value = get(key); - String pref = key + "|" + value; - byte[] raw = pref.getBytes(); - rs.addRecord(raw, 0, raw.length); - } - } - finally { - if (re != null) re.destroy(); - if (rs != null) rs.closeRecordStore(); - } - } - -} - diff --git a/phoneClients/javaMe/dist/GpsTracker.jad b/phoneClients/javaMe/dist/GpsTracker.jad deleted file mode 100644 index 5753ada..0000000 --- a/phoneClients/javaMe/dist/GpsTracker.jad +++ /dev/null @@ -1,8 +0,0 @@ -MIDlet-1: GpsTracker, , com.websmithing.gpstracker.GpsTracker -MIDlet-Jar-Size: 11834 -MIDlet-Jar-URL: GpsTracker.jar -MIDlet-Name: GpsTracker -MIDlet-Vendor: Vendor -MIDlet-Version: 1.0 -MicroEdition-Configuration: CLDC-1.1 -MicroEdition-Profile: MIDP-2.1 diff --git a/phoneClients/javaMe/nbproject/build-impl.xml b/phoneClients/javaMe/nbproject/build-impl.xml deleted file mode 100644 index da261d7..0000000 --- a/phoneClients/javaMe/nbproject/build-impl.xml +++ /dev/null @@ -1,1250 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Classpath to J2ME Ant extension library (libs.j2me_ant_ext.classpath property) is not set. For example: location of mobility/modules/org-netbeans-mobility-antext.jar file in the IDE installation directory. - Platform home (platform.home property) is not set. Value of this property should be ${platform.active.description} emulator home directory location. - Platform boot classpath (platform.bootclasspath property) is not set. Value of this property should be ${platform.active.description} emulator boot classpath containing all J2ME classes provided by emulator. - Must set src.dir - Must set build.dir - Must set dist.dir - Must set dist.jar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Must set preprocessed.dir - - - - - - - - - - - - - - - - - - Must set build.classes.dir - - - - - - - - - - - - - - - - - - - - - Must select some files in the IDE or set javac.includes - - - - - - - - - - - - - - - - - - - - - - - - - - Must set obfuscated.classes.dir - - - - Must set obfuscated.classes.dir - Must set obfuscator.srcjar - Must set obfuscator.destjar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Must set preverify.classes.dir - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - MicroEdition-Configuration: ${platform.configuration} - - MicroEdition-Configuration: ${platform.configuration} - - - - MicroEdition-Profile: ${platform.profile} - - MicroEdition-Profile: ${platform.profile} - - - - Must set dist.jad - - - - - - - - - - - - - - - - - - - - - - - - ${manifest.midlets}${evaluated.manifest.apipermissions}${evaluated.manifest.pushregistry}${manifest.others}${manifest.jad} - ${manifest.midlets}${evaluated.manifest.apipermissions}${evaluated.manifest.pushregistry}${manifest.others}${manifest.manifest} - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Starting emulator with port number ${active.debug.port} - - - - - - - - - - - - - - - - - Starting emulator with port number ${active.debug.port} - - - - - - - - - - - - - - - - - Must set dist.javadoc.dir - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - ${all.configurations} - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Property deployment.${deployment.method}.scriptfile not set. The property should point to an Ant script providing ${deployment.method} deployment. - - - - - - - - Classpath to Ant Contrib library (libs.ant-contrib.classpath property) is not set. - - - - - - - - - Active project configuration: @{cfg} - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Property build.root.dir is not set. By default its value should be \"build\". - Property dist.root.dir is not set. By default its value should be \"dist\". - - - - - diff --git a/phoneClients/javaMe/nbproject/genfiles.properties b/phoneClients/javaMe/nbproject/genfiles.properties deleted file mode 100644 index 25e0ba6..0000000 --- a/phoneClients/javaMe/nbproject/genfiles.properties +++ /dev/null @@ -1,8 +0,0 @@ -# This file is used by a NetBeans-based IDE to track changes in generated files such as build-impl.xml. -# Do not edit this file. You may delete it but then the IDE will never regenerate such files for you. -build.xml.data.CRC32=0f5fb758 -build.xml.script.CRC32=219d9ddc -build.xml.stylesheet.CRC32=9c6a911d -nbproject/build-impl.xml.data.CRC32=0f5fb758 -nbproject/build-impl.xml.script.CRC32=8bde2673 -nbproject/build-impl.xml.stylesheet.CRC32=051c3749 diff --git a/phoneClients/javaMe/nbproject/private/private.properties b/phoneClients/javaMe/nbproject/private/private.properties deleted file mode 100644 index 3a8312e..0000000 --- a/phoneClients/javaMe/nbproject/private/private.properties +++ /dev/null @@ -1,8 +0,0 @@ -app-version.autoincrement=false -config.active=JavaMEPhone1 -configs.JavaMEPhone1.platform.apis.defaults=JSR179-1.0,JSR256-1.2 -deployment.counter=3 -deployment.number=3.0.0 -javadoc.preview=true -netbeans.user=C:\\Users\\Nick\\AppData\\Roaming\\NetBeans\\7.4 -platform.apis.defaults=JSR179-1.0,JSR256-1.2 diff --git a/phoneClients/javaMe/nbproject/private/private.xml b/phoneClients/javaMe/nbproject/private/private.xml deleted file mode 100644 index 362428f..0000000 --- a/phoneClients/javaMe/nbproject/private/private.xml +++ /dev/null @@ -1,11 +0,0 @@ - - - - - - file:/C:/Users/Nick/Documents/GpsTracker/phoneClients/javaMe/src/com/websmithing/gpstracker/GpsHelper.java - file:/C:/Users/Nick/Documents/GpsTracker/phoneClients/javaMe/src/com/websmithing/gpstracker/GpsTracker.java - file:/C:/Users/Nick/Documents/GpsTracker/phoneClients/javaMe/src/com/websmithing/gpstracker/NetWorker.java - - - diff --git a/phoneClients/javaMe/nbproject/project.properties b/phoneClients/javaMe/nbproject/project.properties deleted file mode 100644 index 996d601..0000000 --- a/phoneClients/javaMe/nbproject/project.properties +++ /dev/null @@ -1,119 +0,0 @@ -abilities=MMAPI=1.2,JSR82=1.1,JSR280=1.0,JSR226=1.0,MIDP=2.1,SATSA=1.0,CLDC=1.1,JSR177=1.0,JSR179=1.0,J2MEWS=1.0,WMA=2.0,JSR172=1.0,JSR257=1.0,JSR256=1.2,OBEX=1.0,ColorScreen,JSR239=1.0,TouchScreen,JSR211=1.0,JSR234=1.0,ScreenWidth=240,JSR75=1.0,JSR184=1.1,ScreenHeight=320,ScreenColorDepth=16, -all.configurations=\ ,JavaMEPhone1 -application.args= -application.description= -application.description.detail= -application.name= -application.vendor=Vendor -build.classes.dir=${build.dir}/compiled -build.classes.excludes=**/*.java,**/*.form,**/*.class,**/.nbintdb,**/*.mvd,**/*.wsclient,**/*.vmd -build.dir=build/${config.active} -build.root.dir=build -configs.JavaMEPhone1.abilities=MMAPI=1.2,JSR82=1.1,JSR280=1.0,JSR226=1.0,MIDP=2.1,SATSA=1.0,CLDC=1.1,JSR177=1.0,JSR179=1.0,J2MEWS=1.0,WMA=2.0,JSR172=1.0,JSR257=1.0,JSR256=1.2,OBEX=1.0,ColorScreen,JSR239=1.0,TouchScreen,JSR211=1.0,JSR234=1.0,ScreenWidth=240,JSR75=1.0,JSR184=1.1,ScreenHeight=320,ScreenColorDepth=16, -configs.JavaMEPhone1.javac.source=1.3 -configs.JavaMEPhone1.javac.target=1.3 -configs.JavaMEPhone1.platform.active=Oracle_Java_TM__Platform_Micro_Edition_SDK_3_4 -configs.JavaMEPhone1.platform.active.description=Oracle Java(TM) Platform Micro Edition SDK 3.4 -configs.JavaMEPhone1.platform.apis=JSR179-1.0,JSR256-1.2 -configs.JavaMEPhone1.platform.bootclasspath=${platform.home}/lib/jsr179_1.0.jar:${platform.home}/lib/jsr256_1.2.jar:${platform.home}/lib/midp_2.1.jar:${platform.home}/lib/cldc_1.1.jar -configs.JavaMEPhone1.platform.configuration=CLDC-1.1 -configs.JavaMEPhone1.platform.device=JavaMEPhone1 -configs.JavaMEPhone1.platform.fat.jar=true -configs.JavaMEPhone1.platform.profile=MIDP-2.1 -configs.JavaMEPhone1.platform.trigger=CLDC -configs.JavaMEPhone1.platform.type=UEI-1.0.1 -debug.level=debug -debugger.timeout= -deployment.copy.target=deploy -deployment.instance=default -deployment.jarurl=${dist.jar} -deployment.method=NONE -deployment.override.jarurl=false -dist.dir=dist/${config.active} -dist.jad=GpsTracker.jad -dist.jar=GpsTracker.jar -dist.javadoc.dir=${dist.dir}/doc -dist.root.dir=dist -extra.classpath= -file.reference.builtin.ks=${netbeans.user}/config/j2me/builtin.ks -filter.exclude.tests=false -filter.excludes= -filter.more.excludes=**/overview.html,**/package.html -filter.use.standard=true -jar.compress=true -javac.debug=true -javac.deprecation=false -javac.encoding=windows-1255 -javac.optimize=false -javac.source=1.3 -javac.target=1.3 -javadoc.author=false -javadoc.encoding= -javadoc.noindex=false -javadoc.nonavbar=false -javadoc.notree=false -javadoc.private=false -javadoc.splitindex=true -javadoc.use=true -javadoc.version=false -javadoc.windowtitle= -libs.classpath= -main.class= -main.class.class=applet -manifest.apipermissions= -manifest.file=manifest.mf -manifest.is.liblet=false -manifest.jad= -manifest.manifest= -manifest.midlets=MIDlet-1: GpsTracker, , com.websmithing.gpstracker.GpsTracker\n -manifest.others=MIDlet-Vendor: Vendor\nMIDlet-Name: GpsTracker\nMIDlet-Version: 1.0\n -manifest.pushregistry= -name=GpsTracker -no.dependencies=false -nokiaS80.application.icon= -obfuscated.classes.dir=${build.dir}/obfuscated -obfuscation.custom= -obfuscation.level=0 -obfuscator.destjar=${build.dir}/obfuscated.jar -obfuscator.srcjar=${build.dir}/before-obfuscation.jar -platform.active=Oracle_Java_TM__Platform_Micro_Edition_SDK_3_4 -platform.active.description=Oracle Java(TM) Platform Micro Edition SDK 3.4 -platform.apis=JSR179-1.0,JSR256-1.2 -platform.bootclasspath=${platform.home}/lib/jsr179_1.0.jar:${platform.home}/lib/jsr256_1.2.jar:${platform.home}/lib/midp_2.1.jar:${platform.home}/lib/cldc_1.1.jar -platform.configuration=CLDC-1.1 -platform.device=JavaMEPhone1 -platform.fat.jar=true -platform.profile=MIDP-2.1 -platform.trigger=CLDC -platform.type=UEI-1.0.1 -preprocessed.dir=${build.dir}/preprocessed -preverify.classes.dir=${build.dir}/preverified -preverify.sources.dir=${build.dir}/preverifysrc -resources.dir=resources -run.cmd.options= -run.jvmargs= -run.method=STANDARD -run.security.domain=minimum -run.use.security.domain=false -savaje.application.icon= -savaje.application.icon.focused= -savaje.application.icon.small= -savaje.application.uid=TBD -savaje.bundle.base= -savaje.bundle.debug=false -savaje.bundle.debug.port= -semc.application.caps= -semc.application.icon= -semc.application.icon.count= -semc.application.icon.splash= -semc.application.icon.splash.installonly=false -semc.application.uid=E2454680 -semc.certificate.path= -semc.private.key.password= -semc.private.key.path= -sign.alias=minimal -sign.enabled=false -sign.keystore=${file.reference.builtin.ks} -src.dir=src -use.emptyapis=true -use.preprocessor=true diff --git a/phoneClients/javaMe/nbproject/project.xml b/phoneClients/javaMe/nbproject/project.xml deleted file mode 100644 index ea52a38..0000000 --- a/phoneClients/javaMe/nbproject/project.xml +++ /dev/null @@ -1,10 +0,0 @@ - - - org.netbeans.modules.kjava.j2meproject - - - GpsTracker - 1.6 - - - diff --git a/phoneClients/javaMe/src/com/websmithing/gpstracker/GpsHelper.java b/phoneClients/javaMe/src/com/websmithing/gpstracker/GpsHelper.java deleted file mode 100644 index be6468b..0000000 --- a/phoneClients/javaMe/src/com/websmithing/gpstracker/GpsHelper.java +++ /dev/null @@ -1,165 +0,0 @@ -// -// GpsHelper.java -// GpsTracker -// -// Created by Nick Fox on 11/7/13. -// Copyright (c) 2013 Nick Fox. All rights reserved. -// - -package com.websmithing.gpstracker; - -import javax.microedition.location.*; -import java.util.Calendar; -import java.util.Date; - -public class GpsHelper implements LocationListener { - - private LocationProvider locationProvider = null; - private Coordinates oldCoordinates = null, currentCoordinates = null; - private float distance = 0; - private int azimuth = 0; - private String uploadWebsite; - private GpsTracker midlet; - private int interval; - protected long sessionID; - - public GpsHelper(GpsTracker Midlet, int Interval, String UploadWebsite){ - sessionID = System.currentTimeMillis(); - this.midlet = Midlet; - this.interval = Interval; - this.uploadWebsite = UploadWebsite; - } - - // getting the gps location is based on an interval in seconds. for instance, - // the location is gotten once a minute, sent to the website to be stored in - // the DB (and then viewed on Google map) and used to retrieve a map tile (image) - // to be diplayed on the phone - - public void startGPS() { - if (locationProvider == null) { - createLocationProvider(); - - Thread locationThread = new Thread() { - public void run(){ - createLocationListener(); - } - }; - locationThread.start(); - } - } - - // this allows us to change how often the gps location is gotten - public void changeInterval(int Interval) { - if (locationProvider != null) { - locationProvider.setLocationListener(this, Interval, -1, -1); - } - } - - private void createLocationProvider() { - Criteria cr = new Criteria(); - - try { - locationProvider = LocationProvider.getInstance(cr); - } catch (Exception e) { - midlet.log("GPS.createLocationProvider: " + e); - } - } - - private void createLocationListener(){ - // 2cd value is interval in seconds - try { - locationProvider.setLocationListener(this, interval, -1, -1); - } catch (Exception e) { - midlet.log("GPS.createLocationListener: " + e); - } - } - - public void locationUpdated(LocationProvider provider, final Location location) { - // get new location from locationProvider - - try { - Thread getLocationThread = new Thread(){ - public void run(){ - sendLocationToWebsite(location); - } - }; - - getLocationThread.start(); - } catch (Exception e) { - midlet.log("GPS.locationUpdated: " + e); - } - } - - public void providerStateChanged(LocationProvider provider, int newState) {} - - private void sendLocationToWebsite(Location location){ - float speed = 0; - - try { - QualifiedCoordinates qualifiedCoordinates = location.getQualifiedCoordinates(); - - qualifiedCoordinates.getLatitude(); - - if (oldCoordinates == null){ - oldCoordinates = new Coordinates(qualifiedCoordinates.getLatitude(), - qualifiedCoordinates.getLongitude(), - qualifiedCoordinates.getAltitude()); - } else { - if (!Float.isNaN( qualifiedCoordinates.distance(oldCoordinates))) { - distance += qualifiedCoordinates.distance(oldCoordinates); - } - - currentCoordinates = new Coordinates(qualifiedCoordinates.getLatitude(), - qualifiedCoordinates.getLongitude(), - qualifiedCoordinates.getAltitude()); - azimuth = (int)oldCoordinates.azimuthTo(currentCoordinates); - oldCoordinates.setAltitude(qualifiedCoordinates.getAltitude()); - oldCoordinates.setLatitude(qualifiedCoordinates.getLatitude()); - oldCoordinates.setLongitude(qualifiedCoordinates.getLongitude()); - - } - - if (qualifiedCoordinates != null){ - // we are trying to get mySql datetime in the following format with a space (%20) - // 2008-04-17%2012:07:02 - - Calendar currentTime = Calendar.getInstance(); - StringBuffer mySqlDateTimeString = new StringBuffer(); - mySqlDateTimeString.append(currentTime.get(Calendar.YEAR)).append("-"); - mySqlDateTimeString.append(currentTime.get(Calendar.DATE)).append("-"); - mySqlDateTimeString.append(currentTime.get(Calendar.MONTH)+1).append("%20"); - mySqlDateTimeString.append(currentTime.get(Calendar.HOUR_OF_DAY)).append(':'); - mySqlDateTimeString.append(currentTime.get(Calendar.MINUTE)).append(':'); - mySqlDateTimeString.append(currentTime.get(Calendar.SECOND)); - - if (!Float.isNaN(location.getSpeed())) { - speed = location.getSpeed(); - } - - String gpsData = "latitude=" + String.valueOf(qualifiedCoordinates.getLatitude()) - + "&longitude=" + String.valueOf(qualifiedCoordinates.getLongitude()) - + "&speed=" + String.valueOf((int)(speed/1609*3600)) // in miles per hour - + "&direction=" + String.valueOf(azimuth) - + "&date=" + mySqlDateTimeString - + "&locationmethod=" + location.getLocationMethod() - + "&distance=" + String.valueOf((int)(distance/1609)) // in miles - + "&phonenumber=javaMeUser" - + "&sessionid=" + String.valueOf(sessionID) // System.currentTimeMillis(); - + "&accuracy=" + String.valueOf((int)(qualifiedCoordinates.getHorizontalAccuracy())) // in meters - + "&extrainfo=" + location.getExtraInfo("text/plain") - + "&eventtype=javaMe"; - - // with our query string built, we create a networker object to send the - // gps data to our website and update the DB - NetWorker netWorker = new NetWorker(midlet, uploadWebsite); - netWorker.postGpsData(gpsData); - } - - } catch (Exception e) { - midlet.log("GPS.getLocation: " + e); - } - } -} - - - diff --git a/phoneClients/javaMe/src/com/websmithing/gpstracker/GpsTracker.java b/phoneClients/javaMe/src/com/websmithing/gpstracker/GpsTracker.java deleted file mode 100644 index db1c18f..0000000 --- a/phoneClients/javaMe/src/com/websmithing/gpstracker/GpsTracker.java +++ /dev/null @@ -1,229 +0,0 @@ -// -// GpsTracker.java -// GpsTracker -// -// Created by Nick Fox on 11/7/13. -// Copyright (c) 2013 Nick Fox. All rights reserved. -// - -package com.websmithing.gpstracker; - -import javax.microedition.midlet.*; -import javax.microedition.lcdui.*; -import java.util.Calendar; - -public class GpsTracker extends MIDlet implements CommandListener { - private Display display; - private Form form; - private Form settingsScreen; - private Command exitCmd; - private Command saveCmd; - private Command zoomCmd; - private Command settingsCmd; - private Command backCmd; - private TextField phoneNumberTextField; - private TextField uploadWebsiteTextField; - private ChoiceGroup updateIntervalCG; - private String updateInterval; - private int[] iTimes = {60, 300, 900}; - - private RmsHelper rms; - private GpsHelper gps; - - private String uploadWebsite; - - // use the websmithing defaultUploadWebsite for testing, change the *phoneNumber* form variable to something you - // know and then check your location with your browser here: http://www.websmithing.com/gpstracker/displaymap.php - - private String defaultUploadWebsite = "http://www.websmithing.com/gpstracker/updatelocation.php"; - - protected String phoneNumber; - protected String zoomLevel; - protected int height, width; - protected Calendar currentTime; - protected long sessionID; - - public GpsTracker(){ - form = new Form("GpsTracker"); - display = Display.getDisplay(this); - exitCmd = new Command("Exit", Command.EXIT, 1); - settingsCmd = new Command("Settings", Command.SCREEN, 2); - - form.addCommand(exitCmd); - form.addCommand(settingsCmd); - form.setCommandListener(this); - - display.setCurrent(form); - currentTime = Calendar.getInstance(); - sessionID = System.currentTimeMillis(); - height = form.getHeight(); - width = form.getWidth(); - - // RMS is the phone's built in storage, kind of like a database, but - // it only stores name-value pairs (like an associative array or hashtable). - // eveything is stored as a string. - getSettingsFromRMS(); - - // the phone number field is the only empty field when the application is - // first loaded. it does not have to be a phone number, it can be any string, - // but for uniqueness, it's best to use a phone number. this only has to be - // done once. - if (hasPhoneNumber()) { - startGPS(); - displayInterval(); - } - } - - public void startApp() { - if ( form != null ) { - display.setCurrent(form); - } - } - - // let the user know how often map will be updated - private void displayInterval() { - int tempTime = iTimes[Integer.parseInt(updateInterval)]/60; - - display.setCurrent(form); - form.deleteAll(); - - if (tempTime == 1) { - log("Getting map once a minute..."); - } - else { - log("Getting map every " + String.valueOf(tempTime) + " minutes..."); - } - } - - private void loadSettingsScreen() { - settingsScreen = new Form("Settings"); - - phoneNumberTextField = new TextField("Phone number or user name", phoneNumber, 20, TextField.ANY); - uploadWebsiteTextField = new TextField("Upload website", uploadWebsite, 100, TextField.ANY); - settingsScreen.append(phoneNumberTextField); - settingsScreen.append(uploadWebsiteTextField); - - String[] times = { "1 minute", "5 minutes", "15 minutes"}; - updateIntervalCG = new ChoiceGroup("Update map how often?", ChoiceGroup.EXCLUSIVE, times, null); - updateIntervalCG.setSelectedIndex(Integer.parseInt(updateInterval), true); - settingsScreen.append(updateIntervalCG); - - saveCmd = new Command("Save", Command.SCREEN, 1); - settingsScreen.addCommand(saveCmd); - - settingsScreen.setCommandListener(this); - display.setCurrent(settingsScreen); - } - - // get the settings from the phone's storage and load 4 global variables - public void getSettingsFromRMS() { - try { - rms = new RmsHelper(this, "GPSTracker"); - - phoneNumber = rms.get("phoneNumber"); - uploadWebsite = rms.get("uploadWebsite"); - zoomLevel = rms.get("zoomLevel"); - updateInterval = rms.get("updateInterval"); - } - catch (Exception e) { - log("GPSTracker.getSettingsFromRMS: " + e); - } - - if ((uploadWebsite == null) || (uploadWebsite.trim().length() == 0)) { - uploadWebsite = defaultUploadWebsite; - } - - if ((zoomLevel == null) || (zoomLevel.trim().length() == 0)) { - zoomLevel = "12"; - } - if ((updateInterval == null) || (updateInterval.trim().length() == 0)) { - updateInterval = "1"; - } - } - - private boolean hasPhoneNumber() { - if ((phoneNumber == null) || (phoneNumber.trim().length() == 0)) { - log("Phone number required. Please go to settings."); - return false; - } - else { - return true; - } - } - - // gps is started with the update interval. the interval is the time in between - // map updates - private void startGPS() { - if (gps == null) { - gps = new GpsHelper(this, iTimes[Integer.parseInt(updateInterval)], uploadWebsite); - gps.startGPS(); - } - } - - // this is called when the user changes the interval in the settings screen - private void changeInterval() { - if (gps == null) { - startGPS(); - } - else { - gps.changeInterval(iTimes[Integer.parseInt(updateInterval)]); - } - } - - // save settings back to phone memory - private void saveSettingsToRMS() { - try { - phoneNumber = phoneNumberTextField.getString(); - uploadWebsite = uploadWebsiteTextField.getString(); - updateInterval = String.valueOf(updateIntervalCG.getSelectedIndex()); - - rms.put("phoneNumber", phoneNumber); - rms.put("uploadWebsite", uploadWebsite); - rms.put("updateInterval", updateInterval); - - rms.save(); - } - catch (Exception e) { - log("GPSTracker.saveSettings: " + e); - } - display.setCurrent(form); - } - - public void log(String text) { - StringItem si = new StringItem(null, text); - si.setLayout(Item.LAYOUT_NEWLINE_AFTER); - form.append(si); - } - - public void commandAction(Command cmd, Displayable screen) { - if (cmd == exitCmd) { - shutDownApp(); - } - else if (cmd == saveCmd) { - saveSettingsToRMS(); - - if (hasPhoneNumber()) { - changeInterval(); - displayInterval(); - } - } - else if (cmd == settingsCmd) { - loadSettingsScreen(); - } - else if (cmd == backCmd) { - displayInterval(); - } - } - - public void pauseApp() {} - - public void destroyApp(boolean unconditional) {} - - protected void shutDownApp() { - destroyApp(true); - notifyDestroyed(); - } -} - - - diff --git a/phoneClients/javaMe/src/com/websmithing/gpstracker/NetWorker.java b/phoneClients/javaMe/src/com/websmithing/gpstracker/NetWorker.java deleted file mode 100644 index 26e8b8a..0000000 --- a/phoneClients/javaMe/src/com/websmithing/gpstracker/NetWorker.java +++ /dev/null @@ -1,86 +0,0 @@ -// -// NetWorker.java -// GpsTracker -// -// Created by Nick Fox on 11/7/13. -// Copyright (c) 2013 Nick Fox. All rights reserved. -// - -package com.websmithing.gpstracker; - -import javax.microedition.io.*; -import java.io.*; - -public class NetWorker { - private GpsTracker midlet; - private String uploadWebsite; - int i = 1; - - public NetWorker(GpsTracker lbsMidlet, String UploadWebsite){ - this.midlet = lbsMidlet; - this.uploadWebsite = UploadWebsite; - } - - public void postGpsData(String queryString) { - queryString = urlEncodeString(queryString); - HttpConnection httpConnection = null; - DataOutputStream dataOutputStream = null; - - try{ - httpConnection = (HttpConnection)Connector.open(uploadWebsite); - httpConnection.setRequestMethod(HttpConnection.POST); - httpConnection.setRequestProperty("User-Agent", "Profile/MIDP-1.0 Configuration/CLDC-1.0"); - httpConnection.setRequestProperty("Content-Language", "en-US"); - httpConnection.setRequestProperty("Content-Type", "application/x-www-form-urlencoded"); - httpConnection.setRequestProperty("Content-Length", String.valueOf(queryString.length())); - - dataOutputStream = new DataOutputStream(httpConnection.openOutputStream()); - dataOutputStream.write(queryString.getBytes()); - - // some mobile devices have unexpected behavior with flush(), test before using - //dataOutputStream.flush(); - - if(httpConnection.getResponseCode() != HttpConnection.HTTP_OK){ - midlet.log("NetWorker.postGpsData responseCode: " + httpConnection.getResponseCode()); - } - } catch (Exception e) { - midlet.log("NetWorker.postGpsData error: " + e); - } - finally{ // clean up - try{ - if(httpConnection != null) - httpConnection.close(); - if(dataOutputStream != null) - dataOutputStream.close(); - } - catch(Exception e){} - } - } - - private String urlEncodeString(String s) - { - if (s != null) { - StringBuffer tmp = new StringBuffer(); - int i = 0; - try { - while (true) { - int b = (int)s.charAt(i++); - - if (b != 0x20) { - tmp.append((char)b); - } - else { - tmp.append("%"); - if (b <= 0xf) { - tmp.append("0"); - } - tmp.append(Integer.toHexString(b)); - } - } - } - catch (Exception e) {} - return tmp.toString(); - } - return null; - } -} diff --git a/phoneClients/javaMe/src/com/websmithing/gpstracker/RmsHelper.java b/phoneClients/javaMe/src/com/websmithing/gpstracker/RmsHelper.java deleted file mode 100644 index 6a904c6..0000000 --- a/phoneClients/javaMe/src/com/websmithing/gpstracker/RmsHelper.java +++ /dev/null @@ -1,88 +0,0 @@ -// -// RmsHelper.java -// GpsTracker -// -// Created by Nick Fox on 11/7/13. -// Copyright (c) 2013 Nick Fox. All rights reserved. -// - -package com.websmithing.gpstracker; - -import java.util.*; -import javax.microedition.rms.*; - -public class RmsHelper { - private GpsTracker midlet; - private String mRecordStoreName; - private Hashtable mHashtable; - - public RmsHelper(GpsTracker Midlet, String recordStoreName) throws RecordStoreException { - this.midlet = Midlet; - this.mRecordStoreName = recordStoreName; - this.mHashtable = new Hashtable(); - load(); - } - - public String get(String key) { - return (String)mHashtable.get(key); - } - - public void put(String key, String value) { - if (value == null) value = ""; - mHashtable.put(key, value); - } - - private void load() throws RecordStoreException { - RecordStore rs = null; - RecordEnumeration re = null; - - try { - rs = RecordStore.openRecordStore(mRecordStoreName, true); - re = rs.enumerateRecords(null, null, false); - while (re.hasNextElement()) { - byte[] raw = re.nextRecord(); - String pref = new String(raw); - // Parse out the name. - int index = pref.indexOf('|'); - String name = pref.substring(0, index); - String value = pref.substring(index + 1); - put(name, value); - } - } - finally { - if (re != null) re.destroy(); - if (rs != null) rs.closeRecordStore(); - } - } - - public void save() throws RecordStoreException { - RecordStore rs = null; - RecordEnumeration re = null; - try { - rs = RecordStore.openRecordStore(mRecordStoreName, true); - re = rs.enumerateRecords(null, null, false); - - // First remove all records, a little clumsy. - while (re.hasNextElement()) { - int id = re.nextRecordId(); - rs.deleteRecord(id); - } - - // Now save the preferences records. - Enumeration keys = mHashtable.keys(); - while (keys.hasMoreElements()) { - String key = (String)keys.nextElement(); - String value = get(key); - String pref = key + "|" + value; - byte[] raw = pref.getBytes(); - rs.addRecord(raw, 0, raw.length); - } - } - finally { - if (re != null) re.destroy(); - if (rs != null) rs.closeRecordStore(); - } - } - -} - diff --git a/phoneClients/windowsPhone/.gitignore b/phoneClients/windowsPhone/.gitignore deleted file mode 100644 index cfc979b..0000000 --- a/phoneClients/windowsPhone/.gitignore +++ /dev/null @@ -1,181 +0,0 @@ -## Ignore Visual Studio temporary files, build results, and -## files generated by popular Visual Studio add-ons... - -# User-specific files -*.suo -*.user -*.sln.docstates - -# Build results -[Dd]ebug/ -[Dd]ebugPublic/ -[Rr]elease/ -x64/ -build/ -bld/ -[Bb]in/ -[Oo]bj/ - -# Enable "build/" folder in the NuGet Packages folder since NuGet packages use it for MSBuild targets -!packages/*/build/ - -# MSTest test Results -[Tt]est[Rr]esult*/ -[Bb]uild[Ll]og.* - -#NUNIT -*.VisualState.xml -TestResult.xml - -*_i.c -*_p.c -*_i.h -*.ilk -*.meta -*.obj -*.pch -*.pdb -*.pgc -*.pgd -*.rsp -*.sbr -*.tlb -*.tli -*.tlh -*.tmp -*.tmp_proj -*.log -*.vspscc -*.vssscc -.builds -*.pidb -*.svclog -*.scc - -# Chutzpah Test files -_Chutzpah* - -# Visual C++ cache files -ipch/ -*.aps -*.ncb -*.opensdf -*.sdf -*.cachefile - -# Visual Studio profiler -*.psess -*.vsp -*.vspx - -# TFS 2012 Local Workspace -$tf/ - -# Guidance Automation Toolkit -*.gpState - -# ReSharper is a .NET coding add-in -_ReSharper*/ -*.[Rr]e[Ss]harper -*.DotSettings.user - -# JustCode is a .NET coding addin-in -.JustCode - -# TeamCity is a build add-in -_TeamCity* - -# DotCover is a Code Coverage Tool -*.dotCover - -# NCrunch -*.ncrunch* -_NCrunch_* -.*crunch*.local.xml - -# MightyMoose -*.mm.* -AutoTest.Net/ - -# Installshield output folder -[Ee]xpress/ - -# DocProject is a documentation generator add-in -DocProject/buildhelp/ -DocProject/Help/*.HxT -DocProject/Help/*.HxC -DocProject/Help/*.hhc -DocProject/Help/*.hhk -DocProject/Help/*.hhp -DocProject/Help/Html2 -DocProject/Help/html - -# Click-Once directory -publish/ - -# Publish Web Output -*.Publish.xml -*.azurePubxml - -# NuGet Packages Directory -## TODO: If you have NuGet Package Restore enabled, uncomment the next line -#packages/ -## TODO: If the tool you use requires repositories.config, also uncomment the next line -#!packages/repositories.config - -# Windows Azure Build Output -csx/ -*.build.csdef - -# Windows Store app package directory -AppPackages/ - -# Others -sql/ -*.Cache -ClientBin/ -[Ss]tyle[Cc]op.* -~$* -*~ -*.dbmdl -*.dbproj.schemaview -*.[Pp]ublish.xml -*.pfx -*.publishsettings - -# RIA/Silverlight projects -Generated_Code/ - -# Backup & report files from converting an old project file to a newer -# Visual Studio version. Backup files are not needed, because we have git ;-) -_UpgradeReport_Files/ -Backup*/ -UpgradeLog*.XML -UpgradeLog*.htm - -# SQL Server files -App_Data/*.mdf -App_Data/*.ldf - -# Business Intelligence projects -*.rdl.data -*.bim.layout -*.bim_*.settings - -# Microsoft Fakes -FakesAssemblies/ - -# ========================= -# Windows detritus -# ========================= - -# Windows image file caches -Thumbs.db -ehthumbs.db - -# Folder config file -Desktop.ini - -# Recycle Bin used on file shares -$RECYCLE.BIN/ - diff --git a/phoneClients/windowsPhone/GPSTracker.sln b/phoneClients/windowsPhone/GPSTracker.sln deleted file mode 100644 index 8b3ac04..0000000 --- a/phoneClients/windowsPhone/GPSTracker.sln +++ /dev/null @@ -1,38 +0,0 @@ - -Microsoft Visual Studio Solution File, Format Version 12.00 -# Visual Studio Express 2012 for Windows Phone -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "GPSTracker", "GPSTracker\GPSTracker.csproj", "{DA68943F-9ABF-407C-8692-E3475337BBA7}" -EndProject -Global - GlobalSection(SolutionConfigurationPlatforms) = preSolution - Debug|Any CPU = Debug|Any CPU - Debug|ARM = Debug|ARM - Debug|x86 = Debug|x86 - Release|Any CPU = Release|Any CPU - Release|ARM = Release|ARM - Release|x86 = Release|x86 - EndGlobalSection - GlobalSection(ProjectConfigurationPlatforms) = postSolution - {DA68943F-9ABF-407C-8692-E3475337BBA7}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {DA68943F-9ABF-407C-8692-E3475337BBA7}.Debug|Any CPU.Build.0 = Debug|Any CPU - {DA68943F-9ABF-407C-8692-E3475337BBA7}.Debug|Any CPU.Deploy.0 = Debug|Any CPU - {DA68943F-9ABF-407C-8692-E3475337BBA7}.Debug|ARM.ActiveCfg = Debug|ARM - {DA68943F-9ABF-407C-8692-E3475337BBA7}.Debug|ARM.Build.0 = Debug|ARM - {DA68943F-9ABF-407C-8692-E3475337BBA7}.Debug|ARM.Deploy.0 = Debug|ARM - {DA68943F-9ABF-407C-8692-E3475337BBA7}.Debug|x86.ActiveCfg = Debug|x86 - {DA68943F-9ABF-407C-8692-E3475337BBA7}.Debug|x86.Build.0 = Debug|x86 - {DA68943F-9ABF-407C-8692-E3475337BBA7}.Debug|x86.Deploy.0 = Debug|x86 - {DA68943F-9ABF-407C-8692-E3475337BBA7}.Release|Any CPU.ActiveCfg = Release|Any CPU - {DA68943F-9ABF-407C-8692-E3475337BBA7}.Release|Any CPU.Build.0 = Release|Any CPU - {DA68943F-9ABF-407C-8692-E3475337BBA7}.Release|Any CPU.Deploy.0 = Release|Any CPU - {DA68943F-9ABF-407C-8692-E3475337BBA7}.Release|ARM.ActiveCfg = Release|ARM - {DA68943F-9ABF-407C-8692-E3475337BBA7}.Release|ARM.Build.0 = Release|ARM - {DA68943F-9ABF-407C-8692-E3475337BBA7}.Release|ARM.Deploy.0 = Release|ARM - {DA68943F-9ABF-407C-8692-E3475337BBA7}.Release|x86.ActiveCfg = Release|x86 - {DA68943F-9ABF-407C-8692-E3475337BBA7}.Release|x86.Build.0 = Release|x86 - {DA68943F-9ABF-407C-8692-E3475337BBA7}.Release|x86.Deploy.0 = Release|x86 - EndGlobalSection - GlobalSection(SolutionProperties) = preSolution - HideSolutionNode = FALSE - EndGlobalSection -EndGlobal diff --git a/phoneClients/windowsPhone/GPSTracker/App.xaml b/phoneClients/windowsPhone/GPSTracker/App.xaml deleted file mode 100644 index 06732c8..0000000 --- a/phoneClients/windowsPhone/GPSTracker/App.xaml +++ /dev/null @@ -1,21 +0,0 @@ - - - - - - - - - - - - - \ No newline at end of file diff --git a/phoneClients/windowsPhone/GPSTracker/App.xaml.cs b/phoneClients/windowsPhone/GPSTracker/App.xaml.cs deleted file mode 100644 index 956ad7a..0000000 --- a/phoneClients/windowsPhone/GPSTracker/App.xaml.cs +++ /dev/null @@ -1,240 +0,0 @@ -using System; -using System.Diagnostics; -using System.Resources; -using System.Windows; -using System.Windows.Markup; -using System.Windows.Navigation; -using Microsoft.Phone.Controls; -using Microsoft.Phone.Shell; -using GPSTracker.Resources; -using Windows.Devices.Geolocation; - -namespace GPSTracker -{ - public partial class App : Application - { - /// - /// Provides easy access to the root frame of the Phone Application. - /// - /// The root frame of the Phone Application. - public static PhoneApplicationFrame RootFrame { get; private set; } - - // Global Geolocator so that it doesn't go out of scope - public static Geolocator Geolocator { get; set; } - - // boolean to track whether we are currently running in the background - public static bool RunningInBackground { get; set; } - - /// - /// Constructor for the Application object. - /// - public App() - { - // Global handler for uncaught exceptions. - UnhandledException += Application_UnhandledException; - - // Standard XAML initialization - InitializeComponent(); - - // Phone-specific initialization - InitializePhoneApplication(); - - // Language display initialization - InitializeLanguage(); - - // Show graphics profiling information while debugging. - if (Debugger.IsAttached) - { - // Display the current frame rate counters. - Application.Current.Host.Settings.EnableFrameRateCounter = true; - - // Show the areas of the app that are being redrawn in each frame. - //Application.Current.Host.Settings.EnableRedrawRegions = true; - - // Enable non-production analysis visualization mode, - // which shows areas of a page that are handed off to GPU with a colored overlay. - //Application.Current.Host.Settings.EnableCacheVisualization = true; - - // Prevent the screen from turning off while under the debugger by disabling - // the application's idle detection. - // Caution:- Use this under debug mode only. Application that disables user idle detection will continue to run - // and consume battery power when the user is not using the phone. - PhoneApplicationService.Current.UserIdleDetectionMode = IdleDetectionMode.Disabled; - } - - } - - // Code to execute when the application is launching (eg, from Start) - // This code will not execute when the application is reactivated - private void Application_Launching(object sender, LaunchingEventArgs e) - { - } - - // Code to execute when the application is activated (brought to foreground) - // This code will not execute when the application is first launched - private void Application_Activated(object sender, ActivatedEventArgs e) - { - RunningInBackground = false; - } - - // Code to execute when the application is deactivated (sent to background) - // This code will not execute when the application is closing - private void Application_Deactivated(object sender, DeactivatedEventArgs e) - { - Debug.WriteLine(String.Format("{0:d/M/yy h:mm:ss tt} ", DateTime.Now + " deactivated reason: " + e.Reason)); - } - - // Code to execute when the application is closing (eg, user hit Back) - // This code will not execute when the application is deactivated - private void Application_Closing(object sender, ClosingEventArgs e) - { - Debug.WriteLine(String.Format("{0:d/M/yy h:mm:ss tt} ", DateTime.Now + " closing: " + e.ToString())); - } - - private void Application_RunningInBackground(object sender, RunningInBackgroundEventArgs args) - { - // Pages can check this value and know to suspend all unnecessary processing such as UI updates - RunningInBackground = true; - - } - - // Code to execute if a navigation fails - private void RootFrame_NavigationFailed(object sender, NavigationFailedEventArgs e) - { - if (Debugger.IsAttached) - { - // A navigation has failed; break into the debugger - Debugger.Break(); - } - } - - // Code to execute on Unhandled Exceptions - private void Application_UnhandledException(object sender, ApplicationUnhandledExceptionEventArgs e) - { - if (Debugger.IsAttached) - { - // An unhandled exception has occurred; break into the debugger - Debugger.Break(); - } - } - - #region Phone application initialization - - // Avoid double-initialization - private bool phoneApplicationInitialized = false; - - // Do not add any additional code to this method - private void InitializePhoneApplication() - { - if (phoneApplicationInitialized) - return; - - // Create the frame but don't set it as RootVisual yet; this allows the splash - // screen to remain active until the application is ready to render. - RootFrame = new PhoneApplicationFrame(); - RootFrame.Navigated += CompleteInitializePhoneApplication; - - // Handle navigation failures - RootFrame.NavigationFailed += RootFrame_NavigationFailed; - - // Handle reset requests for clearing the backstack - RootFrame.Navigated += CheckForResetNavigation; - - // Ensure we don't initialize again - phoneApplicationInitialized = true; - } - - // Do not add any additional code to this method - private void CompleteInitializePhoneApplication(object sender, NavigationEventArgs e) - { - // Set the root visual to allow the application to render - if (RootVisual != RootFrame) - RootVisual = RootFrame; - - // Remove this handler since it is no longer needed - RootFrame.Navigated -= CompleteInitializePhoneApplication; - } - - private void CheckForResetNavigation(object sender, NavigationEventArgs e) - { - // If the app has received a 'reset' navigation, then we need to check - // on the next navigation to see if the page stack should be reset - if (e.NavigationMode == NavigationMode.Reset) - RootFrame.Navigated += ClearBackStackAfterReset; - } - - private void ClearBackStackAfterReset(object sender, NavigationEventArgs e) - { - // Unregister the event so it doesn't get called again - RootFrame.Navigated -= ClearBackStackAfterReset; - - // Only clear the stack for 'new' (forward) and 'refresh' navigations - if (e.NavigationMode != NavigationMode.New && e.NavigationMode != NavigationMode.Refresh) - return; - - // For UI consistency, clear the entire page stack - while (RootFrame.RemoveBackEntry() != null) - { - ; // do nothing - } - } - - #endregion - - // Initialize the app's font and flow direction as defined in its localized resource strings. - // - // To ensure that the font of your application is aligned with its supported languages and that the - // FlowDirection for each of those languages follows its traditional direction, ResourceLanguage - // and ResourceFlowDirection should be initialized in each resx file to match these values with that - // file's culture. For example: - // - // AppResources.es-ES.resx - // ResourceLanguage's value should be "es-ES" - // ResourceFlowDirection's value should be "LeftToRight" - // - // AppResources.ar-SA.resx - // ResourceLanguage's value should be "ar-SA" - // ResourceFlowDirection's value should be "RightToLeft" - // - // For more info on localizing Windows Phone apps see http://go.microsoft.com/fwlink/?LinkId=262072. - // - private void InitializeLanguage() - { - try - { - // Set the font to match the display language defined by the - // ResourceLanguage resource string for each supported language. - // - // Fall back to the font of the neutral language if the Display - // language of the phone is not supported. - // - // If a compiler error is hit then ResourceLanguage is missing from - // the resource file. - RootFrame.Language = XmlLanguage.GetLanguage(AppResources.ResourceLanguage); - - // Set the FlowDirection of all elements under the root frame based - // on the ResourceFlowDirection resource string for each - // supported language. - // - // If a compiler error is hit then ResourceFlowDirection is missing from - // the resource file. - FlowDirection flow = (FlowDirection)Enum.Parse(typeof(FlowDirection), AppResources.ResourceFlowDirection); - RootFrame.FlowDirection = flow; - } - catch - { - // If an exception is caught here it is most likely due to either - // ResourceLangauge not being correctly set to a supported language - // code or ResourceFlowDirection is set to a value other than LeftToRight - // or RightToLeft. - - if (Debugger.IsAttached) - { - Debugger.Break(); - } - - throw; - } - } - } -} \ No newline at end of file diff --git a/phoneClients/windowsPhone/GPSTracker/Assets/AlignmentGrid.png b/phoneClients/windowsPhone/GPSTracker/Assets/AlignmentGrid.png deleted file mode 100644 index f7d2e97..0000000 --- a/phoneClients/windowsPhone/GPSTracker/Assets/AlignmentGrid.png +++ /dev/null Binary files differ diff --git a/phoneClients/windowsPhone/GPSTracker/Assets/ApplicationIcon.png b/phoneClients/windowsPhone/GPSTracker/Assets/ApplicationIcon.png deleted file mode 100644 index 7d95d4e..0000000 --- a/phoneClients/windowsPhone/GPSTracker/Assets/ApplicationIcon.png +++ /dev/null Binary files differ diff --git a/phoneClients/windowsPhone/GPSTracker/Assets/Tiles/FlipCycleTileLarge.png b/phoneClients/windowsPhone/GPSTracker/Assets/Tiles/FlipCycleTileLarge.png deleted file mode 100644 index e0c59ac..0000000 --- a/phoneClients/windowsPhone/GPSTracker/Assets/Tiles/FlipCycleTileLarge.png +++ /dev/null Binary files differ diff --git a/phoneClients/windowsPhone/GPSTracker/Assets/Tiles/FlipCycleTileMedium.png b/phoneClients/windowsPhone/GPSTracker/Assets/Tiles/FlipCycleTileMedium.png deleted file mode 100644 index e93b89d..0000000 --- a/phoneClients/windowsPhone/GPSTracker/Assets/Tiles/FlipCycleTileMedium.png +++ /dev/null Binary files differ diff --git a/phoneClients/windowsPhone/GPSTracker/Assets/Tiles/FlipCycleTileSmall.png b/phoneClients/windowsPhone/GPSTracker/Assets/Tiles/FlipCycleTileSmall.png deleted file mode 100644 index 550b1b5..0000000 --- a/phoneClients/windowsPhone/GPSTracker/Assets/Tiles/FlipCycleTileSmall.png +++ /dev/null Binary files differ diff --git a/phoneClients/windowsPhone/GPSTracker/Assets/Tiles/IconicTileMediumLarge.png b/phoneClients/windowsPhone/GPSTracker/Assets/Tiles/IconicTileMediumLarge.png deleted file mode 100644 index 686e6b5..0000000 --- a/phoneClients/windowsPhone/GPSTracker/Assets/Tiles/IconicTileMediumLarge.png +++ /dev/null Binary files differ diff --git a/phoneClients/windowsPhone/GPSTracker/Assets/Tiles/IconicTileSmall.png b/phoneClients/windowsPhone/GPSTracker/Assets/Tiles/IconicTileSmall.png deleted file mode 100644 index d4b5ede..0000000 --- a/phoneClients/windowsPhone/GPSTracker/Assets/Tiles/IconicTileSmall.png +++ /dev/null Binary files differ diff --git a/phoneClients/windowsPhone/GPSTracker/GPSTracker.csproj b/phoneClients/windowsPhone/GPSTracker/GPSTracker.csproj deleted file mode 100644 index 4f62cc4..0000000 --- a/phoneClients/windowsPhone/GPSTracker/GPSTracker.csproj +++ /dev/null @@ -1,177 +0,0 @@ - - - - Debug - AnyCPU - 10.0.20506 - 2.0 - {DA68943F-9ABF-407C-8692-E3475337BBA7} - {C089C8C0-30E0-4E22-80C0-CE093F111A43};{fae04ec0-301f-11d3-bf4b-00c04f79efbc} - Library - Properties - GPSTracker - GPSTracker - WindowsPhone - v8.0 - $(TargetFrameworkVersion) - true - - - true - true - GPSTracker_$(Configuration)_$(Platform).xap - Properties\AppManifest.xml - GPSTracker.App - true - 11.0 - true - - - true - full - false - Bin\Debug - DEBUG;TRACE;SILVERLIGHT;WINDOWS_PHONE - true - true - prompt - 4 - - - pdbonly - true - Bin\Release - TRACE;SILVERLIGHT;WINDOWS_PHONE - true - true - prompt - 4 - - - true - full - false - Bin\x86\Debug - DEBUG;TRACE;SILVERLIGHT;WINDOWS_PHONE - true - true - prompt - 4 - - - pdbonly - true - Bin\x86\Release - TRACE;SILVERLIGHT;WINDOWS_PHONE - true - true - prompt - 4 - - - true - full - false - Bin\ARM\Debug - DEBUG;TRACE;SILVERLIGHT;WINDOWS_PHONE - true - true - prompt - 4 - - - pdbonly - true - Bin\ARM\Release - TRACE;SILVERLIGHT;WINDOWS_PHONE - true - true - prompt - 4 - - - - App.xaml - - - - MainPage.xaml - - - - True - True - AppResources.resx - - - - - Designer - MSBuild:Compile - - - Designer - MSBuild:Compile - - - - - - - Designer - - - - - - PreserveNewest - - - PreserveNewest - - - PreserveNewest - - - PreserveNewest - - - PreserveNewest - - - PreserveNewest - - - - - PublicResXFileCodeGenerator - AppResources.Designer.cs - - - - - ..\packages\Microsoft.Net.Http.2.2.18\lib\sl4-windowsphone71\System.Net.Http.dll - - - ..\packages\Microsoft.Net.Http.2.2.18\lib\sl4-windowsphone71\System.Net.Http.Extensions.dll - - - ..\packages\Microsoft.Net.Http.2.2.18\lib\sl4-windowsphone71\System.Net.Http.Primitives.dll - - - - - - - - - - - - \ No newline at end of file diff --git a/phoneClients/windowsPhone/GPSTracker/LocalizedStrings.cs b/phoneClients/windowsPhone/GPSTracker/LocalizedStrings.cs deleted file mode 100644 index ce17d86..0000000 --- a/phoneClients/windowsPhone/GPSTracker/LocalizedStrings.cs +++ /dev/null @@ -1,14 +0,0 @@ -using GPSTracker.Resources; - -namespace GPSTracker -{ - /// - /// Provides access to string resources. - /// - public class LocalizedStrings - { - private static AppResources _localizedResources = new AppResources(); - - public AppResources LocalizedResources { get { return _localizedResources; } } - } -} \ No newline at end of file diff --git a/phoneClients/windowsPhone/GPSTracker/MainPage.xaml b/phoneClients/windowsPhone/GPSTracker/MainPage.xaml deleted file mode 100644 index fdcf82a..0000000 --- a/phoneClients/windowsPhone/GPSTracker/MainPage.xaml +++ /dev/null @@ -1,89 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - -