Discussion Forums  >  Uncategorized

Replies: 7    Views: 209

Racer X
buzztouch Evangelist
Profile
Posts: 129
Reg: Mar 24, 2011
Boston, MA
5,490
08/09/11 06:48 PM (14 years ago)

Current latitude and longitude of the device

Does anyone know what info to place in a URL telling the website the devices current position? The URL Iam trying to use has a format like this: http://www.xxx.xxx/rss/xxx.php?lat=25N&lon=90W&radius=300 Instead of using that specific latitude and longitude, I want to replace the lat and long with info that instead reports the current position of the device. Any help is appreciated.
 
David @ buzztouch
buzztouch Evangelist
Profile
Posts: 6866
Reg: Jan 01, 2010
Monterey, CA
78,840
like
08/09/11 08:22 PM (14 years ago)
What buzztouch version? If you're using v1.5, its http://www.xxxxx./rss/mypage.php?deviceLatitidue=[deviceLatitude]&deviceLongitude=[deviceLongitude] The app will merge the current values before making the request to the URL
 
Racer X
buzztouch Evangelist
Profile
Posts: 129
Reg: Mar 24, 2011
Boston, MA
5,490
like
08/10/11 01:56 AM (14 years ago)
Thanks David, I am using version 1.5. Still having trouble getting it to work. I'll keep trying. I suspect its something on the other end.
 
David @ buzztouch
buzztouch Evangelist
Profile
Posts: 6866
Reg: Jan 01, 2010
Monterey, CA
78,840
like
08/10/11 02:18 AM (14 years ago)
Be sure to look at the console when the app is running too, it will show you good info. Like the URL it's requesting, if the device can report it's location, etc. Get used to using the clear button on the Xcode console to erase the output, then tap something and look at the output...lots of good stuff. We went through great pains to output loads of data to that window so you could see what was happening when things didn't work as expected. a) Near the top of the output when you launch the app, make sure the device can reports it's location. The console will show this. b) Next, when a URL is loading, the console will show you the URL after merging any variables you used like [deviceLatitude] and others. If this is outputting OK, copy one of the URLs and paste it in your regular browser. This will help you test your backend script to make sure it's getting the values from the URL OK.
 
Racer X
buzztouch Evangelist
Profile
Posts: 129
Reg: Mar 24, 2011
Boston, MA
5,490
like
08/10/11 03:01 PM (14 years ago)
Thanks Dave, After messing around quite a bit I realize that I didnt mention I am not using any back end script. That URL is set up to pull information from an hourly government weather service RSS feed. So instead of setting a static lat/long I wanted to instead insert URL that reported the users device current position. But it sounds like I would need my own back end to do that? The app name is -report- and the screen name is -one- if your able to take a quick look. I suspect its not feasable without my own backend.
 
David @ buzztouch
buzztouch Evangelist
Profile
Posts: 6866
Reg: Jan 01, 2010
Monterey, CA
78,840
like
08/12/11 01:31 AM (14 years ago)
You can do what you describe. It sounds like you just need to send the devices location in the URL. You do this with merge fields. So, instead of this.. http://www.ndbc.noaa.gov/rss/ndbc_obs_search.php?lat=40N&lon=73W&radius=100 use: http://www.ndbc.noaa.gov/rss/ndbc_obs_search.php?lat=[deviceLatitude]&lon=[deviceLongitude]&radius=100 The device will replace the brackets with the current device info. Note: The values will be decimal. Instead of 40N it would be like -40.000. The NOAA folks should allow that format.
 
Racer X
buzztouch Evangelist
Profile
Posts: 129
Reg: Mar 24, 2011
Boston, MA
5,490
like
08/12/11 04:40 AM (14 years ago)
Thanks Dave, I tried and I think its really close to working but still no luck. I don't think the decimal format is an issue.
 
David @ buzztouch
buzztouch Evangelist
Profile
Posts: 6866
Reg: Jan 01, 2010
Monterey, CA
78,840
like
08/12/11 10:23 PM (14 years ago)
Do you know for sure what URL the device is requesting? Thats about the only thing you'll be able to control...everything else on their end.
 

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.