I'm trying to understand the concept of pulling information off the web and into an app Please! - iphone

Generally speaking, how does an app like "Around Me" acquire the information it displays?
For example: the restaurants that show up in a list that are near me with the address and distance (I think I get the distance piece) where is this information extracted from? Is it Google or something?
I'm not asking how to implement this (that's over my head!) just get an idea of how it occurs.
Thanks StackOverFlow people.

I haven't seen that specific app, but most such apps either have an embedded database of locations or they dynamically query a server back-end (e.g. using HTTP) to fetch a set of locations near you. They know where you are because the app has access to location services to find out your geographic location.

The iPhone has a GPS unit which gives you your latitude and longitude, which it then sends to a backend server (Say Google Maps) and queries it for, in your case a restaurant. The server responds with a set of locations around you.

Related

Changing a UITableViewController dynamically via location

I am in the process of building an app, for the record I am using the code from the ECSlidingView controller. I would like for my app to use the GPS to pull data from my web interface letting the user know that they can do certain things at a given location. So for example, I have a user go to a store and lets say I want them to make a payment at that location, it will given them that option. Or if the store doesn't offer payment through the app, I disable that. What would be a good way to go about this?
You could try using CoreLocation but you might have trouble getting accurate location inside (it will most probably use wifi or cellular info so the accuracy might not be what you expect). Then, when you get the location, issue a request to your service passing latitude and longiude you receive from CoreLocation. There, you should search by location to retrieve possible matches - consider returning muliple store infos for nearby stores due to the accuracy issues.

How to locate any mobile number using iPhone application

I want to make an application on iPhone which locates the mobile number region(area) when the user gets a call. Can anybody give me guideline how to accomplish that task?
You can't access the details of an incoming call on the iPhone.
Crazy idea: User would define a phone number of your server (SIP, VOIP) as "forward when declined"-number. When the user gets a call, he would simply decline it, so it would be forwarded to your server. There you could extract the information and send it to the iPhone (Push Service). And finally you would redirect the call back from the server to the user's iPhone.
For anyone looking for an answer to the second part of this question (how to get the location for a number), there is a similar question (asked interestingly enough one day before this one) with several answers here:
Telephone area code to city name on iOS
I also discovered an SQLite database named calldata.db in the private framework AppSupport.framework that contains US cities, states and area codes, as well as prefixes (the three digits that come after the area code).
Using a query like this you could find out that area code 212 is New York, NY:
SELECT * FROM citycode, npanxx, npa
WHERE npanxx.npa = 212
AND citycode.code = npanxx.rate_center
AND npanxx.npa = npa.npa
I don't however know if accessing/packaging this database would violate any agreements with Apple (I do know that the Default.phoneformat file from AppSupport.framework has been packed with several apps which had no problems getting into the App Store, see comments here: https://stackoverflow.com/a/13116227/381233). Perhaps there are some methods in the AppSupport.framework that would get this information more easily, but that would definitely not be allowed in the app store.
As for the other part of this question (access the details of an incoming call), this would most likely be possible on a jailbroken phone. No doubt there's already a tweak in Cydia that does this.

Geolocation in Iphone Application

I am a newbee to Iphone App Development and struggling with my first application.
I have a database with few address in it. All I have to do is get the current location and pick the closest three address from the database and of-course have to show the current location and the selected three nearest address on a map with directions on them.
I had a look at the Xcode frameworks LocateMe, CurrentAddress and MKReverseGeocoder Class Reference.
But then not sure how to co-ordinate this all together in an orderly manner.
Any suggestions/assistance would be greatly appreciated.
Thanks
You should provide lat/lon with your addresses in your database, so do the geocoding of the addresses before.
You have a location manager (CLLocationManager) which takes care of your current position, and with each location (CLLocation) you can calculate the distance (distanceFormLocation:). Now you only need to sort your database with this and pick the first three items.
Hmm?

How does apps like foursquare or gowalla implement their check-in feature?

If I had to build my own check-in feature from scratch, how would I go about it? I was thinking that once a location is determined using corelocations, I can add that location co-ordinate and timestamp to a database in some server. Now once one of my friends check-in close to that location, there can be a query to the database to figure out all check-ins around that location and around that timestamp. Is that how they implement this feature?
Those services use the current location (that you could get via CoreLocation or otherwise) in order to determine which venues to show near the user. Note that they usually have a database of business venues and the user selects the one they are actually and perform the checkin.
So, in order to figure out "who you are hanging out with", they only have to see who has checked in in that specific location, around that timestamp.
Note that the whole thing could have been implemented without location services and geographical coordinates - just choose from a list! Now, with location services, you can help the user search for the place quickly.

Getting current location and posting it to a web service

Ok... maybe forbidden by Apple, but assuming this is permitted. What would be the best way to get the current location (not difficult) and posting it to a web service (also not much of a challenge). The app is for an artist who wants people to see where he is at the moment. Personally, I wouldn't want people to know where I am 24/7 but that's performance art I guess. An exact location is not wanted but a town or area would be preferred. I could modify the string when it gets to the server and make it more vague by rounding the LOG and LAT.
The app the fans would use would retrieve his current location from the server and update the map view with a location.
I suppose one way would be for him to find out his coordinates and post that to a web page but I'd like it to update automatically.
A response with code is not necessary, just a general opinion on methodology/advisability would be appreciated
I would probably give him a webpage to go to that records his position every time he visits. It would be a private URL, and perhaps use some lightweight authentication. For versatility, I'd record the exact position in the database (in case he changes his mind on how it should work later on). However, you could use an external service or another purchased database with zips or city information with lat/lng data, so you could just provide users of the client app with his general vicinity rather than exact location.
The alternative would be to give him an ad hoc app that does the same thing, but putting together that location recording webpage would be a much simpler process. Could be handy for other things, too.
Here's a little writeup about getting location from mobile Safari, just as a reference: http://mobiforge.com/developing/story/location-iphone-web-apps
Why wouldn't you just use google latitude and read out his status?
I think this should really be done as a web page web-app. You can get coordinates from the device through mobile safari and you can skip the app approval process. You can also set it up so it runs fullscreen on his phone and he won't know the difference. You can also put a password on it.
There is a good chance it would not get approved as a regular app.
You can always meta refresh the page to keep it updating.
http://smithsrus.com/gps-geolocation-in-safari-on-iphone-os-3-0/
"Artist" must log in to his application (thus insuring that he want to share his coordinates with your webserver), then you use CLLocationManager to get his coordinates and make a reverse geocoding using Google Maps API to get country and city for given coordinates.
Can't see anything special about it :)