In my app, I am using CLLocationManager to get user's current location.
The problem is, most of the time, user would be indoor, or not very far from the building entrance when they launch my app for the very first time. As a result the location I get is not very accurate(more than 1km off).
Yet, at the same time, if I open either Google Map or Apple Map, they are able to display location with little discrepency(a few hundred meters). How they manage to do that ?
Related
I would like to simulate a car trip in my real IOS device connected on my MAC-OS computer.
I tried with libimobildedevice set location that can virtualize your device GPS location as you want but it is not exactly my goal.
e.g.
idevicesetlocation -- LAT LONG
I mean my attempt is not able to consider the speed/velocity of the trip and in my case is really important. It consists only in set location, set location, set location... and so on so far.
I have to reproduce the same trip that you have manually, please consider the following scenario:
MANUALLY
you bring you mobile phone
you have your gps location enabled
you bring your car
you make a trip
you open google maps
google maps show you the transition
google maps show you the speed/velocity of your transition between locations while travelling
AUTOMATICALLY
I can reach everything except for the last point "google maps show you the speed/velocity of your transition between locations while travelling" because google maps UI feedback does not show the speed. The UI feedback remains --/-- km/h. I would remark MANUALLY works.
Everyone knows that Maps app can detect your home and work location and it shows you with "maps destination" feature. I am just wondering how it gets our specific location like work and home. Is it because we are stable on some places and it figures out we live here and we work there in specific time?
I'm also wondering that how can we get detected datas from the maps. Is it possible that I can use home and work locations on my app, using MapKit?
No you cannot, since it’s confidential users data. Only apples map app can use it
I've recently started to learn how to develop with Xcode and I have a question about the map and gps services.
Does anyone know what kind of resources I would have to use if I wanted to have a map in my app that shows the location of other people who use the app?
I have a general idea that each person would need an account for my app,
But would I have to put everyone's gps coordinates onto a server (SQLite?) and then constantly make the app fetch this information?
I am aiming for a similar concept that the app Called "Uber" uses where you can see taxi drivers around you and they are moving.
Yeah, you will probably need to store each user's GPS coordinates somewhere in a database. Then you can draw annotations on Apple's map view or on a map view that Google provides in their iOS helper once you fetch information from the database. I would not constantly update the user's map though. You should update it every 5 minutes, or when the user asks for it to be refreshed either through a button or some other form. Also if you plan to find the nearest user to them from the database I recommend using the Haversine Forumula (http://rosettacode.org/wiki/Haversine_formula).
I am building an iOS app in Corona SDK and am trying to implement a map feature where the user can see where they are compared to where others with the app open are. What would be the best way to go at this?
I already wrote the code for finding the current location of the owner of the device, but how do I retrieve data from other users?
Any advice is greatly appreciated!
This is very broad question, but basically you need a server (on the web) where each user's location gets stored while the app is open, and the app can request the location of other users specifically, at some time interval. Presumably you would need to have some form of rights management since every user would typically be interested in seeing only a small number of other users, and every user would want to have control over who can see their location.
One thing to remind users of is that the reported position is that of the device, not that of the user, and that it is the last reported position, not necessarily current (not all devices are on cellular network or wifi at every moment), so you'd also want a time-of-last-update to be shown with every location marker.
I'm developing a chat application, and a requirement is to get the device details for users within some distance (i.e., devices within 100 miles who are using same application). I want to get the details and they should be shown in a UITableView.
There are far too many pieces involved in this for a single answer to include all the code, however I can give you a high-level overview:
You'll need to send the device's current location (found with CLLocationManager) and an identifier to a remote server on applicationDidBecomeActive: and whenever you determine that the user has moved a significant distance.
Your remote server stores these coordinates, the identifier, and a timestamp into a database table and periodically prunes old entries.
When you load the "Nearby Users" screen your devices makes a request with its own location to the server, which returns the list of users within 100 miles. The Haversine formula is the proper way to calculate distances between GPS coordinates. Once you have the results, you can show them in a UITableView.
When the user selects a nearby user, you can use the identifier it sent in step 1 to start brokering a connection between them. This part is highly dependent on your specific chat system.