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?
Related
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.
I am working with the Geofence API Sample application I've got it running and seems to work alright. I did make the modifications to it to use BroadcastReceiver instead of the IntentService.
But I will only get the notifications if I have some other app open that is using GPS such as Maps, or GPS Tester app.
If I don't have one of those apps open and I walk into the geofence zone nothing happens. But as soon as I launch one of them I will get the notification within a few seconds.
I ended up creating a service that forces the GPS to stay active by requesting location updates on a relatively quick interval.
While this is admittedly a poor work around for a "real" application. It worked for my purposes. In which I needed to be able to present a working proof of concept to an audience, which impeded my ability to use a geo points which were further spread out.
Even I too had a struggle with getting Geofence notification as soon I entered Geofence or Exit the one.There were always delays in notifications until I found a really nice Location Library called little-fluffy-location-library which serves my purpose.Location updates will be broadcast to your app periodically.
According the Documentation it says that:
The library works by using Froyo's passive location listener (only possible with Android 2.2 and up, hence why it works best with it), which listens to location updates requested by other apps on your phone. The most accurate location is broadcast to your app approximately every 15 minutes. If a location update hasn't been received from another app for an hour, the library forces a location update of its own.
I think you should give a try with this Library and Let me know if it works for you!!
I want to create an app in appinventor which will be using gps coordinates to show some data. What I mean is that I want to make an app which will show a message whenever you go to an exact position. I already got the GPS coding that needs to be done but I'm not sure if I can save the data to somehow inside the gps. Im new at this so don't be too harsh with me! Is it even possible to do something like that in appinventor?
Unfortunately what you're describing is a service, in which your program runs in the background waiting for the GPS to hit a trigger location. App Inventor at his time does not have the capability to let you program a service.
You have to open your app manually and have it run in the background. As long as all permissions are enabled, it can then send push notifications using the appropriate block. I personally haven't experimented with what they display, but when properly done, it can show an image and text at the same time, one, or the other.
This means you could call the GPS when you reach a certain location, send a push notification with said text/image, which you can then view by the pulldown bar.
You could also have the app send yourself information via a text, replacing this with the push notification block, whenever you reach a certain latitude and longitude.
I have followed this tutorial about how to use the proximity alert and how to register it.
It all works but when I close the app (with the back button, not the home-button) then the proximity alert does not work anymore. Does anyone know how to set it so that it runs in the background?
Thanks in advance!
It seems that you can not get location updates when your application is not running. Receiving location updates in the background is not a good idea since it drains battery power and the user might not be aware that the location is being tracked since the normal behavior for pressing the back button on the application is for it to close all services. If I want my application to continue running in the background, I as a user would press the home button.
Look at the model used by the "My Tracks" application.
Also see the documentation from Android on locations and usage models:
http://developer.android.com/guide/topics/location/obtaining-user-location.html
If you have informed yourself about the reasons not to have the application do this in the background but still want to run this in the background, look into Services
http://developer.android.com/reference/android/app/Service.html
They can run in the background and provide your application with data when asked.
Fundamental part of Android... Services.
http://developer.android.com/guide/topics/fundamentals/services.html
You should get it if you register for it, but keep in mind that proximity alert may not be immediate if your screen is off. If your screen is off, then location is probed for every 4 minutes as stated in the documentation.