Is there any possibility of getting the location of a user, moving direction, and the speed via mobile platforms(client side programming like j2me) ? if there is availability in any platform please let me know the platform and please give me some study links to study about it?
regards,
Rangana
I'm not sure if there is an API for this, mainly because I don't think that this information (velocity) is available.
You can still figure it out though, and this would work on all cell phones that allow you to access their "current location".
Ping the phone for it's current location every n seconds (10,20,30 seconds, etc...)
Log the location of the phone at every ping (lat,long)
Determine the distance traveled from ping-to-ping. You may need to use vector resolution (http://www.physicsclassroom.com/class/vectors/u3l1e.cfm)
For example, if a phone moves 1000 meters over the course of a 30 second ping, that means:
1000 meters / 30 seconds = 33.333 m/s
Doing this, you can also determine acceleration, etc... This would not give you instantaneous velocity or acceleration, but instead average velocity and average acceleration.
Without GPS it is impossible to get the speed and exact location. You can however retrieve the base station location from several web services and determine your approximate location.
Related
I am working on a feature in an iOS app to send location updates to our backend when there is a change in the location.
Initially, I had set minimalDistanceFilter(minimum change in location value) to none to send location updates. But it is making the network calls continuously and it can increase the load on the backend.
If some of you worked on this case earlier, I wanted to know how you solved it. What can be the minimalDistanceFilter?
I am also curious about how the above-listed apps work with location-related events.
The distanceFilter and the desiredAccuracy go hand-in-hand. For the distance filter, it can be anything between kCLDistanceFilterNone and CLLocationDistanceMax. See the documentation.
Regarding what other people used, it will vary widely from app to app. For navigation apps, you tend to need high accuracy so you don't miss a turn. But a weather app might be perfectly happy with city-level accuracy.
If you really need reasonable precision and want to reduce volume, then a filter of 5–15 meters is a good starting point. Try different values yourself and see what the effect is.
But there is no magical answer to your question. You will have to balance the legitimate needs of your app with (a) the server load; and (b) the power consumption on the device.
By the way, if the app doesn't need high accuracy, you might contemplate the very efficient, but less accurate, significant change service which will report changes of roughly 500 meters, with a frequency not exceeding once every 5 minutes
Finally, remember, nowadays the user is in control of the accuracy. You can request whatever accuracy you want, but if the user wants to preserve their privacy, they can choose not to share their precise location, and there is nothing you can do about it (other than to try to make a case for why precise location data is essential for the proper functioning of your app).
I am developing an iOS application to track user movement of the different location. I am using GPS to pull the user location[Alway from the setting location]. it works perfectly, but I am getting different location name while i am in my home.
Like in 1st bedroom you are 1503 location
and in 2nd bedroom, you are at 1702 location
how these different locations update works in background process?
It all depends of the service you are using with CoreLocation. You have here a list of the different services provided. The Standard location service (tutorial here) will be the most accurate and customizable but the less power friendly. CoreLocation often get you a location then update it to get you more and more precise location, the accuracy will also depends on the quality of your network.
You can customize the Standard location service with the following lines :
locationManager.desiredAccuracy = kCLLocationAccuracyHundredMeters
locationManager.distanceFilter = 100.0 // In meters.
The desiredAccuracy is important.
But have you ever notice this?
When you're in a building and have WiFi turned on then CoreLocation uses WiFi to also pinpoint where you are.
How does identifying a location using WiFi work?
It's roughly something like this:
Imagine you that your building has 2 sides. Left side (1502) and right side (1702).
The left side has a wifi network named LeftSideOfBuildingWiFi
The right side has a wifi network name RightSideOfBuildingWiFi
At every moment your locationServices is turned on...Apple will capture the list of WiFi networks. It will say at 1502 the LeftSideOfBuildingWiFi has a stronger signal.
So now some other person enters the house and is connected to LeftSideOfBuildingWiFi or has stronger signal with that...Apple will conclude that you're likely at 1502.
This helps preserving the battery of the iOS device. WiFi consumes far less energy than the GPS chip itself.
The same is true if you're in the downtown. Yet if you're in the middle of nowhere in the road then it doesn't apply.
The same concept works for significant location services. They use cell-towers rather than GPS chip. Say there are 4 towers near to you and each one has a different signal strength. Likely you're closer to the one which has a stronger signal...
There is a lot of error in GPS readings. They get much less accurate when indoors, and can be off by 1000+ meters. Given that much error, it is not at all surprising that the location might geocode to different addresses when you are in different parts of a house.
i have developped an IOS application with Xaramin and am trying to find out what is consuming most significantly the battery. The application has three main activities:
Listen to location updates in the background (with AccurityNearestTenMeters and DistanceFilter = 50)
Write all the acquired locations every 10 seconds in a file
Send the file content to a remote server by using a standard HttpClient object
The application is consuming about 50% of the battery after 7 hours or so. It depends on the user movement but let's say that there are plenty of movements by walk, tramway, etc...then a reasonable amount of time where there is much less movements (i.e at work).
I have tried to change the desired accuracy to nearest 100 meter and also change the distance filter. I got some pretty good optimization especially for the accuracy change but i need to have more precise locations so am looking for another possibility if any to optimize the battery.
There are many questions that cross my mind and for which i would like to have your feedbacks please: what is more battery consuming? Location updates or file writing? also the same for a network request so if i put it side by side what does consume more the battery: location updates, file writing or network requests. I mean from a general point of view.
Also, do you guys have any recommendations or information that can help me in this optimization ?
Hi I am creating two apps where each app needs to know the location of the other app. I am using corelocation for that. However I am not sure whats the best/efficient way of getting the nearby devices. I can create a database with co-ordinates using parsi api. However I think that would be a lot of work to calculate the shortest distance every few minutes. Any ideas? I have a map for each app and i want to display the shortest distance between the two users on the map.I am using google maps api for ios
The API to calculate distance is pretty lightweight. Internally you use the Haversine formula to calculate distance including the curvature of the Earth. From the iOS perspective though you simply do this:
CLLocation* previousPoint = [self.allLocations objectAtIndex:i-1];
CLLocation* currentPoint = [self.allLocations objectAtIndex:i];
CLLocationDistance distanceFromPrevPoint = [previousPoint distanceFromLocation:currentPoint];
You can easily iterate over the other devices in the zone. If you want to reduce the number of calculations, you could only calculate distances to devices in the same base latitude longitude (ignore minutes and seconds).
Since you're using Parse, you should be able to do a PFQuery for all place objects within a given range. See the documentation here: https://www.parse.com/docs/ios_guide#geo/iOS (Geo Queries)
If they're close enough (~30 meters) you can use iBeacons.
What would work the best depends on your particular app's needs.
Edit: Since you said your distance is too far, iBeacons won't work.
The brute-force way to do this is to run through all connected devices and calculate the (Pythagorean) distance to each one, and select the ones that are within your distance threshold. That's very time-consuming however.
Instead you might want to have each device report some sort of region code for each location (State? County? Zip code?) as the location changes. You'd use geocoding to generate the region information. You could have the reporting devices do the geocoding themselves, so they are only responsible for updating location information for a single device and you don't bog down doing geocoding. You'd report lat/long and region information to the server as it changes, with a "choke" to only report changes on significant changes, or once per minute, whichever is LESS frequent. (I remember reading in the docs that you are only supposed to submit a small number of geocoding calls or you get locked out and/or your app gets rejected.)
You'd collect the data in a central server.
Then you could start by requesting other users that match your current region (and possibly nearby regions) and then do distance calculations only on that small subset of your data that matches the region code.
I am currently working on an app which requires the current region in which the user is in.The worst part is app is completely off line.
My logic :
1.Take a screen shot of the city draw squares on that.
Store square 4 points (lat long values taken with respect to map) in DB.
With the lat long values got from gps i can easily find out lat lont belongs to what reason.
I am just wondering if anybody can suggest me better idea to work my app offline.
Thank you in advance ..
You will probably find you have problems getting a location if you have no network access. iOS uses assisted-GPS, which allows the device to both lock onto GPS satellites much faster than it might otherwise take, and also pull in other data from the network to quickly determine location.
Without network access you may not get a location reported back at all, especially if the app was being used indoors (vanilla GPS reception is typically very bad without line of sight). If you do get a location it may take several minutes for an accurate enough reading to be provided.
you can use the RouteMe library which is based on OpenStreetMap. this allows to download map data in advance.
If you want to work with screenshots (from a legal source) then you use the Helmert transformation to transform between gps and picture-pixel coordinazes.
you need at least 3 points in the picture-map for which you now the lat,lon coordinates.