Finding a phone's location from its number using GPS - android

I need to find the current longitude and latitude of a mobile phone based on its number with an Android app. I am able to get my own current location data, but I am unable to get my friend's location data. What do I have to do?

Short of having your application installed on the friends mobile and having it activate a share with friends functionality (highly recommended feature for privacy reasons) there is no way of doing this.
Your application could update a server with its current location (with time-stamp) and then the friends could merely poll this data source for the current location.
But as before, steps need to be taken to ensure that the users location isn't leaked to people who shouldn't have access to it and that only authorized friends can see a persons location.

Related

Is there an API to access location history on a mobile device?

I can't seem to find any public API for a third party app to (once authorized) access a mobile user's location history (e.g. what is shown in https://www.google.com/maps/timeline). I know I can track a user's current location and receive updates, but it would be nice to not have to double up on something that a user's mobile device is likely already doing.
Is it true that such an API does not exist whether it is for Android or iOS? If not, are there any plans to?
On iOS, the Core Location visits api may provide what you are looking for.
You will only be able to access locations the user has visited after you have obtained permission.

Would it be possible to track another android device

I am working on building an application that tracks a GPS enabled android device. It is sort of a service to track local taxi network around my place.
now my question is Would it be possible to track another device through the android API, with the consent of the owner of the device?
I am using google maps API to display the map and markers.
EDIT:
To be precise, i would like to track the location and if possible the movement of another GPS enabled device from the user's phone. Lets say the User clicks on a button to know the nearest location of a taxi which is equipped with an android powered GPS device, the user should be given the location of that nearest taxi on his map.
I would like to equip the users to query the location of the taxi through my app.
So would this require a central server to which the GPS in the Taxis send their location information periodically and the user's device will query the server for the Taxi's location?
Or can this be achieved without a dedicated server and by using Google's location service to query the other device through my app?
I went through some docs in the Google play services but they seem to track the location of device which has installed the app rather than getting the location of another remote device.
with the details you have given ... I think one way to do it would to use some sort of cloud where you store the locations (in a database or anything that suits your app),, according to your description I feel you can split users of your app into two categories,
a>users b> taxis
you need to collect their locations periodically and update the data base
you should update the content ( location shown to user ) in app by getting data from data base periodically based on user location and with a predefined radius to show all taxis near users location
then refresh the relevant views based on the category of user, so that the users can see taxis near to them
suggestion: I would suggest you to use cloud server like Parse which makes it very easy to save locations and also provide a very efficient way to retrieve it with just few lines of code.. hope this helps
Update ::
As of my knowledge I think this cant be done without a server since you need some place where you can efficiently save the user data (locations etc) so that you can present the relevant details based on the data saved on server.
What I did and would advice you to this is, firstly my project was to make an uber like app but specifically for buses. My app tracks the location and movement of other Android devices by storing the current location on a realtime database like firebase. There are 2 apps, the user app and the bus app. The bus app sends and updates its current location on to a realtime online database every 50 milliseconds which is firebase. Then the user app retrieves the location from the database and sets a marker onto the map. I hope you understood and I got to help you

Share GPS location with no Server

I have been researching about sharing GPS location with someone without server.
Is it possible to do this?
I used to develop Android application that can share location with friends, but in that case I had a server to keep the GPS data (Latitude, Longitude) so other mobile can request for JSON data to our server and show data on the Google Map on Mobile. But this time, I don't need a server to keep the GPS data, so Is there any solution to solve this problem? I have been considering about to use the data from Google Account, but I don't no how to access the data of Google Account. Is there any API to access it? I guessed that Google knew where we are every time we use the Android Mobile so can we use their data to share our location ?
Thank you for every suggestions and solutions.
What you're describing is a peer-to-peer arrangement. Check out: http://openpeer.org/, which is an Open Source project that just released a beta Android SDK.

Tracking a mobile number using GPS

I am trying to develop an application in android using eclipse .
This application is like finding the friend location and directions using android mobile .
Now my idea to do this is in three steps :
1. tracing the mobile number of friend if he is having the GPS connectivity .
2. then putting that location(latitude, longitude) in Google maps with your location .
3. Google maps gives us the directions and this way we get it (using Google Map key ).
2nd and 3rd steps are done but the I am not able to figure out how to do the 1st part .
Sudhanshu
The user that you want to track needs to install and run an application, that regularly posts the GPS coordinates to your server.
There is no direct support for Step 1, due to obvious reasons.
I would suggest that you use a more legitimate way, by using the Google Latitude api.
tracing the mobile number of friend if he is having the GPS connectivity
IMHO the easiest and best way is to
generate a uniqueID per install.
read the location of that user at some regular interval
and posting the GPS coordinates to your server from the client application.

Find nearby users of an app (iPhone and Android)

I am working on an app that has an iPhone version as well as an Android version.
My goal is...
display a list of nearby users of my app (iPhone app users and Android app users). Lets say a list users which are currently within 1 mile or 2 miles radius and are currently using my app.
This list will display on both apps, iPhone app and Android app.
App will update the list when user clicks a Refresh button.
My question is...
What is the best way to accomplish above stated goal? Do I need to periodically send current GPS location of all users of app from their Droids and iPhones to our web server?
To make my question more clear...
I have an algorithm to find out the places/users within a given range (1 mile or 2 miles radius etc), so PLEASE DON'T TELL ME how to find users within a given range.
I know how to get current location of iPhone and Droid devices, so PLEASE DON'T TELL ME how to get updated location of an iPhone or Android device.
I know that this is a privacy issue. Therefore app will ask for user's permission to send their location to our web server, so PLEASE DON'T TELL ME about privacy concerns users or Apple may have.
JUST TELL ME how to best maintain updated list of Geo Locations of my app users on the web server? The best, proven approach!
Let me know if my question still needs clarification.
Thanks and best regards
Even i had this question on my mind today while creating similar app. Alert when two users/friends are near to each other - Android Proximity
after spending a couple of hours thinking, I thought a better way to do this :
1) Create SharedPreference / DB which holds the last Coordinates of the device which was also updated to the server.
2) Create Service which will fire once in 15 minutes requesting current location.
3) If the current location matches the Last Location retrieved from the SharedPreference and or around within proximity (depends on how much u give 30ft or more) then user is in the same place so don't upload the coordinates to the server.
4) If the user isn't within proximity or last location doesn't match current location then upload the coordinates to the server.
5) After uploading coordinates to the server, update SharedPreference too..
6) After uploading, return response of Users details from the server who are nearby the same coordinates. The User will then get notified if someone around them..
Every update you do will cost battery and data. If you do this too much, you will certainly annoy users by being a resource hog.
I'd suggest creating a service that is called periodically, to update the user's location on the server, and get a list of nearby users from the web server. The frequency of updates should depend on the speed the user was traveling at during their last update. If they weren't moving, 15 minutes is probably alright, if they were going at car speeds, more often is necessary.
In order to store the users locations on the web server, I'd suggest using a purpose built GIS package that actually understands what a location coordinate is. Most databases have something like this built in. Then, when the app requests a list of nearby users, the app only needs to receive the users that are actually nearby, and the others can be ignored, saving some data, and the work of doing distance calculations on the phone.
you should consider following possible issues.
If application keep on sending user's location then the user battery will getting down, and web server memory will increase.
Application will keep on use internet to send location to web server.
At the time of roaming internet data cost may increase.
my suggestions:
The app should send the user's location every 15 minutes.
Every application should use unique id to update their location.
If application closed then clear that app's location in web server.
You should also take a look at scringo . It's an SDK & service that has this exact feature (find nearby users of your app + show it on map, etc...)

Categories

Resources