Servers
Cell phone clients
There are 2 parts to the gps tracker application. The server and the clients. The server part needs to be installed on a public web server. It can be installed on a local machine and clients can be tested over wifi so strictly speaking, you do not need a public facing web server but for our purposes, we will assume you have one. There are 2 different server stacks:
- one for asp.net and sql server
- one for php and mysql
You do not need to install both. How do you choose which one to use? It’s personal preference, but if you work primarily on windows machines, it makes sense to install the asp.net version.
Asp.Net and Sql Server
The asp.net version requires you to install IIS (Internet Information Services 7 or greater) onto your machine and when you do install it, do not forget to install asp.net, you have to click a separate checkbox. Forgetting to install asp.net will result in a very interesting and hard to solve error… In IIS manager, right click on “Default Web Site” and create a new application named gpstracker and put all the files from the dotNet server directory that you downloaded and put it into that application. The application will probably be mapped to the physical directory C:\inetpub\wwwroot\gpstracker. Add files there.
You need to also install sql server. I used sql server express 2012 which is a free download. Once sql server in installed you need to do a restore. The file is in the servers > dotNet > sqlserver directory and is called gpstracker.bak. In the sql server management console, expand the System Databases and right click on one of the databases and go to Tasks > Restore > Database and restore GpsTracker bak file. Once that is done, your database is ready to go. Make sure to set a user name and password on that DB. I beleive that username “gpstracker” and password “gpstracker” are in that DB currently. Don’t forget to change that if you use the DB in production…
Download Visual Studio Express 2012 for Web and on the File menu, click “Open Web Site” and then choose local IIS on the left and then gpstracker on the right. I had to open visual studio as administrator for it to work right with IIS permissions. Now you can see all the website files. DisplayMap.aspx is the one that you want to view. Use visual studio to establish the connection with sql server (under Tools > Connect To Database). You can set DisplayMap.aspx as the start page and then run the application on the menu. That should get you going on the asp.net server.
PHP and MySql
For this, you need a LAMP stack or one of its derivatives (MAMP, WAMP etc). LAMP stands for linux, apache, mysql and php. You can download packages that will install all at once, just google lamp, mamp and wamp. They are all similar but just different based on the platform you have, windows, mac or linux. Once you have your server software installed, you need to create a website on your apache webserver and create a directory called gpstracker. Put all of the files from the php download directory into there.
From the command line, you need to do the following (windows users may need to install cygwin, which will give them a unix-like terminal prompt). Login in to MySql with this command:
mysql -h localhost -u root -proot_password
Change root_password to your root password and note that there is no space between the -p and your password.
and now from the mysql prompt, create the gps tracker database with this command:
CREATE DATABASE gpstracker;
and don’t forget the semi-colon ; at the end, all MySql commands must end in semi-colons. Now exit MySql with the following command:
exit;
Now lets get our data and stored procedures into the database using the following command:
mysql -h localhost -u root -p root_password gpstracker < gpstracker-03-14-14.sql;
Please note that the date on the sql file (03-14-14) may be more current. Use the most current from the github repo.
Now log back into MySql with the above command and switch to the gpstracker DB with this command:
use gpstracker;
and then have a look at your location records with this:
select * from gpslocations order by gpsLocationID desc limit 10;
Finally, create a user called gpstracker_user for the web application:
GRANT ALL PRIVILEGES ON gpstracker.* TO 'gpstracker_user'@'localhost' IDENTIFIED BY 'gpstracker’;
the final ‘gpstracker’ in parentheses is the password for gpstracker_user. You need to change that to your own password and then you need to change it also in dbconnect.php here:
$dbpass = 'gpstracker';
While you are in dbconnect.php, make sure that the database name is the same as the one you just created. If you are using phpMySql, the database name will probably be different.
and finally exit out of mysql with this:
exit;
Ok, at this point displaymap.php should work in your browser and you should be able to see the one location stored in the database.
At this point in time, you should have one of the two servers above installed. Now its time to look at the clients. There are currently 4 clients. One for android, ios, windows phone and java me/j2me. You only need one client but all four clients work with either server, this is a very flexible system. We’ll start with android since that is the one that people seem to be testing the most.
Android Cell Phones
You can get the android client in one of two ways now. If you do not need to customize the app, you can download it directly from google play and easily change the upload directory to point to your Gps Tracker website. It’s available here:
Gps Tracker in the Google Play Store
If you need to modify and compile the android client, that requires Android Studio.
http://developer.android.com/sdk/installing/studio.html
I urge android developers to start using Android Studio (AS) if you haven’t started already. Google has done an excellent job with AS, the gradle build system is excellent. After you install AS, open up the application by selecting import project (in the first popup window of Android Studio or on the File menu) and then selecting the build.gradle file in the GpsTracker > phoneClients > android directory. From the menu, select Tools > Android > SDK Manager. Select everything under Tools, Android 4.4.2 and Extras (down at the bottom). Then install those packages. In the next screen, click on the top Package on the left side, then on the right select “Accept License”, then click Install. This could take some time depending on your internet speed. Once this has completed, reopen the SDK Manager and make sure that the installs actually happened. It’s easy to mess this up if it’s your first time, so best to check. This hopefully should take care of gradle build issues that some people have been having. Finally, attach your android phone and make sure that its set up for development as explained here:
http://developer.android.com/tools/device.html
From the Android Studio Run menu, select Run to start the application on the phone. Enter a user name and then tap the tracking button. When you start tracking, the phone will send a gps location to the websmithing test website.
defaultUploadWebsite = "https://www.websmithing.com/gpstracker/updatelocation.php";
You can go to this webpage after you have run the app on the phone and find your location.
https://www.websmithing.com/gpstracker/displaymap.php
It’s a good idea to use the test page first because that let’s you know later on when you try to use your own server whether its the phone that is not working or the server that is not working. Once you have confirmed that the phone works with websmithing’s displaymap page, the it’s time to change the upload website to one of the servers you created above. Just change the server url text field when you start the application and then save it.
Ok, this should get you going on android, let’s turn our attention to iOS.
iOS Devices
Getting your iOS device working requires xcode. Xcode can be found in the app store here:
https://itunes.apple.com/us/app/xcode/id497799835?mt=12
This project uses AFNetworking, a popular http library. I decided to use it because it has a method to easily convert a dictionary of strings into the required format needed for sending a post request and also it automatically handles making http calls in a background task. Well worth the effort of installing it. So, to install it, you need to install cocoapods, which is a dependency manager (java users think maven…) more or less. Here are instructions on installing cocoapods:
http://guides.cocoapods.org/using/getting-started.html
Once you have that installed, go to the phoneClients > ios directory (where the Podfile is located) and from the command prompt run the following command:
pod install
To open the project, you need to click on the GpsTracker.xcworkspace icon, not the normal GpsTracker.xcodeproj. This is to make sure AFNetworking loads properly. When you start xcode, it may ask you if you want to enter developer mode, select yes.
Plug in your phone and in the upper left hand corner, make sure it is selected from the drop down box. As with the Android device above, you can test the application with the websmithing displaymap test page. When you have confirmed that the app is working with websmithing, change defaultUploadWebsite on line 181 of WSViewController.m to point to your web server that you have set up above.
Windows Phone
The windows phone app can be opened with Visual Studio Express 2012 for Windows Phone.
http://msdn.microsoft.com/en-us/library/windowsphone/develop/ff630878(v=vs.105).aspx
With windows phone, you need to register your phone for development. Microsoft explains how to do it here:
http://msdn.microsoft.com/en-us/library/windowsphone/develop/ff769508(v=vs.105).aspx
Make sure your phone is unlocked and then install the app on the phone. After you have tested the phone with the websmithing displaymap page, you can point the phone to your own webserver by changing defaultUploadWebsite on line 77 of MainPage.xaml.cs. Don’t forget to change line 87, phonenumber, to something other than windowsPhoneUser. It will help you in testing.
Java Me / J2Me Phones
This is what Gps Tracker was originally written for. Before iPhone and android came out, most phones were j2me phones. The reason why I continue to support these old phones is because there is a possibility that there are still more of these (mostly inexpensive) phones still being used than there are android phones! Android may not be the mostly widely used mobile platform! Android may not be the mostly widely used mobile platform according to Fortune magazine. So I continue to support it.
To work with the java me application, I used Netbeans version 7.4 on Windows. I ended up installing it in my windows 8 virtualbox. I tried running it on my macbook pro but had some real problems with it. It was easier to run it in virtualbox. Anyway, here is the netbeans download:
https://netbeans.org/downloads/
I only tested the app out in the browser because I did not have one of those older phones easily available. But in essence, you created a .jad file and install that on the java me phone. You can even email the file to your phone and open that up on the phone.
Now that I have finished this quick guide, I will be writing more in depth tutorials for each of the servers and clients. They will be coming soon!

HI,
first off this is great work. Having said that I cannot seem to get displaymap.php to display anything. The page loads without any errors but no map and no data. On another project I do indeed use google maps so I do have some intermediate experience.
The files are uploaded on a shared host
I have checked dbconnect and it looks like this:
$dbuser = ‘my dbname’;
$dbpass = ‘my dbpass’;
$params = array(PDO::ATTR_ERRMODE => PDO::ERRMODE_EXCEPTION,
PDO::ATTR_DEFAULT_FETCH_MODE => PDO::FETCH_ASSOC);
$pdo = new PDO(‘mysql:host=sql306.byethostXX.com;dbname=my dbname;charset=utf8’, $dbuser, $dbpass, $params);
and seems to be correct (some letters changed for security)
One point is that importing the database with phpadmin there is an error but the table still seems to load… though I am not sure if the error is serious or missing date.
This is the error:
IMPORT ERROR
SQL query:
/*!40101 SET character_set_client = @saved_cs_client */;
MySQL said: Documentation
#1231 – Variable ‘character_set_client’ can’t be set to the value of ‘NULL’
I have tried checking if file paths are a problem but I can’t see anything obvious
I have not included a URL here because I am working for a client, but maybe that might not be necessary.
Any help would be most greatly appreciated.
Hey Duncan
Can you please give me the URL of displaymap.php and also, can you please check the table names that have been created. I’ve heard that phpadmin can create its own table names different than one you think is being created.
n
Thank you Nick for a fast response. The URL is posted above.
I have gone through the tutorials and deleted the lines as suggested, and re uploaded the database and tried running the MySql by hand as suggested but the problem remains the same. The page loads but no data and no errors. Kinda scratching my head on where to look next.
Many thanks in advance
Hi again Nick,
to follow up I done lots more checking and this is what I have found:
The file structure is correct, and displaymap.php finds all its js files and css files but since displaymap.php does not call dbconnect.php there are no errors – in fact I can delete dbconnect.php completely and everything stays the same because displaymap.php is just a html page and displays correctly. I cannot in fact see any call to dbconnect.php being made from displaymap..
getroutes.php does the same – with the dbconnect.php file deleted getroutes does not display any error which is strange because the command should throw out an error if that file is missing.
Without error notices it kinda makes things harder to figure out, but in effect my opinion at this moment is that since dbconnect is not being called anywhere from any of the files then no database connection can be established – thus the empty displaymap page.
Hi,
maybe I got something to work with.
I have created a new free account on Awardspace, (http://gps.mypressonline.com/displaymap.php) uploaded all new files from github to the root (no gpstracker folder this time), created a new database, took the steps exactly as outlined in the tutorials, and guess what – exactly the same problem as my other website URL – the displaymap.php is working but does not display any data.
I have double checked db name, db pass, db user, and especially db host, but cannot see anything wrong – if I create another database that isn’t gpstracker such as WordPress or Coppermine then I can connect with those same credentials that I am using in dbconnect.php.
Could it be that gpsracker only accepts “localhost” as dbhost?
Since this new account on Awardspace is a test account I can send you the name and password to see whats going on, but I guess it would not be a good idea to print them here where others might abuse it.
Let me know what you think
Hey Duncan
The way to test if you are getting data to displaymap.php is to first check this url:
http://bestdestinos.66ghz.com/gpstracker/getroutes.php
That should provide the json data to the map but it doesn’t. Can you please login to your phpadmin and run the following query and tell me what happens.
SELECT * FROM gpslocations;
n
Hi all,
next step following an idea from Nick was this:
run this mysql command:
SELECT * FROM gpslocations;
the results showed that the table, while existing was empty.
So next I copied this part from the original database file from github
and ran the following mysql commands:
INSERT INTO `gpslocations` VALUES (1,’2007-01-03 19:37:00′,47.627327,-122.325691,’gpsTracker3′,’gpsTracker3′,’8BA21D90-3F90-407F-BAAE-800B04B1F5EB’,0,0,0.0,’2007-01-03 19:37:00′,’na’,137,’na’,’gpsTracker’),(2,’2007-01-03 19:38:00′,47.607258,-122.330077,’gpsTracker3′,’gpsTracker3′,’8BA21D90-3F90-407F-BAAE-800B04B1F5EB’,0,0,0.0,’2007-01-03 19:38:00′,’na’,137,’na’,’gpsTracker’),(3,’2007-01-03 19:39:00′,47.601703,-122.324670,’gpsTracker3′,’gpsTracker3′,’8BA21D90-3F90-407F-BAAE-800B04B1F5EB’,0,0,0.0,’2007-01-03 19:39:00′,’na’,137,’na’,’gpsTracker’),(4,’0000-00-00 00:00:00′,47.593757,-122.195074,’gpsTracker2′,’gpsTracker2′,’8BA21D90-3F90-407F-BAAE-800B04B1F5EC’,0,0,0.0,’2007-01-03 19:40:00′,’na’,137,’na’,’gpsTracker’),(5,’2007-01-03 19:41:00′,47.601397,-122.190353,’gpsTracker2′,’gpsTracker2′,’8BA21D90-3F90-407F-BAAE-800B04B1F5EC’,0,0,0.0,’2007-01-03 19:41:00′,’na’,137,’na’,’gpsTracker’),(6,’2007-01-03 19:42:00′,47.610020,-122.190697,’gpsTracker2′,’gpsTracker2′,’8BA21D90-3F90-407F-BAAE-800B04B1F5EC’,0,0,0.0,’2007-01-03 19:42:00′,’na’,137,’na’,’gpsTracker’),(7,’2007-01-03 19:43:00′,47.636631,-122.214558,’gpsTracker1′,’gpsTracker1′,’8BA21D90-3F90-407F-BAAE-800B04B1F5ED’,0,0,0.0,’2007-01-03 19:43:00′,’na’,137,’na’,’gpsTracker’),(8,’2007-01-03 19:44:00′,47.637961,-122.201769,’gpsTracker1′,’gpsTracker1′,’8BA21D90-3F90-407F-BAAE-800B04B1F5ED’,0,0,0.0,’2007-01-03 19:44:00′,’na’,137,’na’,’gpsTracker’),(9,’2007-01-03 19:45:00′,47.642935,-122.209579,’gpsTracker1′,’gpsTracker1′,’8BA21D90-3F90-407F-BAAE-800B04B1F5ED’,0,0,0.0,’2007-01-03 19:45:00′,’na’,137,’na’,’gpsTracker’);
Next I run the first command again and that did show that the database now has data:
SELECT * FROM gpslocations;
I wont print the output here but it show geo data from 2007 which I guess are some of the example data sets
However displaymap.php still shows up as before without any maps or data….
But anyway perhaps step by step we are closing in on the problem
Nick I tried another suggestion from you on my test website using getroutes.php instead of displaymap.php and that does throw out an error and whoops “big security prob” – it also prints out my user name and password – luckily this doesn’t happen on my main website which does not show any errors… anyways this is the error with my details edited…
Fatal error: Uncaught exception ‘PDOException’ with message ‘SQLSTATE[HY000] [2003] Can’t connect to MySQL server on ‘gps.mypressonline.com’ (111)’ in /srv/disk2/YYYYYY/www/gps.mypressonline.com/dbconnect.php:8 Stack trace: #0 /srv/disk2/YYYYYY/www/gps.mypressonline.com/dbconnect.php(8): PDO->__construct(‘mysql:host=gps….’, ‘YYYYYY’, ‘ZZZZZZ’, Array) #1 /srv/disk2/YYYYYY/www/gps.mypressonline.com/getroutes.php(2): include(‘/srv/disk2/YYYYYY’) #2 {main} thrown in /srv/disk2/YYYYYY/www/gps.mypressonline.com/dbconnect.php on line 8
These letters replace my real dbusername and dbpassword
YYYYYY = dbusername and ZZZZZZ is dbuserpassword
Since most of the success stories here seem to be computers running Wamp with “localhost” and most of the failures seem to be on shared servers that don’t use names like “localhost” I get the feeling this is what is happening in my case. I am glad Nick switched to $GET instead of $POST because most shared and free web host definitely have $POST disabled to control email abuse.
Still, there must be a solution and so onward one step at a time 😀
Duncan
As far as I can tell, the credentials you are trying to connect with are not correct. Have you tried using the same username and password and what you use for phpmyadmin?
n
Hi Nick,
yes you are correct, the credentials are were not correct (but they are now) which gives me a chance to explain why for others that might find the same situation.
If you go to this url now http://gps.mypressonline.com/displaymap.php you will see the output of the database connection at the top left . One is with the mysql_connect and the other connecting with PDO. They are both now connected.
Awardspace as many other web hosts have their own way of doing things – when you sign up you are given a username eg “12345” with your own password. Your ftp name is the same name as your website.
When you create a database it’s name consists of your name_ and the name of the database eg: 12345_gps – however what Awardspace don’t tell you is that your database username is NOT your username – your database username is now the same name as your database, so we have this:
username = 12345
database username = 12345_gps
database name = 12345_gps
On my other website server they don’t do it that way, username and database username are the same!
So thats the first point – check these names well
Next, point is hostname. On my other server database hostname and ftp name are the same. On Awardspace they are not…
On Awardspace as mentioned, ftp is the name of your website, and the database hostname is a different name and also Awardspace insist that PORT number is used.
Adding the database hostname with PORT number to mysql_select worked, but adding it to PDO:: didn’t and threw out that huge exception that I wrote in a previous post. So in the end I dropped PORT from database hostname in the PDO:: statement and it worked. So this with the database username issue were the reasons why I wasn’t getting a database connection. Other servers / hosts do things differently and this is where one needs to pay attention in the code requirements to connect to a database.
As an aside Nick, it might be a good idea to catch that PDO:: exception with a little bit of code to cause it to print out a more readable connection error message and not print out all those details which include the username and password as in the example I put in a previews post. I have added that code in my own dbconnect.php to prevent that from happening in the future
So I hope I have made some useful points here that might help others in a similar situation.
So http://gps.mypressonline.com/displaymap.php is still empty, but the map section does turn to blue, so obviously there is now a database connection but no data. http://gps.mypressonline.com/getroutes.php confirms this by displaying the message { “routes”: [] }
The database does have data which appears to be routes but maybe it is still missing something, perhaps you can take a quick look Nick. Here is a brief example.
GPSLocationID lastUpdate latitude longitude phoneNumber userName sessionID speed direction distance gpsTime locationMethod accuracy extraInfo eventType
Edit Edit Edit Inline Edit Copy Copy Delete Delete 1 2007-01-03 19:37:00 47.6273270 -122.3256910 gpsTracker3 gpsTracker3 8BA21D90-3F90-407F-BAAE-800B04B1F5EB 0 0 0.0 2007-01-03 19:37:00 na 137 na gpsTracker
Edit Edit Edit Inline Edit Copy Copy Delete Delete 2 2007-01-03 19:38:00 47.6072580 -122.3300770 gpsTracker3 gpsTracker3 8BA21D90-3F90-407F-BAAE-800B04B1F5EB 0 0 0.0 2007-01-03 19:38:00 na 137 na
Thank you for your time and patience Nick, we are getting there 😀
Hey Duncan
Can you please run the following query from phpadmin and let me know what the result is.
CALL prcGetAllRoutesForMap();n
Hey Duncan can you help me with the code please!
Hi,
How can I add the current location of the users to the map? so I can see my location and the truck location on the map. Thank you
Nick,,,hey, please delete my above comment, yes I am on the map now but it took over an hour to appear…… but yay… this isway cool…
Hey Duncan
Glad to hear you got it working. That is odd that it took an hour to see an update on the map. It should be happening immediately. Do you have some caching software turned on?
n
That is happening also to me on the WP version. If I deactivate Locations on cellphone, when I reactivate/ restart everything, it takes up to 1 hour to see results on map.
Hi Nick,
yes I can say with confidence that your code / script has performed perfectly. I think the hour waiting for the first time to connect might be the result of caching by Google’s data systems, but once connected the gps tracking is immediate and responsive.
I have now changed the Android app url to point to my test website as follows:
http://gps.mypressonline.com/gpstracker/displaymap.php
and have waited overnight but there is no connection it seems. I know the telephone and app are working because they connected on your displaymap.php test page, so this tells me that the issue is with my hosting server at Awardspace.
If I run getroutes.php on my test site I get what I assume is the correct response which is this:
{ “routes”: [{ “sessionID”: “8BA21D90-3F90-407F-BAAE-800B04B1F5ED”, “userName”: “gpsTracker1”, “times”: “(Jan 3 2007 07:43PM – Jan 3 2007 07:45PM)” },{ “sessionID”: “8BA21D90-3F90-407F-BAAE-800B04B1F5EC”, “userName”: “gpsTracker2”, “times”: “(Jan 3 2007 07:40PM – Jan 3 2007 07:42PM)” }] }
I have also deleted one entry from the displaymap.php “Delete Route” button so clearly the database connection is correct and working,
The first point I noctice is that your url for your test page is https:// but mine is just http://… would that make a difference?
The second point is that your domain is TLD (Top Level Domain for others reading this) but mine is essentially a sub domain because it is on a shared host, might this be the cause of no connection?
If not these points then my only other thought is that my host server has some element blocked or disabled, as is typical with many shared hosts, although there are no errors or advice being echoed.
I am wondering if you might have an idea of where to look to find a solution for this issue.
Again many thanks in advance for your time and excellent work!
Duncan
Here is the url you need in your phone to update your gps tracker:
http://gps.mypressonline.com/gpstracker/updatelocation.php?longitude=-122.0214996&latitude=47.4758847&extrainfo=0&username=momo&distance=0.012262854&date=2014-09-16%2B17%253A49%253A57&direction=0&accuracy=65&phonenumber=867-5309&eventtype=android&sessionid=0a6dfd74-df4d-466e-b1b8-23234ef57512&speed=0&locationmethod=fused
I just tried it and it works fine. Take a look at the url you are putting into your phone.
n
Hey Nick,
wonderful, that certainly did the trick. GPS is now running perfectly, and I must say for others reading through my comments that ALL the issues were our own, and not Nicks code which has performed flawlessly at all times.
A most impressive project Nick. Thankyou, We will also be saying thankyou with a donation shortly.
Thank you Duncan.
n
The Android app save the locations when gsm connections is unavailable to send it later?
Jordan
Currently it does not. There are a couple of ways to do that. You can either create a queue in memory and remove items from the queue when you have made a confirmed delivery of the gps data to the website or you can store the data in sqlite if you need it to be 100% reliable.
n
Is there a Win Phone app in the store by Microsoft?
If so, please provide a URL
Hey Tom
No, there is not one in the win app store. The vast majority of people use android so I keep one in Google Play. I just rarely get asked for windows phone. I would be willing to put a copy into the windows store in exchange for one day of labor.
Nick
Thanks for response
It is quite ok with you atitude about this… I just work further on my own from here.
I startede yesterday with a ISO image of Ubuntu V14 LTS and now today the serverside is running on the Ubuntu as a dream…. And I am able to get data into the system by hand. It was my first home project !! exiting!!
Next step is to get Android up running in my sandbox. I can not wait 😉
Very cool, let me know how it goes.
n
Thanks for the great work and for this article! This is exactly what I needed for my app and you saved me a ton of hours! The code worked out of the box!! I have one question, if you don’t mind. I’d like to persist the response of PHP calls and use it to further extend your app. Initially I thought I could just add the following lines to the onSuccess() method inside the LoopjHttpClient.get() call and save the PHP response but then I realized it’s an async call and therefore it’s running in a different context. I’m fairly new to Android/Java development. Could you give me some pointers as to how to do that?
SharedPreferences sharedPreferences = this.getSharedPreferences(“com.websmithing.gpstracker.prefs”, Context.MODE_PRIVATE);
SharedPreferences.Editor editor = sharedPreferences.edit();
Mikey
I don’t know what “persist the response of php calls” means. Can you please explain it a little further.
n
Sorry to sound like a dope but I can only find 5 (not 6) stored procedures to add through the advice on your mysql page. I have, prcDeleteRoute , prcGetAllRoutesForMap, prcGetRouteForMap, prcGetRoutes and prcSaveGPSLocation. What am I missing? Great piece of kit btw.
tomas
Hey tomas
Thanks. I think that sounds like all of them. Where did you read six from?
n
I got six from https://www.websmithing.com/category/mysql/ where it says “Do this for each of the stored procedures (total of 6) and you’re almost done. ” I think my problem may be elsewhere though as I’m getting a “Fatal error: Class ‘PDO’ not found” error.
tomas
tomas
create a file called phpinfo.php and inside the file put this:
Run this on your server and search the page for PDO. If it’s not there then google install PDO and make sure it’s installed.
n
It’s mentioned three times in the configure command section. The error seems to be coming from line 5 of dbconnect.php.
tomas
2 questions. Did you create the gps tracker user in the database and give it the proper permissions? And also, what is the url of your displaymap.php page?
n
I did and have just checked it again. The url is http://noki.me/gg/displaymap.php
tomas
Cooking now. I had to add:
extension=pdo.so
extension=pdo_sqlite.so
extension=pdo_mysql.so
extension=sqlite.so
to a php.ini file and from there I got an error I could understand. Setting up client now. Nick i can’t thank you enough for your time. It’s to be hoped I can through some work your way.
tomas
Glad you got it working tomas.
n
Did anyone use this with Mapbox? Any examples out there?
Hey Stijn
You can use mapbox by adding the mapbox tile provider to the maps.js file. Here is the code to do that:
// create a tile layer sourced from mapbox/{z}/{x}/{y}.png?access_token= ‘).addTo(map);
L.tileLayer(‘https://{s}.tiles.mapbox.com/v4/
https://www.mapbox.com/help/mapbox-with-leaflet/
n
That is just great! Thanks again for your help.
Last question.. Do you know if it is possible to display the markers/lines that are on the mapbox map?
This leaflet quick start guide shows how to do markers and lines:
http://leafletjs.com/examples/quick-start.html
n
It’s working great. Two things I am still looking at:
– only display actual location of device (or give different location to active location, changing it in the .js doesn’t seem to work stable)
– give different icon’s to devices. I want to track 2-4 vehicles and would like to give them a different icon on the map. I know how to change the icon, but then it changes for all the icons.
Hey Stijn
For the first item, what needs to be done is to have 2 stored procedures, one that inserts a new gps row in the table and one that updates it with new gps data. This update procedure is already there but the insert needs to be built. The first time the phone connects to the DB, create a new row. Every time after that, just update the row with new coordinates.
The second one requires work in maps.js. You’ll first need 10 or 20 icons depending on how many phones you have and number them 1 to 20. When markers are being created in mpas.js a counter is passed to the method that creates markers. Simply use this counter to create marker icons 1.png, 2.png, 3.png etc. The only caveat is to remember to always have more icons than vehicles…
n
Thanks for the detailed reply. This exceeds my technical abilities. I reckon you would charge a day to implement this?
Thanks
Yes, those two things would be a day’s worth of labor for me.
n
Another way to do it is to create another database view (or stored procedure/function) to just return the last reported position (using a sub-select based on the device name). Here’s my view (it returns geoJSON) from my Postgresql database:
CREATE OR REPLACE VIEW v_currentpositions_geojson AS
SELECT (((((((‘{“type”: “Feature”, “properties”: {“username”:”‘::text || gpslocations.username::text) || ‘”, “gpstime”:”‘::text) || gpslocations.gpstime) || ‘”},”geometry”:{ “type”: “Point”, “coordinates”: [‘::text) || gpslocations.longitude) || ‘,’::text) || gpslocations.latitude) || ‘]}}’::text AS geojson
FROM gpslocations, ( SELECT max(gpslocations.gpslocationid) AS currentid, gpslocations.username
FROM gpslocations
GROUP BY gpslocations.username) currentlocation
WHERE gpslocations.gpslocationid = currentlocation.currentid;
And you would need a little PHP to wrap the returned records, and some JavaScript to make it accessible from the web mapping page.
HI Nick,
I really appreciate your work, but i’m facing few problems. I’m not able to view the maps and also not able to see the route as a drop down list. Kindly help me as soon as possible
Thanks in advance.
Hey Nick….I’m clear with my issue! Please don’t mind
Hi Nick,
After download your application and set it up into my web server, now can open the website already. However, as for my android phone, I found the upload directory need uploadlocation.php but I didn’t found this file in your application. Please advice any solution to upload my location info into my web server?
Thanks much.
Hey
I’m not sure what you downloaded, it’s right here:
https://github.com/nickfox/GpsTracker/blob/master/servers/php/updatelocation.php
n
I’m interested in using GpsTracker with PostgreSQL. Have you done any work to that end?
Hey Brent
I haven’t ported gpstracker over to postgres but I think it would be trivial. I have 2 database versions, mysql and sql server. I’m not sure which version of sql postgres uses so a little tweaking may be necessary but it will work.
n
I also looked into using SQLite as the database, but it does not [easily] support procedures/functions.
Moving the MySQL Procedures to PostgreSQL Functions is causing me some pain (I’ve never written Functions before). I may just change them the Views, but prcGetRoutes may not easily convert to a View. Do you have the SQL for the SQLServer version?
Thanks!
The only way to get the sql server version that I can think of is to install the db and then export the procedures as script.
n
I changed some of the Procedures to Views:
v_GetAllRoutesForMap
v_GetRouteForMap
v_GetRoutes
but left two as procedures/functions:
prcSaveGPSLocation
prcDeleteRoute
(and made a couple of minor changes to the PHP).
So far so good, the sample data seems to work with PostgreSQL.
Now to test with data inserts from Android!
Excellent. Brent, I have a question for you. Would you consider writing a very small post explaining what you did and letting me put your source code (non-proprietary) into GpsTracker? I think it would be incredibly useful to others working with postgres.
thanks
n
Hi Brent,
It would be great if you share this code to work with PostgreSQL.
If not, Nick, are you thinking about doing this port for PostgreSQL?
Just to send the data to PostgreSQL (forgetting the part of data visualization on the leaflet application), instead of MySQL, many changes are needed?
Thank you very much for this great software Nick!
All the best!
Pedro,
Nick has asked me to do a write-up on using the PostgreSQL (and now SQLite!) databases, but it will be another week or so until I can get to it.
Bren t
Hi Brent,
Great! I’ll wait for that write-up and the port for postgresql!
In the meantime, I’ve changed the updatelocation.php for a simple INSERT INTO query to a PostgreSQL DB, and it works without problems!
I do not know if this also happens to others, but the “speed” and “direction” fields are almost always zero. Any reason for that? I’ve tested on a nexus 4 and on a galaxy young (android 5.0.1 and 4.1.2, respectively).
Another question, which the “distance” column means/represents and how is it obtained?
Thank you very much!
Best regards!
Pedro
Hey Pedro
I’ll answer the questions not related to postgres. If you want to see speed and direction, start gps tracker and take it out for a drive in your car or a bike or something. direction is actually bearing in degrees from magnetic north (0 – 360 degrees). Distance is the total distance you have traveled in a session. Look at the location service class and watch the variable called totalDistanceInMeters.
https://github.com/nickfox/GpsTracker/blob/master/phoneClients/android/app/src/main/java/com/websmithing/gpstracker/LocationService.java
n
Hi Nick,
Thank you very much for your answer! I’ve been watching your video on youtube and I already understand how it works! Perfect!
I have also seen that everything is working well with speed, direction and distance!
So, the parameters are recorded in the following units, right?
“speed” -> Miles Per Hour
“direction” -> Degrees
“distance” -> Miles
“accuracy” -> Feet
“extrainfo” (Altitude) -> Feet
I use the metric system, but knowing this, it is very simple to create some triggers in the database to make the conversion!
Thank you very much Nick! Great App!
Best regards,
Pedro
hope you can help me, it looks like i’m not able to create the procedures im using godaddy mysql database, but when i run the query is asking me to be superuser, thank you for your help in advance
Nick please disregard last comment i got procedures built, the problem i have now is my android is not sending data to the server, any ideas?
Roberto,
The best way to troubleshoot this problem is to first identify where the problem is. Is it on the phone or the server? Send this string to your server and see what happens. Don’t forget to change https to http if you don’t have ssl.
https://www.websmithing.com/gpstracker/UpdateLocation.aspx?longitude=-122.0214996&latitude=47.4758847&extrainfo=0&username=momo&distance=0.012262854&date=2014-09-16%2B17%253A49%253A57&direction=0&accuracy=65&phonenumber=867-5309&eventtype=android&sessionid=0a6dfd74-df4d-466e-b1b8-23234ef57512&speed=0&locationmethod=fused
n
Nick, thank you for the quick reply, i got it t work, awesome job on this by the way, i have a quick question, will it take to much scripting to be able to see bird eye view? have you try Geofence?
Hey Roberto
Good to hear you got it working. I don’t know if you can create a bird’s eye view with leaflet. I did a quick google but didn’t see anything. I found this for geofences but haven’t tried it.
https://github.com/psiborg/Geofence
m
anyway to install this without “root” priviliages to mysql?
You need a mysql user that has privileges to create tables and stored procedures. The question is to open-ended to answer in more detail…
n
Nick had you tested or know where i could find information about sending GPS thru UDP and parsing datagram into your updatelocation.php?
Hey Roberto
I’ve never considered using UDP. I can’t think of a reason to do so. I did a quick little google and found lots of android examples using DatagramSocket and php samples using socket_create or something similar. I have to ask, why do you need UDP?
n
Hi NICK first of all thanks for very useful project.
I am using this project in asp.net and sql server.
The problem is i was not receiving any data from the play store app to the application.
i followed all the instructions you have posted in web site kindly help me.
Hey Mohan
Two questions. 1) are you able to see your phone on websmithing’s test website and 2) what is the url of your website’s display map.
n
http://10.0.0.13/GpsTracker-v4.0.3/GpsTracker/servers/dotNet/DisplayMap.aspx this is my URL and my phone is not showing in websmithing web site
You need to first figure out why your phone is not working on the websmithing site. Either location is turned off or you are inside a building or something. Get a friend’s phone and try that also.
And also, you need to have a public website…
n
Does your software require all cell phones involve to download the apps?
In other words, if I want to investigate, does this software works on my phone by only entering the cell phone number…..
I’ll answer for Nick (the expert). Yes, any phone you want to track must have the GpsTracker App installed (and enabled). The phone must have a route to the Internet, either by a data connection via the phone company, or via WiFi (although WiFi might not be too practical) as position reporting is done via a http GET request from the phone to your web server.
Best Regards,
Brent Fraser
Hey Nick,
I have completed this project in Eclipse SDK.
after running project on emulator first activity runs, if we put user name and website and start tracking on then after some time a popup is generate and shows message “Unfortunately google map gps cell phone tracker” has stopped.
we have done all the process according to you. can you tell me what should I do to remove this unexpected error…
Or what causes to generate this type of error..
Hey Neeraj
The android project is an android studio project, not eclipse. Google recommends switching to android studio. I happily quit using eclipse years ago and would be even happier to see it go away for good.
n
Hey Nick
Actually I am working on ” adt-bundle-windows-x86_64-20140702 “. and I have made my project on it. can you tell me is it similar to android studio, and what change should I do for proper running my project.
Neeraj
I have no idea what you are doing. What is adt-bundle-windows-x86_64-20140702 supposed to be?
n
I’m sorry to disturb you. I have installed cocoapods and found Afnnetworking on my iOS device but … I don’t understand now what I have to do to make gps tracker work?
Hey Rob
Can I get a little more detail. Is the application running on your iphone? Are you seeing error messages?
n
Hi Nick:
Do you have a client side package for iphone available in Apple App Store?
Best regards
Frank
Hey Frank
Unfortunately I do not and I wish I did. The problem is that gps tracker is too generic and limited in its scope. It only does one thing, which is send tracking data to a website and apple feels that is not enough functionality to justify being in the app store. And really it’s kind of stupid because there are tons of people who need only that.
You have a few options. The first is to build an app with more functionality. The second option is to not put your app into the app store but to use TestFlight beta (in itunes connect) and send out your app to users (up to 1000 beta testers). But I believe that apps in TestFlight may expire after a month. This may be suitable for people who have one off events. A third option is to buy a corporate developer’s account with apple ($500). That way you can distribute your own apps to your company and circumvent a lot of the onerous restrictions that apple places on the normal distribution channel. The problem with this third option is that companies seeking to get a corporate account must have a registered DUNS number. So, the short answer is no, and I hope the long answer has helped a little.
n
I’ve found two iOS apps that can send location data using GET to a custom url: SendLoc and SensorLog (where SensorLog at this point is most up to date, and has some additional nice features).
I simply made a copy of updatelocation.php and tweaked it to translate the iOS time/lon/lat/…/-key:values sent from SensorLog to match GpsTracker input. For example:
$latitude = isset($_GET['locationLatitude']) ? $_GET['locationLatitude'] : '0';Works great for the simple needs!
Links… sorry:
SensorLog: https://itunes.apple.com/us/app/sensorlog/id388014573?mt=8
SendLocation (not
SendLoc!): https://itunes.apple.com/us/app/sendlocation/id377724446?mt=8Thank you Daniel. That’s very helpful. I might try again to get gps tracker into itunes.
Nick
Hello,
Great work, I wanted to know weather this will work for GPS tracking devices with ?
If not can you suggest me a device and software for all devices for cheap?
Thank you,
I think it will work but to be sure I would need to test it. I have been asked this question many times but no one ever takes me up on the offer. If you want me to test it then order one and send it to my house. I will test it and blog about my results. If there is a solution, I will put the source code on github. If you are interested in getting me one, do it quickly. I just sold my house and I am leaving this property on June 30th.
n
Nick and Rammohan,
I’ve got one of these (search for “TK 102” for lots of info on them here’s a manual http://p.globalsources.com/IMAGES/PDT/SPEC/358/K1079269358.pdf), and no ,they would not be plug-and-play with Gps Tracker. There are lots of clones by different manufacturers but most can communicate in two ways: SMS text message (containing lat,lon) to a specified phone number, or they can use the phone’s data network to open a TCP port at user specified server (I’ve been unable to get this to work as the conversation is non-trivial and varies slightly by manufacturer). And here’s some server-side code (javascript!): https://github.com/fvdm/nodejs-tk102
Brent Fraser
Here’s a site with more info http://www.buildproject.dk/index.php/projects/completed/17-configuring-a-tk102-gps-tracker-to-work-online
Hi Nick Fox ….. can you please share the asp net project … i want to add the login page and search option in you project …. i need this project desperately every thing is working fine i just want to try add few more option in asp net project ….. i am just a student other wise i would had hire you …….. i just brought u a coffee …. please check your PayPal … if you can add some more option for me i can buy you a bear !!
thank you … for your beautiful project ….
Hey Richard, thanks for the donation, it was very kind of you. Here is the .net project:
https://github.com/nickfox/GpsTracker/tree/master/servers/dotNet
n
thanks … i think this is the compiled project … do you have the Visual Studio project so i can modify it … ? or can you add the login page … and search option(search by UserID) in you project file … so when ever user visits the gps tracker site user have to login in order to view it … for security purpose ……. Search option is more convenient if u have lot of user ….. so easy just filter by particular User
i can hire you for this 🙂 just drop me a mail
Hey Richard, this is not a compiled project (web application) and there are no project files. This is a web site. You can read about the difference here:
http://stackoverflow.com/questions/398037/asp-net-web-site-or-asp-net-web-application
you can see how to open this website with visual studio here on my tutorial:
https://www.websmithing.com/2014/01/20/quick-start-guide-for-gpstracker-3/#aspnetserver
my email is on my “hire me” page if you would like to hire me. I’m in the middle of selling my house right now and I’m super distracted but drop me an email and I will see if I have time.
Brent, any suggestions on an authentication system for this? It would be nice to implement a solution that integrates with both platforms (.net and php).
n
thanks … i have successfully implemented php login system with your project …working well …
Nick,
Typically a security system would be:
– credentials (username, password) are stored in a database
– user logs in using a login page
– scripting (PHP, .net, etc) checks the login values against the database and sets a session variable
– all other scripts responsible for sending content check the session variable
Best Regards,
Brent
How to set standard zoom level in maps?
Hey Susanto
The zoom levels are currently set using leaflet’s fitBounds method in lines 214 and 215. This looks at all of the markers and determines the best fit so that all markers are viewable on the map. Leaflet also has a setZoom method to programmatically set the zoom.
n
https://github.com/nickfox/GpsTracker/blob/master/servers/php/js/maps.js
Hello … first of all, great job and very well explained. I wonder if you know how to adapt it to a Drupal site?
I haven’t used drupal in so many years, not really sure how to adapt it but I bet it could be done.
n
hello nick, great job. however my phone isn’t displaying on your test website. and id also like to set it up on my own domain. kindly break it down for me step by step. i want to use php and mysql. i’d appreciate it.
Hi, here are the setup instructions. If you cannot figure it out from the written instructions, then you can go to my hire me page and I will set it up for $400.
https://www.websmithing.com/2014/01/20/quick-start-guide-for-gpstracker-3/#phpserver
If you are not able to see your phone on my test webpage, then you need to go outside and away from tall buildings and trees. It’s used by lots of people and I know it’s working correctly on my end.
n
Hi Nick, great project . You must be a genius. I set everything up and it works effortlessly. So i was wondering which components in the client and server side i should edit in order to display more info when i click on the pointer. Basically i want to display more info other than just the speed, distance , username and accuracy. So far i have tried changing the layout to add more EditTexts, changed the GpsTracker.java , changed the LocationService , changed updatelocation.php , changed mysql file and changed the maps file in js folder but nothing’s changing. However when i manually put in the details in the db it displays the additional info i want. But i cant get it to work directly with the app. Kindly help. Thanks.
Hey Penny
Sorry for the delay. The place where you need to edit is in the file called maps.js. Lines 254-261. That is in a function called createMarker. createMarker is called for each row in a json file that is gotten from the database. Hope that helps.
https://github.com/nickfox/GpsTracker/blob/master/servers/php/js/maps.js
Nick
Hello Nick,
First of all I would like to say that you have made a great job. Everything is working perfectly and so straight forward.
I would like to ask if I could add polylines and no markers on the map. Do you think it is easy?
Thank you in advance,
John
Hey John
GpsTracker uses leaflet to display the map (and markers). This is done in the file called maps.js. That is where you can remove markers and add polylines if you wish. I don’t know exactly what you are doing, I assume you are trying to show a route on the map using polylines (like a route that google maps would use). It would not be terribly difficult but if you are not good at javascript, then it would take you quite some time. Here is how to draw a polyline with leaflet:
http://leafletjs.com/reference.html#polyline
n
Thank you Nick for your fast reply. You helped me very much.
Polylines are working into the map now and I’fixing several bugs.
Thank you again,
John
I forked the project on github and made the changes I have done to the maps.js file.
John
Hi,
Excellent tracker, worked in 1st attempt and already love it.
Is there any way to have the metrics such as speed/distance displayed in (kilo)meters instead of miles/feet etc?
Nico
Hey Nico
The easiest way to do it would be to modify maps.js. There is a loop that passes all of the coordinate information to a method that creates all the popups. Just do the conversion in that method and change the verbiage for the dimensions there also.
n
This Tutorial very helpful for me .. But i am trying to show all my contacts on Google Map Can you help me
Rehan
Only if you put tracking software on each of your contact’s phone. There is no other way.
n
Hi Nick,
I have installed everything on the server but when i try and view the page it doesnt work and it comes up as a broken image button. PLease help.
Hey Baljeet, can I please get the URL of your display map.
thanks
n
I cant send you the URL because its an in house system. But i can send you a link to the screenshot?
http://postimg.org/image/46kqml5ll/
please let me know if you cant see it.
Baljeet, it needs to be connected to the internet.
n
Hi Nick,
I have installed this on my sql server 2014 and using asp.net. I can see the webpage but the map does not render and in its place there is a broken image instead. how do I fix this?
Hi just get errors all the time with gradle
Error:(17, 0) Gradle DSL method not found: ‘runProguard()’
Possible causes:The project ‘android’ may be using a version of Gradle that does not contain the method.
Open Gradle wrapper fileThe build file may be missing a Gradle plugin.
Apply Gradle plugin
Try removing lines 17 and 18 and seeing if that helps. If not, then the project needs to be rebuilt from scratch and then adding classes.
https://github.com/nickfox/GpsTracker/blob/master/phoneClients/android/app/build.gradle
n
Nick,
Please check your sites server’s certificate
Chrome and Internet Explorer both report server certificate error
Cheers
JR
Thanks Jason. I bought the darn cert and it took me two weeks before I got enough motivation to reinstall it…
n
Hi Nick and everybody,
First great work Nick, awsome project.
I setup my server .NET and found that DisplayMap.aspx has no records in the list of routes although I can see in the SQL table some lines of demo users.
So I tried to test it in the browser with the address: http://localhost/gpstracker/UpdateLocation.aspx?longitude=-122.0214996&latitude=47.4758847&extrainfo=0&username=momo&distance=0.012262854&date=2014-09-16%2B17%253A49%253A57&direction=0&accuracy=65&phonenumber=867-5309&eventtype=android&sessionid=0a6dfd74-df4d-466e-b1b8-23234ef57512&speed=0&locationmethod=fused
But I got error 26 Error Locating Server/Instance Specified on Chrome.
Can you guys help me resolve this error? as I think the app cannot connect to the SQL server DB.
Thanks,
Ofir
Hey Ofir
You need to be on a server that is connected to the internet. That is the only way you are going to get google maps.
n
Hi Nick, thanks for your prompt help.
Sorry for duplicate msg, I want to clear again my issue so I wrote again.
Anyhow, I do have internet connection in this computer.
I just think that there is no SQL connection between the app and the SQL server.
OK, so I figured it out – I changed the SQL connection in the Web.comfig file as the credentials were incorrect, now map is alive and also the Updatelocation,aspx works good 🙂
Tried to update location both with URL and Android app and works like a cham!
Really really good work mate! Thank you very much.
Hey Nick,
I have one questions about the app data process.
I’m using the default Play store Android app and I noticed that once the GPS location service in my phone is turned OFF also the app is not sending the location on the specified interval – as only if drop down the widget menu on top and enable the GPS widget service.
How can I set that it will work also when GPS is OFF? As it should work as I’m using the fused method as I did not change the source code.
Thanks.
Ofir.
Hi Nick and everybody,
First great work Nick, awsome project.
I setup my server .NET and found that DisplayMap.aspx has no records in the list of routes and no map is shows, like Duncan issue, although I can see in the SQL table some lines of demo users.
So I tried to test it in the browser with the address: http://localhost/gpstracker/UpdateLocation.aspx?longitude=-122.0214996&latitude=47.4758847&extrainfo=0&username=momo&distance=0.012262854&date=2014-09-16%2B17%253A49%253A57&direction=0&accuracy=65&phonenumber=867-5309&eventtype=android&sessionid=0a6dfd74-df4d-466e-b1b8-23234ef57512&speed=0&locationmethod=fused
But I got error 26 Error Locating Server/Instance Specified on Chrome.
Can you guys help me resolve this error? as I think the app cannot connect to the SQL server DB, maybe user & pass is not correct. Please can you guide me into the settings of SQL?
Thank you for your kind help
Hello Nick,
i found your awesome project on google. then i downloaded your stuff and got it working fast and without any problems. but i have one after testing your app some times. if i do charge the phone the tracker is working awesome and updating all time the new location every 5 minutes. but if i disconnect the charge-cable. its stops the tracking and do it randomly like 10.60.71 minutes. if put the cable back it’s doing the job good, Do you have an idea what can lie?
It would be very nice of you if you can help me. I love to ride a bike and then look at the tracks in the evening, unfortunately, but I do not have a full PowerBank more and it only tracks a certain time.
I hope you Understand the Problem.
Greetings from Berlin
Benno
I would experiment with trying to turn off power saver mode on your phone. I suspect that is reducing the number of gps updates. But just remember that your battery will drain a lot faster. Let me know if that works.
https://www.howtogeek.com/242472/how-to-use-and-configure-androids-battery-saver-mode/
n
hello Nick,
First of all thank you for this wonderful project and fore making it an open source.
Im WAMP. I installed the client on my android phone and the php files on WAMP.
The databas was uploaded too.
However i can see my device on the map but the device is on saved in the databse.
Can you help me please.
Thank you in advance
Why don’t you guys just say in plain English, at the top of the page if the client has to be installed or not for this system to work. I know you might be implying this because you do have both a server and client component, but with computers one can imagine either scenario being a reality.
This assumption that the rest of us are going to have the esoteric knowledge that you do is a sign that you may need to step back and see this from a layman’s perspective.
Hey Andrew, sorry you are not happy with the software. This software was always meant to be used by other developers. It was never meant to be used by laymen. I’ve tried to simplify it as much as I could but at the end of the day, you really do need to be a software developer to use Gpstracker properly and to alter it for your own uses.
n
Hey Nick,
I am not a developer but I managed to install it ince properly, and I actually intend to do it again soon. Test versions mostly, but hey … long road to a user package 🙂
John
Why don’t you guys just say in plain English, at the top of the page if the client has to be installed or not for this system to work. I know you might be implying this because you do have both a server and client component, but with computers one can imagine either scenario being a reality.
This assumption that the rest of us are going to have the esoteric knowledge that you do is a sign that you may need to step back and see this from a layman’s perspective.
@Andrew, it would be nice and great if you could make the same comments in a polished and polite way considering that this great software is free and contributors at this forum also contribute answers for free
@Andrew, it would be nice and great if you could make the same comments in a polished and polite way considering that this great software is free and contributors at this forum also contribute answers for free
It is nice tutorial. I run all clients. But how i can get the source code of update and displaymap.php. please attach me on my email
Hey Abera
The most recent source code can always be found on github.
https://github.com/nickfox/GpsTracker
n
Hi Nick, your solution is compatible with a vehicle trackers ? I want to track my cars, and trucks.
Models ex: TK101, TK102, …
I´m speak from Brazil, sorry my english is poor.
Hi, yes. It can be used with vehicle trackers. Check out the tk103 server here:
https://github.com/nickfox/GpsTracker/tree/master/servers/tk103
n
God job man ! This is great..
I´m don’t know how make trace a route.. Line from point 1 to point 2 .
Hi, when i try of compile the app in Android Studio 3.0.1, show me this error
Error:Execution failed for task ‘:app:transformDexArchiveWithExternalLibsDexMergerForDebug’.
> java.lang.RuntimeException: java.lang.RuntimeException: com.android.builder.dexing.DexArchiveMergerException: Unable to merge dex
Hey Andres
Sorry about that. When google upgrades android studio, it seems to break backwards compatibility with projects. I’m rebuilding it right now. I should have it posted to github by the end of the day.
Nick
Hey Andres
Sorry for the delay. I’m building a bathroom and we had a big storm here and I needed to finish the roof. I have updated the android client to Android Studio 3.0.1 and SDK 26. It is in github. It has not been fully tested. You’re welcome to give it a try if you like.
https://github.com/nickfox/GpsTracker/tree/master/phoneClients
Hi nick, how are you?
What can we do if we need more accuracy in the location precision?
I’ve been looking at the code in Github, it will be in the location service?
https://github.com/nickfox/GpsTracker/blob/master/phoneClients/android/app/src/main/java/com/websmithing/gpstracker/LocationService.java
@override
public void onlocationchanged(location location) {
if (location != null) {
log.e(tag, “position: ” + location.getlatitude() + “, ” + location.getlongitude() + ” accuracy: ” + location.getaccuracy());
// we have our desired accuracy of 500 meters so lets quit this service,
// ondestroy will be called and stop our location uodates
if (location.getaccuracy() < 500.0f) {
stoplocationupdates();
sendlocationdatatowebsite(location);
}
}
}
Reducing the minimum accuracy of 500 meters, will keep the location updates up until reach the new precision set? Let's say we assign the value of 50.0f, will it keep google play location services on, until it reaches that accuracy, and only then send it to the server?
This will certainly increase the battery consumption, but for me the accuracy is more important than the battery life.
Thank you very much!
Best regards,
Pedro
Hey Pedro, reducing that value from 500 will increase accuracy but if you reduce it to much you may end up not getting any data. It may be beyond the ability of the phone. There are so many variables to consider.
What I strongly recommend is that you run a set of experiments with *different* phones. Perhaps choose three and then run tests at various levels of accuracy. 25 meters, 50m, 100, 250 etc…
The only real way to answer your question is to test and figure out the limitations of the phones you are using.
n
Hi Nick,
First of all my sincere appreciations for the follow up of your project all these years.
I plan to use your app to follow vacuum trucks in ALgeria. I am very acquainted with mssql server.
So I turned to the asp.net and MSSQL server. Connection is ok, and I adapted the web.config
There is a login I can not change : Data Source=localhost\SQLEXPRESS;Initial Catalog=GPSTracker;Persist Security Info=True;User ID=sa;Password=***********
I made a workaround with creating the right alias, the login with sa and “gpstracker” as password.
But where can I change it? Not in the web.config. I can’t find this.
Not a big issue, but would be nice if it coud be changed
VS for web 2013
how should i add my gps tracker details in dot net code?
i need particular location of my tracker is there available here
How can I make android app as background service?
hi, why the app not working in Iraq ??!! how can i make it work?
Hi there, been using GPS tracker for years now, I just installed it again and wanted to update the bootswatch css…when I use the latest version for cerulean, the page ends up being a bit larger than the frame and so scroll bars appear. Do you have a quick fix for this css issue?
Thanks again,
Adrian
Hi Adrian. Sorry to hear about the problems you are having. I haven’t looked at gps tracker for over 2 years now since I retired from writing software. I actually could use some help…
I’ll just use the old version for now. I’m using your awesome project to track an autonomous boat I’m building, if I get around to fixing the case issue I’ll let you know! Hope you’re making good progress on your books!