find users nearby cordova like facebook nearby - android

I am working on an android application which can find users nearby. I need help in design that application.
Imagine you are in the street, you connect to the app and will see a gps view
with all other people that have the same app, so i need to see them in my map.
How can i archive this in cordova app?
I am thinking about:
When I start my application, I use API to find my location.
I send that location to my server.
server returns a list of other users nearby.
That can be possible but for that user need to keep open or put app in background for get above task and it will drained all battery.
I need to get functionality that Facebook user for nearby user find. Have you any one help me on this to archive this ?
To be very frank i am confused to what approach i need to be use.
Please guide me.

Related

How to add live location tracking in Flutter even app is terminated?

I want to implement Google Map live location tracking to my application. For example I have two users, one is a carrier and one is a customer. When customer want to see where is my cargo, my application will show carrier's location to customer even carrier's application closed. How can I make this logic? I already tried packages like Workmanager. My application will work IOS and Android both. Do I have to write native code for both? If so, I maybe can write for Android but I dont know IOS side. How popular applications like Whatsapp or Snapchat do that? Is it possible to do this in Flutter?
You should have a look on the following package: https://pub.dev/packages/geolocator. It implemented your use-case by allowing background fetching of the position. It even handles the Foreground service on Android as far as I know.

Real time location sharing with Android

What I need to do is share location from one android device and show it on another device(not necessarily android, even web would be fine). I can think of following solutions as of now.
Use GPS to get latitude and longitude from android device and send it to a server after fixed intervals(eg. 5 sec) which will store it in database(Can we use firebase for this purpose instead of writing full server side code from scratch?). The client which needs to show the location can now request data from server every 5 secs and plot the location on google map. My question is, is this approach scalable?
Is there some Google API that allows real-time location sharing out of the box? I tried searching for it but couldn't find anything like that. Does something like that exist?
Yes, you can use Firebase realtime database for sharing the location.
No, there is no such thing as far as I know.
You may use the Google Places API for Android. For example, if you wanted to get a latitude/longitude based on a user inputted address, you could use the Autocomplete service:
https://developers.google.com/places/android-api/autocomplete
I don't think you will have the scalability issue you imagine, because the strain for finding coordinates would be on a Google server, not yours, as well as the mobile device of your users. You would only need to worry about storing coordinates in a central database somewhere.

Using google maps api to get the location of the users and other users in the vicinity

So, I am thinking of creating this app which is based on the location, (not a dating app) for android, and I got stumbled on a question, can we use google maps api to get the location of the current user using my app(i know we can do the first one) and then based on that location, find the other users using that app in the same vicinity, like in 1-5km's or some distance, can we do that? If so, can someone give me rough idea on doing that? Like where should I get started and everything, because I am a newbie and currently in the "learning" phase of android. Just the rough Idea will be enough.
Any way Android devices unable to communicate on air in such way. You will need server. And you will need get GPS coordinates of your users, send them to server periodically. Filter last coordinates on server side, and by user's request send back list of coordinates people near you. And with use of Google Maps API (or another map service) show them to user. Its in general.

Inform the user about the terms for using the Android app

I have never used Google store before to publish an app and I hope someone will advice me how can I manage the following problem.
I am implemnting an Android app to display the bus location in my city in Google maps view based on Crowd sourcing. The data (lat, long, mac, speed, time, etc.) is being recorded in the background and transmitted to the server. The MAC address is used as identifier for the requester at the server side and I am storing it in the database tables as long as the background tracking service runs.
To use the app, the user has to agree this term when installing the app.
my question: Can I manage this work with google store for example in the Full description area or some where els to get this confirmation from the users or I have to implement the installation process by myself?
There are a lot of users who don't usually read the description, so it's not good to paste the terms in there.
The best way is to show the terms on the first launch of the application.

Sending Coordinates to Google App engine

I am working on an android side project where I have set up my website on google Cloud platform, I am also using Google App engine and setup my database on Google Datastore.
My website consists of a map where I can create fences and send the coordinates of the fences to the app. I have maps activity on my android app and I am trying to figure out how to send the GPS location / coordinates of the mobile to the server every few mins.
So that the I can be able to see the location of the mobile on my website map. It is basically how to track a user. Can anyone please let me know if there is a way to do this? Thanks.
You have two options here that are independent of the underlying architecture you are using currently:
Polling
Sending Broadcast
In the first strategy the server (Google App Engine) shall poll the mobile devices at specific time interval. You can find the code for that easily online in the choice of your language. This would fetch the location of the mobile devices which you can store in the datastore and display on the map of your website.
In the second strategy you can put the sendBroadcast() code/method in your android code. This would enable the device to send the location to the server and you can store them in the datastore and display them on the map.
Hope this Helps!!

Categories

Resources