I have no knowledge in android development nor in ios apps.
Is there a way to get the user's location without my app (android/ios) being open in the background (with the user's acceptance)?
Thanks!
Yes you can have an Android Service that listens for location changes. See LocationManager in service as one example. Depending one what you are doing, the question is how should you start your service.
Related
I want to get location update few times an hour from android device.
I think the following paragraph implies I can achieve what I want..
https://developer.android.com/about/versions/oreo/background-location-limits#tuning-behavior
Consider whether your app's use cases for running in the background
cannot succeed at all if your app receives infrequent location
updates. If this is the case, you can retrieve location updates more
frequently by performing one of the following actions:
Bring your app to the foreground
I understand it as app can receive infrequent location updates without bring your app to the foreground (is my english bad ? :()
Google Map does track where you go without notifying you that "it is tracking you" when the map app is in the background , even when it's killed.
How can I achieve that ?
I've looked at
https://github.com/mauron85/react-native-background-geolocation.
https://github.com/transistorsoft/react-native-background-geolocation
and there seems to no way to not display the notification.
How can I achieve what google Map does?
tracking device location without showing the notification?
Is google having an unfair advantage at this?
I'm working on Android project that related to GPS I still new to android so I don't know a lot about it.
My project is an app where it calculates the distance between user location and a specified other location so if the distance is less than (X) say 1KM the app will send a notification to the user.[[I know how to calculate the distance between two
locations]].
My problem is: how can I do this even if the user didn't open the app (I mean if there's anyway that I can make the app calculates the distance in the background while the app is closed).so I want the GPS feature works in the background.
Thanks in Advance.
You can use a service for background process.
For your question for getting location, you should try these links:
Best way to get user GPS location in background in Android
Get GPS location via a service in Android
My solution for this problem was simply :-
you can use Services for working in the background (when the Activity isn't showing)
check this : -Get GPS location via a service in Android
**if you want this service to run for ever, even if the app is closed/killed you can use broadcast receivers **
To get the app to run in the background, you'll need to learn about a service.
Service is a service that causes applications to run in the background such as gps, notification and more ..
link:
https://developer.android.com/reference/android/app/Service.html
User services. They are simple to use and all you need.
Here is the documentation.
A service is another component of an android application (like activity). You need to define the service in manifest. After that you could start the device using startService (intent). If you need to take some info (communicate with one activity) you can use bindService instead of startService. (Also need to implement onBind).
Another solution is to sendData using a broadcast receiver. Or you can simple set a notification in service and use it.
I'm wondering if you can launch a given Instant App based on the user's location. Is this kind of thing possible? I suppose it would require some kind of server to be always running on the device.
Edit: To clarify a bit, this would be like if App A has a service that tracks the user's location and if they go to a certain spot it would launch Instant App B.
Thanks!
it would need a constant running service and launching the app might be a problem since this particular function could be ransomware like but a notification could be instead that's.
beside that it would a continuous location request at all time.
I'm developing an IOS / Android gps based application that needs to update location always (or after significant location change). Similar to Life360 family locator app. This app doesn't need to start at all and yet when you open the app it has all your location data captured for a week. If I'm checking on my kids location and they don't have their phone actively running the app, I still get the real-time location and their gps history.
How is this accomplished? It seems that the app is logging gps data, not only when in foreground and background but when not running at all. Is there a special run-mode these apps use?
thanks all!
Mike
I can only speak for iOS.
On iOS you can register for significant location changes, and your app will get notified in the background when a location change event occurs (and even get launched in the background if it had been terminated). You can then request background time and transmit your updated location information to your server.
Is it possible to launch an app depending on the user location. I want the app to start only when I enter certain location say my office. I m aware about services running in background but I dont want my app to continuously check for location and deplete the battery.
Is it possible to register for some sort of geo-fencing broadcast ?
You can Create and Monitor Geofences with a standard Google API.
However, if you want to know if you've arrived at your office, I think a better and more battery-friendly way would be to see if you're connected to the office Wifi network.