I know that there is a technique to update more than 100 geofence to google api client. But I want a complete solution to add more than 100 geofence or any library to achieve it. I already done my project using google api client. But there is limitation off 100 geofence only.
Is there any library or any other technique to update more than 100 geofence?
And all these process should run in background. I mean even after application process is killed, this should run in background. Is it possible?
Thanks in advance.
The issue with having more than 100 geofences is that depending on how close they are in proximity to the user and how many geofences you actually have, it can become a serious battery drain due to constant location polling. I'm not sure how you plan to implement your geofences, but I would suggest you look into loading only geofences within your immediate and surrounding area, storing the rest into a database, and loading/unloading depending on your current location and distance from the edge of the geofences. Bing came up with this nice tiling system that may come in handy for you.
Related
I'm developing an android app fully based on user location, so I would like to receive the coordinates as frequently as possible. For this case I decided to create a service that will run in the background (looping) and use user GPS and NETWORK providers every 10-15 seconds and after it received a fix, turn them off. Is it a good practice?
When you are convinced that you need user accurate location and you need it to be update then you need it. However you can take a look at this answer to understand preferred manner to implement it (of course with a little change)
And please consider using Google Fused Location :
The Google Location Services API, part of Google Play Services, provides a more powerful, high-level framework that automatically handles location providers, user movement, and location accuracy. It also handles location update scheduling based on power consumption parameters you provide. In most cases, you’ll get better battery performance, as well as more appropriate accuracy, by using the Location Services API.
Refrence
I want to create an Android app with a simple concept : if 2 persons who have downloaded my app are crossing in the street, I want to send them a notification (immediately).
I started to use the geofences concept, but I don't know if it is the most appropriate. So my questions are the following :
Using the geofences (every user have his own geofence, so you are notified when entering an other user geofence), how can I make the geofence following the user when he is moving ? (with enough precision but without too much power consumption)
Is there another concept that is more appropriate to my problem than the geofences ?
Thank you :)
Since both persons are in movement, I think you need to call the position frequently and therefore it doesn't make sense anymore to use Geofences. Instead you would calculate the difference between them and push a notification from server when a certain threshold is reached.
if you want use geofences with server side will be more easy for app(in android u only can register 100 geofences) you can check in server the nearest users from you.
but if you need check user very close to you i think is better use Bluetooth, you can emulate ibeacons and the app can register beacon region and monitoring it. dont care gps signal and battery drain. In android you can use altbeacon open source lib for ibeacons/eddystone.
contact me if need more help and sorry my english ;)
I read in the documentation that I can setup geofencing so I know when the user entered/left the geofenced area.
However, I was wondering, can't I get the same behaviour by just taking my current location (ona regular location update) and check the distance with the center of the intended geofence. If it is less than a certain radius then I am within that area.
Wouldn't that have the same effect (infact way less code than geofence)?
Thank you
I believe the advantage of a geofence as opposed to what you describe, is that geofences are objects that come with a lot of extra support in Google Play Services. Using geofences allows multiple different Activities or even Applications to get notifications/callbacks from a single (or set of) geofence objects created elsewhere. These callbacks will happen automatically even if you are in another application because Google Play Services can monitor location in the background without you writing additional code in your Activity, and they can expire on their own. Doing this would be more difficult if you were to roll your own distance calculations as you would have to set it up your own Service framework.
From this answer by CommonsWare:
Geofences are designed to work even without your application running.
However, if your goal is only to check whether you are a certain distance from a geographical point (without caring about what happens when the user goes to check their email or puts their phone back in their pocket), then what you describe might be easier.
I am looking for an easy way to check if a user is at my location (50m) radius if notify me.
Right now I have a service running every two minutes getting position of each user comparing it and then notifying if user in same location.
Can this be done using promixityalert: http://goo.gl/9I857T?
Thanks!
Instead ProximityAlert I would use Geofences.
http://developer.android.com/training/location/geofencing.html
Is newer and does a more effective use of the battery
In your case, you can have a service that sends to the other device the current location every X minutes, so it can update the Geofence. The problem that I see is that there would be a lot of calls, spending battery and the data plan.
A good approach is to use the Location Services API, you can detect if a user is standing or moving.
http://developer.android.com/training/location/activity-recognition.html
Using this and sending new locations only when the user is moving you will be able to reduce the amount of calls.
Parse is another option as #thepace mention. It is easy to use and whit it would be easy to implement what you are trying to do, but is not free :(
Hope it helps.
Issue: Check if any user (multiple and variable location) is within specific radius of my current location(variable).
Solution:
1. Parse.com
a) Ensure every user has their location updated in Parse DB including yours.
https://parse.com/tutorials/anywall-android
b) Use push notificaitons: https://parse.com/docs/push_guide#setup/Android
1> Create a channel wherein only you are subscribed.
2> Create your installation query and send notification to it to the channel subscribed.
I am currently studying a possible project on Android and iPhone.
I need to know if geofences could help me, or if another method should be used.
I think the geofence are not used in this way but I ask anyway.
Is it possible to place a geofence on the current user location (even if it moves) and sending messages when other people come on the geofence position (even they are 100 000) ?
Thank you very much in advance for your answers.
It's do-able but you will be lagging a lot...you will have to get a strong server to get all the positions of the users at a given time and place a listener on each user location s.t. in case his geolocation gets into some geofence every listener should inform its listenee (which will probable be the user class), so far should be good BUT hypothetically 1 user can get into millions other geofences (indicating your start-up is running quite good...) which will require the server to send millions of alert, now think on a million users moving - that means that even if you send just their location you can end up moving a couple of tera-bytes in a second to the server and from it plus requiring it to make more than trillions actions (probabley push notifications?) per second...
It depends on many variables as: radius of your geofences, quantity of users, etc. Notice, that in normal life you never approach 100000 people at one time, well, maybe at the football game. I think nothing is impossible, but a lot of factors need to be reviewed.