I am building an app that will monitor where a user is using GPS and alert him if he is within a certain distance of a particular place. I would provide the app with a list of the places and their latitude and longitude and the app would check against this list. Once the user has launched the app to start the location monitoring process, then most of the time he does not need to know anything about it and will be using other apps, making phone calls, or whatever. A user interface will only be displayed when the app finds a match with a location in the list.
I guess that this means that the location monitoring should run in background mode, but I am fairly new to android and I don't really understand about background processes or about location monitoring. Can anyone point me to a good tutorial or information?
to building this app that will monitor where a user is using GPS and alert him if he is within a certain distance, you will using service in background and using gps to get altitude and longitude and you will using a function to calculate a distance bitween a user location giving by gps and others location in the list and you can also start your Service on Boot Automatically.
good luck.
Related
I am building an application for Android devices for skydivers to log location data during a skydive.
I have set the app up to record the device GPS location every 5 seconds in a foreground service. It seems to be working fine until the user is inside an aircraft, at which point the location may no longer update, or update very infrequently. Location updates will resume when the user has deployed their parachute.
The aircraft is a Cessna Grand Caravan
I can't work out why this may be the case? Could this be something to do with the altitude making the GPS sensor ineffective? Or maybe to do with being inside an aircraft? The location tracking works absolutely fine at ground level such as when tracking a route in a car.
I am collecting location updates the same way as in the Android documentation, available here:
https://developer.android.com/training/location/request-updates
Any help would be greatly appreciated
after researching the Android Location FusedLocationProviderClient I am very confused about what you should and should not do!
The use case is: The App holds different locations with latitude and longitude. While the user is walking around the app (with the phone in the pocket, screen off) needs to track if he is close to one of the locations and plays a short beep when closer than a defined range.
Would the Geofence option the best solution? These locations will also change during runtime and periodically - they might also be more than 100. Any suggestion?
I am also thinking about a background service to handle all this when the device moves. This would be more flexible and allows for the reload of the locations as well. Any thoughts?
Thanks!!
You don't actually need to build a background service to monitor if a user is close to a location. There is already a geofence provided by Google. It uses fusedlocation provider internally.
Please refer this
You can combine this with a FusedLocationProviderClient and subscribe to location updates. This way you'll get location updates as well.
I would create an app with the following features:
The App should be listening to the movement of the accelerometer in the background if the cell move continuously, the app should trigger the GPS system and send every 30 seconds some data to a server such as:
IMEI
Date and time
Latitude
Longitude
Speed
Battery voltage
among others...
I am a beginner, I tried to build it but I did not have success ... Below my code, please help me:
https://drive.google.com/file/d/0BxfW2TCNVyLQNmF1Z1FGeHB0WmM/view?usp=sharing
Try to use Google Play services for location. Checkout these guidelines, you can set time to get location, when location is changed so on and so forth depending upon your requirement.
After few hours of testing outside of house, when i came back to my house i found that GPS is enabled but was not getting location fixes inside the building.Hence its onLocationChanged method couldn't get called.
Problem: How to know that GPS is not getting any location fixes as device continue to sense your location in "trying mode".By trying mode i mean the situation where it is not coming to any result even after 20 to 30 minutes still it declared it self as enabled (blinking in status bar).
How one could know that the GPS doesn't get location so switch to another provider like Network_Provider.
In short i want to get my device to conclude something that GPS can find location fix for sure or you have to take location by another means.
I hope at least someone can give me idea about how to deal with that.
The link below has an awesome tutorial, of how to get the location from GPS and/or Network.
It uses a timer task, which analyzes if there is a GPS location in a specific period of time, assume 20 seconds. If not, it will return the location from Network as the current location. If there is a location from GPS, then it will compare which update is new (latest), and return that.
What is the simplest and most robust way to get the user's current location on Android?
i have working code for an app that receives latitude and longitude --- im working towards a goal that based on this longitude and latitude i set it will turn off the ringer --- its sounds pretty straight forward it just seems like i have programmers block and cant seem to move past this point----so my question is ---in what ways could i utilize the location services in android using eclipse to set a certain longitude and latitude coordinates to a place where when i enter that specific place it turns off the ringer for me or any variation of the ringer on/off/vibrate/silent
This is not really a programming question. You stand a chance of getting voted down because of that.... But, to start you should read up on Location Services and Location Manager. the concept is that you start by getting your "Last Known Location" from location service and begin to dial in your precise location using Network_Service and GPS_Service. From scratch it could take a minute or so to actually get a GPS location and it consumes battery so you have to start and stop "Locating" judiciously to maintain a good location and preserve battery. As for turning the ringer off?? You should also tag this as Android and put some code together or at least an idea and repost.
Make sense? start reading here Android Location