finding latitude and longitude of android mobile u

2019-06-11 04:42发布

问题:

i am trying to develop an android app (named ContactListFinder) which follows the following steps

  1. access contact list through android.provider.ContactsContract package
  2. access phone number likewise
  3. calculate the location of the sender and receiver in terms of lattitude and longitude and then find the distance between sender and receiver
  4. pop a message if within coverage area otherwise no message is displayed

Now here the problem is "finding location using mobile number in terms of longtitute and latitute" Any suggestion is welcomed.

回答1:

"Finding location using mobile number in terms of longtitute and latitute" is, by definition, impossible. I have the same phone number everywhere on the planet, because I do not change my SIM card when I travel (domestically or internationally), and I am set up for international roaming.

"Finding location using mobile number in terms of longtitute and latitute, for people who use some sort of 'check-in' service to allow people to know where they are at all times, despite the fact that this sort of opt-in panopticon is truly frightening" may be possible. You would need to find such a service that has an API that allows you to find the location of arbitrary people by phone number. And, you would need both sender and receiver to use one of these services. And, you would need to ensure that your use of these services do not violate any privacy policies or other terms of use.



回答2:

Nice app,you can find user location(longitude,latitude) not by phone number but you can find it using android location-based services provided by LocationManager class.So, you cant access user friends location unless they have app installed.so, you may have to create user community using your app and maintain central database containing all users location information.Hope this will help.