Android launch your app based on user location - android

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.

Related

getting infrequent location update without notification?

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?

Is it possible to launch an Instant App based on location?

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.

IOS App auto running in background

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.

Receiving location information without having my app open in the background

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.

Android GPS battery usage

I am writing a program in Android that uses GPS. It will prompt the user to turn on location services if it is not on (which I guess is equivalent to turning on gps ?). My question is: does the gps immediately start consuming extra battery power as soon as location services is turned on or it uses batter power whenever the location services is queried/used for a new location ?
The GPS starts working only when the location manager requests an update from it. Turning on the GPS in the device only allows programs to request locations if they want, but it doesn't mean the GPS is kicking in.
You can test it yourself: The GPS icon in the notification bar tells the GPS status. You can turn on the GPS, but the icon won't appear. Why? No application requests updates now. As soon as an application requests an update, the icon starts blinking (The GPS is initializing itself) and when it stops, it means the GPS is initialized and is currently receiveng updates.
The GPS consumes battery only when this icon appears.
My company wrote a blog post on this subject a while back. Check to see if its useful.
http://www.littleeye.co/blog/2013/03/29/understanding-gps-resource-usage/
But we missed talking about what happens when no app is actually requesting for a location update. And yes, as mentioned unless apps actually ask for a location update, they will not cause power drain. But note that even a single request for a location update (depending on coarse or fine grained request) can have unintended effects, as the device has to go thro various states before it can get back to its steady state.
Turning on location services is just permission given by user to applications for using location services. As long as any application not asks for location, power consumption is the same as with location sesrvices turnded on.
On the other hand - there is many applications trying to get location. Facebook, Camera, Android, many of ads libs, so yes - user can get battery life issues when GPS is unlocked.

Categories

Resources