I am developing android application which gives notification when user enter in specific location
User can specify the location by using latitude longitude(ie Google Map)
I know how to get latitude & longitude but my problem is that when user enter in specific location then it will not exactly match with previously specified latitude & longitude.
As shown in image suppose user specify the location called "My Place" when user enter in area (about 20 meter) then application should send notification to user.
I want know how I can compare the latitude & longitude which user specified(My place) and current latitude & longitude which application fetch by GPS.
The comparison made in such way that it will true if user near by of My place in area of 20 meter.
(This 20 meters is approximate.)
Can I set accuracy of in android e.g. 20 meters.
Thank you.
The best approach to this problem is using the GeoFences feature. Please refer to https://developer.android.com/training/location/geofencing.html for more details.
Outline:
- The application registers with the underlying OS - saying - here is MY list of geofences (specific location + radius from the location) that I want you to monitor.
- If my user comes within this geo fence - wake me up and tell me so.
- At that point of time - you can go ahead and perform any step (either call a server and ask what information you need to display to the user) or just send a push notification (in app notification) to do the necessary work.
Hope this helps.
Look at the LocationManager.addProximityAlert function. It does pretty much exactly what you want. Warning, it does use a good amount of battery.
You can make gps pooling calculating with spatial distance functions
There is point sdk (android & ios) from Bluedotinnovation which has more accuracy and less battery drain also similar free sdk from Radar
Radar geofencing is more powerful than native iOS or Android geofencing, with cross-platform support for unlimited geofences, polygon geofences, stop detection, and accuracy down to 30 meters.
Also they have ReactNative support.
Related
I got the current location latitude and longitude while giving on in a switch button in android and displaying the location in google map. But I need the latitude and longitude changes automatically wherever the device moves and the location on the map should change with respect to the position. How is it possible? Can anyone give me a way?
You could have a look at GoogleApiClient.
You can use requestLocationUpdates(...) to get the users position in a given intervall.
You can find more Info here
But honestly you could have find the answer on your own if you googled a bit.
We want our application to get location data when user opens the Activity and check if it's inside a certain boundary of location.
We are able to get the Coordinates of the current phone location now we want to compare it that if it is inside a building location or not. How do we check if the coordinates (lat Long) of the phone is inside a specific radius range?
thanks
You can use google's Geofence API.
new Geofence.Builder().setCircularRegion(latitude,longitude,radius);
https://developer.android.com/training/location/geofencing.html
I've tried to run Geofences sample and I've got little confunsed regarding to how it works.
Prior to go on, I've studied the new APIs and wached this video:
http://www.youtube.com/watch?v=Bte_GHuxUGc&list=WLRNCZT9Eq_HTG5jIEFxMpdqoXZBNalekx
So I jumped coding it. I thought that this API would manage the GPS position's captures automatically, in order to get my position.
So at this point raises my doubt. I've only got notified within a geofence, if I turnned my google map app on so my device starts capturing my location thru GPS.
So, what should I do to have "my app" forcing GPS use ?
I appreciate your help.
Best Regards,
Marlus
I was able to create a map fragment already. I wonder If I can make my app have the ability to detect if you're within around uhmm, 200 meters of a certain landmark ( lat = 14.650778, long = 121.048117). I wonder if detecting if you are near a landmark is possible and how to implement it by showing a notification. Thanks!
You can do this with the GeoFencing functions of Play Services.
https://developer.android.com/training/location/geofencing.html
Create the notifications with this
http://developer.android.com/guide/topics/ui/notifiers/notifications.html#CreateNotification
You can use the the distanceBetween or distanceTo methods of the Location object to find out what is the distance between you desired point and your current position/ clicked location on the map.
and depending on the output, create a notification, you can use this tutorial for notifications:
Notification Tutorial
I am currently working on a GPS tracking App for track packages and parcels right from android smart-phone.
After user finishing put their tracking nO., I would like to be able to analyses this data and find their item information.It also can be track location on GPS to view current location in map-view.
-What would be a good way to smooth the track?
I know that I'll need to implement the tracking in a service, and probably show a notification to user for to easier to know thier item have arrived.
-I have read : Create an Android GPS tracking application
and
https://code.google.com/p/open-gpstracker/
-and also, what is the best way to do connect GPS tracking information with the user data that already have in the website?
like my refr.ex :https://play.google.com/store/apps/details?id=br.com.tribotech.trackpack&hl=en
Firstly, you need to know the API of the package carrier you intend to track packages for. Package carriers always provide an API for programmers to get information about parcels.
Examples
UPS: https://www.ups.com/upsdeveloperkit
NZ Post: http://www.nzpost.co.nz/products-services/iphone-apps-apis/tracking-api
etc..
Then write your app to use these API's. Some carriers may provide a GPS based tracking system, which is what you want for your tracking thing.