Discussion Forums  >  Maps, Device Location, Tracking

Replies: 9    Views: 129

farcat
buzztouch Evangelist
Profile
Posts: 1008
Reg: Jan 27, 2012
France
13,230
02/27/13 02:39 PM (11 years ago)

Posting a Device's Current Location to a Database

Hi Gang, I would like to have a go posting the device location on a map using the excellent tutorial by our very talented @GoNorthWest (hint hint). https://www.buzztouch.com/files/howtos/Posting_Current_Location_to_a_Database_v1.0.pdf I couldn't make out from the tutorial if this worked also with Android. Has anyone tried it yet? It would be soooooo sweet if it did :) Thanks, Farcat
 
SmugWimp
Smugger than thou...
Profile
Posts: 6316
Reg: Nov 07, 2012
Tamuning, GU
81,410
like
02/27/13 02:54 PM (11 years ago)
Well, sure it does. It's an HTML Page (either iOS or Android) and the data gets sent off to your PHP/MySQL server... The 'operative' components in this are an HTML Form, and a PHP/MySQL script connecting to your database back at your server... Absolutely nothing 'OS' specific about this setup... Cheers! -- Smug
 
farcat
buzztouch Evangelist
Profile
Posts: 1008
Reg: Jan 27, 2012
France
13,230
like
02/27/13 03:01 PM (11 years ago)
That's what I gathered but I wasn't sure. Very good news for me indeed. Thanks Smug for answering yet another of my post! Cheers, Farcat
 
GoNorthWest
buzztouch Evangelist
Profile
Posts: 8197
Reg: Jun 24, 2011
Oro Valley, AZ
1,000,000
like
02/27/13 07:48 PM (11 years ago)
Yep, indeed it works for Android! If you run into any problems, let us know! Mark
 
farcat
buzztouch Evangelist
Profile
Posts: 1008
Reg: Jan 27, 2012
France
13,230
like
02/28/13 08:02 AM (11 years ago)
Yep, I am stuck alright. :) OK, I create the database and the table according to your script. I got the message:"Your SQL query has been executed successfully" so I guess that bit is OK. I made the location.php file changing the Mysql data to point at my database. I made the location-list.php file changing the Mysql data to point at my database. On the app I created the url screen pointing to my location.php file. I also created the location map screen pointing to location_list.php file. On the app when I open the screen where it should grab the location I see the html but the latitude and Longitude fields are 0. Also there is no map showing, just a blue rectangle with a pointer in the middle. When I open the location map screen I get "Error , there was a problem parsing some configuration data. Please make sure that it is well formed." Obviously I did something wrong but after triple checking I can't see what it is. Any pointers please? Maybe screen shots would help? THanks, Farcat
 
GoNorthWest
buzztouch Evangelist
Profile
Posts: 8197
Reg: Jun 24, 2011
Oro Valley, AZ
1,000,000
like
02/28/13 09:02 AM (11 years ago)
Hi Farcat, Sounds like this is on Android? I ask that because of the missing map tiles. Those you can get to show up using the Google Maps API Key for Android. Let me know if you need help with that part. Ensure that you've set GPS in the core settings of your app so that it will get reported to the device. Also...this will only work on a live device, since the emulator doesn't have actual GPS. Take care of those items and see if the lat/long fields show up. Then we'll go from there. Mark
 
farcat
buzztouch Evangelist
Profile
Posts: 1008
Reg: Jan 27, 2012
France
13,230
like
02/28/13 09:32 AM (11 years ago)
Hi Mark, This is IOS. Sorry I should have made the precision earlier. It is installed on a live app: https://itunes.apple.com/us/app/free-wifi-gibraltar/id520915877?mt=8 If you don't mind having a look, just type "map" in the search tool (it's kind of hidden there for testing). On this same app I have another map that does report the location of my iphone so I guess the GPS core settings in OK. I wonder if the error comes from the database? Thanks, Farcat
 
GoNorthWest
buzztouch Evangelist
Profile
Posts: 8197
Reg: Jun 24, 2011
Oro Valley, AZ
1,000,000
like
02/28/13 09:41 AM (11 years ago)
Hi Farid, I loaded your app and typed in map, but no results are returned. The screen that would load the form which shows your current location should be a Custom URL screen that is retrieved with a URL like this: http://www.yoururl.com/app-test.php?latitude=[deviceLatitude]&longitude=[deviceLongitude] The 'app-test.php' file takes the deviceLatitude and deviceLongitude and plugs them into the script, building the resulting table which is shown on the device. Is this how you have things configured? Mark
 
farcat
buzztouch Evangelist
Profile
Posts: 1008
Reg: Jan 27, 2012
France
13,230
like
02/28/13 01:17 PM (11 years ago)
Hi Mark, If you refresh the app the map screens will show up. Not sure why this happens that but it does not matter as I am rebuilding the app in self-hosted anyway. I have set up all the above. Maybe I messed the up the database. I have just emailed you some screenshots. Would you mind having a look please? Thanks, Farid
 
farcat
buzztouch Evangelist
Profile
Posts: 1008
Reg: Jan 27, 2012
France
13,230
like
03/04/13 01:27 AM (11 years ago)
Hi guys, It now works, phewww! Thanks Mark to have helped me. I'll try and have the output coming out on an email rather than a map. This is so I can get a warning and input the location manually, way to many spammers and trolls out there. That is a bit advanced php for me but I confident I can Google out the solution- will post when I do. Regards, Farcat
 

Login + Screen Name Required to Post

pointerLogin to participate so you can start earning points. Once you're logged in (and have a screen name entered in your profile), you can subscribe to topics, follow users, and start learning how to make apps like the pros.