I wanted to integrate the geo fencing with google maps API v2, so how can i? - geofencing

I am new to google maps, my requirement is to create the virtual boundaries on google maps API V2 using geo fencing. I wanted to make an alert when the virtual boundaries are crossed.
So how can i get this done or any useful information regarding it?
Thanks in advance!!

The way how we implemented that is that we created background service which wakes up periodically (every 5 mins for instance) and checks you current location.
Tricky point here is to avoid using GPS data to save battery, but use network location data instead.
As far as I know, there is no native way to create geofencing like in iOS

Related

Why is cloud save recommended for instant games?

On the Instant Play Games site google recommends the following:
Integrate sign-in using Google Play Games Services and a cloud save
solution to preserve progress in the game.
However in this other document the following is stated:
If the player is using a device that runs Android 8.0 (API level 26)
or higher, and if your game specifies a targetSandboxVersion of 2,
then the player's progress is transferred automatically to the full
version of your game. Otherwise, you must transfer the data related to
player progress manually. To do so, use one of the following APIs...
So it seems that cloud saves are not needed, there exists a simple API for transferring progress to the main app. So why is cloud save recommended? Am I missing some aspect or restriction of instant apps?
I found at least one reason for this, which seems critical enough:
The instant app data does not persist over for example restarting the device. More info here.

How to create real time tracking apps like Uber using react native?

I am working with real time tracking application using react-native.
And want the accuracy Uber and Swiggy and other tracking application do.
I am using react-native-geolocation-service, but not getting accuracy like Uber.
I just want to know how Uber track realtime? Does they request to server every single second?
Because there position is moving continuously, which is not possible in my app. I am saving coordinates after every 15 seconds.
Please suggest what can I use for making accurate path?
And what does Uber and other tacking apps used for tracking? And how they get realtime data for every single second?
For getting real time location you can use paid services like https://www.navixy.com/. I have used this service year ago and they are providin lot of functionalities track Android device with their API's.
Try Firebase Realtime database or cloud firestore. It works like realtime data update.
Store lat long on firestore/database whenever there is change in position and within a second you will be able to get those data on other end.
It is having nice performance when it comes to real time data update. I have used it with one of the native application before a year.
For react native, you can use Geolocation api which is having watchposition method. It will be invoked whenever there is location change.

How can i retrieve the live location of a gps module to my database so that i can use it in multiple apps?

I want to track a vehicle and send its coordinate locations to multiple mobile devices at the same time. Is there a way to do that? i also need to send the live feed of the buses' current location Can i do it with agora.io?
Agora Aignaling SDK is perfect for this
You can get started through their demos on Github for different platforms.

Android, Getting inconsistency in User Current Location.?

I am new in android and wanna get user current location using GPS_PROVIDER, but every time getting different-different location how can I use Google Play Services. and what is the best way to get accurate location in android.
Thanks you.
In general there are two different types of locations available through the Android API.
One is the GPS-Location which only works outdoors and which has an accuaracy between 5m and 50m.
The other kind of location is the so called Network-Location which is a loaction measure based on Wifi Networks in you surrounding and GSM-Base-Stations which have a accuracy between 100m and 1500m. This localization technique also works indoors, because it only requires you smartphone to have network access. The accuaracy gets better in urban areas where a lot of Wifi and GSM-Base-Stations are located. The more GSM-Base-Station / Wifi hotspos are available the better is the accurarcy of the loation measurement. It can also get down to 5m.
When requesting such an location Google does internally some magic to compute the position. This request requires a internet connection (you don't need to explicitly give the permission). Interanally Android sends a request to a Google server which contains fingerprints of the surrounding GSM-Base-Stations and afterwards computes your location (if you are curious you can find the code here).
With GPS-bases location the location accurarcy is the same all over the world without any internet connection, but works only outdoors.
With my applications I implemented a logic which detects if GPS is present or not and if not I switched to network localization, this works fine.

GPS code for server

Is there any code for GPS receiver and for GPS net server available?
I want to build complete application: a client for the MS Win Pocket PDA and a server which shows position of my trucks on map. It is easy to find via internet code for GPS receiver (PDA) but I cannot find corresponding part code for server.
If I am understanding you correctly, you want the code to be able to render trucks on a map on your server.
If that is the case, I think that the approach you need depends on the language you are using. Plotting GPS coordinates on an X-Y plane is not a straight forward thing to do, reason being that if you where to cut the surface of the globe into pieces you would not end up with perfect squares, and would thus have to use a technique called Map Projections.
There are various readily available mechanisms provided by companies such a Google provided that you implement a web application. If on the other hand you where looking for a desktop application, SwingX provides a Java API which allows you to build GPS related desktop applications through the use of OpenStreetMaps.
So basically, you can have something as follows:
Create a concurrent server which accepts data from these PDA's and save it in the DB;
At a given period of time, pull the data from your database and refresh your desktop application or web page.
Edit: You can take a look at this tutorial to see how you can draw and plot on a map Using SwingX. If you shall be using Java, you might want to give a look at this previous SO post for more Java mapping API's.