Discussion Forums  >  Uncategorized

Replies: 2    Views: 167

trailman
Aspiring developer
Profile
Posts: 280
Reg: Dec 10, 2010
Sedona, az
6,550
09/26/11 09:22 PM (14 years ago)

About Sending Device Data in URL's

What does the About Sending Device Data in URL's function do? Is there any more documentation on this feature. I'm trying to add a users location (or overlay the location of the device) to a hiking trail we tracked and uploaded to google maps. Is that possible with this feature? Thanks, Bruce
 
David @ buzztouch
buzztouch Evangelist
Profile
Posts: 6866
Reg: Jan 01, 2010
Monterey, CA
78,840
like
09/26/11 10:35 PM (14 years ago)
Hi Bruce: I'll give this a shot. When the device makes a request for a resource online, like a web-page, it uses a URL. So far so good. Now, the web-page (a .php script probably) can be setup in a way that it expects certain values to be passed along in the quesrysting (the part of the ULR after the ? mark). By passing values in the querystring, such as the devices location, the backend script can take advantage of them. Example: You have a web-page setup that is used to display the users current location. In order to show the location, the web-page must 'learn' where the device is before displaying the HTML. In .php, you would pull the variables from the querystring to then display (or do whatever you want with, like insert them into a database, change the content based on something like it's latitude / longitude, etc. Example: You have a script on your webisite called myCoolWebpage.php. This web-page hopes to find the devices latitude in it's URL when it's requested by the phone. Setting the URL in the control panel (config data) to this: myCoolWebpage.php?deviceLatitude=[deviceLatitude]&deviceLongitude=[deviceLongitude] tells the software to substitute (merge) the real values in the URL before making the request. So, myCoolWebpage.php would get: myCoolWebpage.php?deviceLatitude=34.3392&deviceLongitude=121.345 myCoolWebPage.php could make use of these variables in all sorts of ways. In .php you could print them in the HTML with: <?php echo $_GET['deviceLatitude]; ?> More about this was discussed yesterday here: http://www.buzztouch.com/forum/thread.php?tid=A694CB2D7B38C27A0DE2D66 I'm still not versed with routes and other google maps goodies but it's possible that you can 'pass' location info in the google URL to then show the overlay?
 
trailman
Aspiring developer
Profile
Posts: 280
Reg: Dec 10, 2010
Sedona, az
6,550
like
09/27/11 02:02 PM (14 years ago)
Hey David, Thanks for the reply. I saw that post and your explanation makes sense. Who knows maybe I'll even figure out how to harness the technology!
 

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.