Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

Geek Culture / iPhone SDK Question - Access to GPS?

Author
Message
RUCCUS
20
Years of Service
User Offline
Joined: 11th Dec 2004
Location: Canada
Posted: 10th Mar 2010 02:29 Edited at: 10th Mar 2010 02:30
Im wondering if any of the few devs on here that use or know about the iPhone SDK could answer a question for me. Im in the process of fleshing out a prototype for an iPhone app I've been thinking of. However the entire premise of this game relies on the ability to get access to the built-in GPS system the iPhone has. Is it possible, using xCode and the SDK, to actually get the user's real-world location? I assume so because I've been reading articles on the subject and one article was written by a company that released the popular PhotoKast app, and this app is able to determine where you're located to give you a list of photos taken in your area. I just want to make sure this is actually possible before going out and buying a macbook and a license to the iPhone SDK to get started on this thing.
Van B
Moderator
22
Years of Service
User Offline
Joined: 8th Oct 2002
Location: Sunnyvale
Posted: 10th Mar 2010 08:41
I imagine that it will be completely possible, maybe just have to check a tutorial, or copy a code snippet. It's something you should research fully of course, because I think GPS calculation takes a toll on the battery, so it's best to see what everyone else does first. I wouldn't know as I have a Touch, so no GPS even if I did know how to use it exactly. I have had experience with other aspects, like the accelerometer, and that's really straightforward. If you are using Objective-C primarily, then it'll probably be easy, I prefer C++, so examples tend not to work for me, well not how I want them to anyway.

I really like using XCode, it's fiddly to get things set up regarding licenses etc, but after that it's quite straightforward. XCode is free, you get the rights to use it when you buy a mac - like you get a mac ID thing, register with that and download the iPhone SDK which comes with XCode included.


Health, Ammo, and bacon and eggs!
Dragon Knight
18
Years of Service
User Offline
Joined: 10th Jan 2007
Location: Newcastle
Posted: 10th Mar 2010 09:21 Edited at: 10th Mar 2010 09:28
Technically yes but it'll have to be for IPhone 3g

Since you'll be just starting up.. i'd advise buying just a mac-mini (MUST HAVE INTEL CHIP) so you can develop for iphone...

Tips:
Follow the manual on publishing apps to a tee or you'll find yourself deleting key-chains and having to go through the entire process again, publishing is probably the biggest hassle on the iPhone but once you've done it once it's a heck of allot easier the second time.

Then you can easily learn how to do 2D apps from http://icodeblog.com/ I eventually moved on to OpenGL ES for 3d stuff xD

RUCCUS
20
Years of Service
User Offline
Joined: 11th Dec 2004
Location: Canada
Posted: 10th Mar 2010 13:27 Edited at: 10th Mar 2010 14:30
Thanks for the info.

I just upgraded my phone to an Omnia a few days ago. Its not near as powerful as the iPhone, but it has a touch screen and GPS built in and was a free upgrade . Ive been working with Visual Studio just tinkering around writing simple programs for it so far, but it was fairly straight forward to figure out. The docs explain it all basically. Pretty much exactly the same as normal VB / C++ programming just with a few different gadgets available / methods for obtaining data. Im going to see if I can write up a prototype for this phone first since it has everything I need to get the basics down, and if it works Ill consider moving on to an iPhone.

Thanks again for the info, I had never thought about what kind of battery load using the GPS constantly would have. Might have to make some sort of a workaround for that if it ends up being a problem I guess.
Unjust1
20
Years of Service
User Offline
Joined: 22nd Oct 2004
Location: Missouri
Posted: 10th Mar 2010 18:16
It's possible, you'll want to research the CoreLocation.framework, probably want to look into reachability also. As for battery load, I would just have it update every 5 or 10 seconds unless you need real time GPS. Good Luck
RUCCUS
20
Years of Service
User Offline
Joined: 11th Dec 2004
Location: Canada
Posted: 10th Mar 2010 21:48
In the perfect world it would feature realtime GPS, but Ill just include the option to set how fast the GPS updates. Then if you're in a car with it plugged in you can set it to realtime, otherwise just pick a setting if its in your hand.

Thanks again.
piXX3D
18
Years of Service
User Offline
Joined: 27th Mar 2007
Location: Nowhere
Posted: 10th Mar 2010 23:02
Yep, definitely possible. CoreLocation is what you'll want to research, not that difficult once you know a bit of objective-c. you'll need an Intel-based Mac running Leopard/Snow Leopard if you don't have one already.

You can get realtime GPS stuff going on on the iPhone 2G and 3G, more advanced stuff using the compass on the 3GS, but only 'Wifi' GPS on the iPod touch - meaning if your game idea will span areas without Wireless networks, it's really a no-go for the iPod Touch.

If you want to put it on the App Store though, it'll cost you $99/£59...
Jeku
Moderator
21
Years of Service
User Offline
Joined: 4th Jul 2003
Location: Vancouver, British Columbia, Canada
Posted: 11th Mar 2010 00:36
Quote: "If you want to put it on the App Store though, it'll cost you $99/£59..."


Even to test the app on your iPhone/Touch costs the developer fee. They have a great emulator built into the SDK, but it's hard to emulate tilts.


Senior Web Developer - Nokia
RUCCUS
20
Years of Service
User Offline
Joined: 11th Dec 2004
Location: Canada
Posted: 11th Mar 2010 02:07 Edited at: 11th Mar 2010 02:08
Yeah Ive looked into the fees already. Im also going to need to set up an expandable server. From what Ive read on the windows mobile os, there is a way to fake the gps system when there is no wifi or gps signal available, that uses the local telephone towers to triangulate where the phone is, but it also has a fee put onto it as well. There is probably a similar method for the iPhone. One of the benfits of the windows mobile route is that you actually can test and install the apps on your own phone witout any charge.

Im not saying Im going to be getting this thing up and running any time soon. I've only just begun getting my hands wet in visual studio again, not to mention this is my first week programming for mobile applications at all. Im going into this understanding that its going to be a very long process, but if I can get this game idea to come to life I think it will pay off in the end. Its really something Ive never seen done before, and I havent seen any plans for this kind of game in the future, so if I can put the work into it I really think its going to catch on .
JoelJ
21
Years of Service
User Offline
Joined: 8th Sep 2003
Location: UTAH
Posted: 11th Mar 2010 04:01
Quote: "Even to test the app on your iPhone/Touch costs the developer fee. They have a great emulator built into the SDK, but it's hard to emulate tilts."


And GPS. When you access the CoreLocation from the Simulator it always returns the coordinates for Apple's HQ

Your mother has been erased by a mod because it's larger than 600x120
Veron
18
Years of Service
User Offline
Joined: 22nd Nov 2006
Location:
Posted: 12th Mar 2010 07:32
Quote: "I just upgraded my phone to an Omnia a few days ago."


That's the same phone that I have, and I absolutely love it. When coupled with some really nice GPS apps (like Pocket FMS which is freeware, although that's more flight related), the GPS becomes insanely awesome. Some reg tweaks that make it not require a data plan to connect but still grabbing a signal relatively quick are great as well.

jeffhuys
19
Years of Service
User Offline
Joined: 24th May 2006
Location: No cheesy line here.
Posted: 13th Mar 2010 02:32
You can even use HLSL shaders in the new 3GS/iPod Touch 3G.

You're the 'th to view this signature!
RUCCUS
20
Years of Service
User Offline
Joined: 11th Dec 2004
Location: Canada
Posted: 13th Mar 2010 22:15
Unfortunately shaders havent been implemented into the Direct3D framework for windows mobile yet

Login to post a reply

Server time is: 2025-05-24 20:28:32
Your offset time is: 2025-05-24 20:28:32