我们可以在Android中通过用户的电话号码定位用户吗?

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/21372685/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-08-20 04:27:11  来源:igfitidea点击:

Can we locate a user via user's phone number in Android?

androidgeolocation

提问by Muhammad Maqsoodur Rehman

Is it possible to locate a user via user's phone number in Android? If an SMS can be sent to the user then we can also retrieve or get to know the location of the user who we sending the SMS.

是否可以在 Android 中通过用户的电话号码定位用户?如果可以向用户发送 SMS,那么我们还可以检索或了解我们发送 SMS 的用户的位置。

I mean is it possible to program the following functionality:

我的意思是可以编写以下功能:

  1. App sends SMS to user's phone
  2. App recieves SMS at user's phone from the SMS sender
  3. App gets location coordinates of the user's phone
  4. App sends location coordinates to the SMS sender via SMS
  1. 应用向用户手机发送短信
  2. 应用程序在用户的手机上接收来自短信发件人的短信
  3. 应用获取用户手机的位置坐标
  4. 应用程序通过短信向短信发送者发送位置坐标

Also is it possible to retrieve the required location of the user via user's phone number via any other means apart from SMS, EMAIL or CALL?

除了 SMS、EMAIL 或 CALL 之外,是否可以通过任何其他方式通过用户的电话号码检索用户所需的位置?

How come Viberand VChatapps are locating user locations via their phone numbers?

ViberVChat应用程序如何通过电话号码定位用户位置?

Here are some apps on the app store:

以下是应用商店中的一些应用:

  1. Cell Tracker
  2. Mobile Number & Phone Location
  3. Mobile Number Locator
  1. 细胞追踪器
  2. 手机号码和电话位置
  3. 手机号码定位器

Seeking for a reliable answer.

寻求可靠的答案。

回答by Smile2Life

Yess, possible with conditions:

是的,可能有条件:

If you have your app installed in the user phone and a server app communicating with this app, and there at last one of location service providers activated in the user phone, and some horrible android permissions!

如果您在用户手机上安装了您的应用程序,并且有一个与该应用程序通信的服务器应用程序,并且在用户手机中至少激活了一个位置服务提供商,以及一些可怕的 android 权限!

In most of android phones there 3 location providers that can give exact location (GPS_PROVIDER 1m) or estimated (NETWORK_PROVIDERaround 2-20m) and PASSIVE_PROVIDER(more in LocationManagerofficial documentation).

在大多数安卓手机中,有 3 个位置提供者可以提供准确的位置(GPS_PROVIDER 1m)或估计(NETWORK_PROVIDER约 2-20m)和PASSIVE_PROVIDER(更多在LocationManager官方文档中)。

1* App sends SMS to user's phone

1* 应用向用户手机发送短信

Yess, can be server app or you create an android app if you want something automated, so you can do it manually by sending SMS from your default SMS app! I use Kannel: Open Source WAP and SMS Gateway and here (lot of APIs to send SMS)

是的,可以是服务器应用程序,也可以创建一个 android 应用程序,如果你想要一些自动化的东西,那么你可以通过从你的默认短信应用程序发送短信来手动完成!我使用Kannel:开源 WAP 和 SMS 网关和这里(很多 API 来发送 SMS

2* App receives SMS at user's phone from the SMS sender

2* 应用在用户手机上接收来自短信发送者的短信

Yess, you can get all received SMS, and you can filter them by sender phone number! and do some actions when your specified sms received, basic tuto here(i do some actions according to the content of my SMS)

是的,您可以获取所有收到的短信,并且可以通过发件人电话号码过滤它们!并在收到您指定的短信时执行一些操作,基本教程在这里(我根据我的短信内容执行一些操作)

3* App gets location coordinates of the user's phone

3* App 获取用户手机位置坐标

Yess, you can get actual user coordinates easily if one of location providers is activated, so you can get last known location when the user have activated one of location providers, if those disabled or the phone don't have GPS hardware you can use Open Cell Id apito get the nearest cell coordinates(10m-10Km) or Loc8api but those not available in all around the world, and some apps use IP location apisto get the country, city and province, here the simplest way to get current user location.

是的,如果位置提供程序之一被激活,您可以轻松获得实际用户坐标,因此当用户激活位置提供程序之一时,您可以获得最后已知的位置,如果那些被禁用或手机没有 GPS 硬件,您可以使用Open Cell Id api获取最近的单元坐标(10m-10Km)或Loc8api 但这些在世界各地都没有,一些应用程序使用IP 位置 apis来获取国家、城市和省份,这里是获取当前最简单方法用户位置

4* App sends location coordinates to the SMS sender via SMS

4* 应用通过短信向短信发送者发送位置坐标

Yess, you can get sender phone number and send user location, immediately when SMS received or at specified times in the day.

是的,您可以在收到短信后立即或在一天中的指定时间获取发件人电话号码并发送用户位置。

(Those 4 yesses for you :) )

(这 4 个是给你的 :) )

Viber and other apps that access to users locations, identify there users by there phone numbers by obligating them to send SMS to the server app to create an account and activate the free service (Ex:VOIP) , and lunch a service that can:

Viber 和其他访问用户位置的应用程序,通过强制用户向服务器应用程序发送 SMS 以创建帐户并激活免费服务(例如:VOIP),通过电话号码识别用户,并提供可以:

  • Listen for location changes (GPS, Network or Cell Id)
  • Send user location periodically(Ex: each 2 hours) or when user position changed!
  • Stock user locations in file and create a map based on daily locations
  • Receive SMS and update user location
  • Receive server app commend and update user location
  • Send events when user go inside or outside of a defined circle
  • Listen for what user say and record it or open live voip call :s
  • Maybe anything you think or u want to do :) !
  • 侦听位置变化(GPS、网络或小区 ID)
  • 定期(例如:每 2 小时)或当用户位置发生变化时发送用户位置!
  • 在文件中存储用户位置并根据每日位置创建地图
  • 接收短信并更新用户位置
  • 接收服务器应用推荐并更新用户位置
  • 当用户进入或离开定义的圆圈时发送事件
  • 听用户说了什么并记录下来或打开实时 voip 电话 :s
  • 也许您想或想做的任何事情:)!

And your application users must accept all of that when installing it, of corse i don't gonna install apps like this because i read permissions before installing :) and permissions maybe something like that:

并且您的应用程序用户在安装时必须接受所有这些,当然我不会安装这样的应用程序,因为我在安装之前阅读了权限:) 权限可能是这样的:

<uses-permission android:name="android.permission.RECEIVE_SMS"></uses-permission>
<uses-permission android:name="android.permission.READ_SMS" />
<uses-permission android:name="android.permission.SEND_SMS"></uses-permission>

<uses-permission android:name="android.permission.ACCESS_FINE_LOCATION" />    
<uses-permission android:name="android.permission.INTERNET" />
<-- and more if you wanna more -->

The final user will accept for something like that (those permissions of an android app u asked about):

最终用户将接受类似的内容(您询问的 android 应用程序的权限):

This app has access to these permissions:

此应用可以访问以下权限:

Your accounts-create accounts and set passwords -find accounts on the device -add or remove accounts -use accounts on the device -read Google service configuration

您的帐户 - 创建帐户并设置密码 - 在设备上查找帐户 - 添加或删除帐户 - 在设备上使用帐户 - 读取 Google 服务配置

Your location-approximate location (network-based) -precise location (GPS and network-based)

您的位置- 大致位置(基于网络) - 精确位置(基于 GPS 和网络)

Your messages-receive text messages (SMS) -send SMS messages -edit your text messages (SMS or MMS) -read your text messages (SMS or MMS)

您的信息- 接收短信 (SMS) - 发送短信 - 编辑您的短信(短信或彩信) - 阅读您的短信(短信或彩信)

Network communication-receive data from Internet -full network access -view Wi-Fi connections -view network connections -change network connectivity

网络通信- 从 Internet 接收数据 - 完全网络访问 - 查看 Wi-Fi 连接 - 查看网络连接 - 更改网络连接

Phone calls-read phone status and identity -directly call phone numbers

电话 -读取电话状态和身份 - 直接拨打电话号码

Storage-modify or delete the contents of your USB storage

存储 - 修改或删除 USB 存储的内容

Your applications information-retrieve running apps -close other apps -run at startup

您的应用程序信息 -检索正在运行的应用程序 - 关闭其他应用程序 - 在启动时运行

Bluetooth-pair with Bluetooth devices -access Bluetooth settings

蓝牙 -与蓝牙设备配对 - 访问蓝牙设置

Camera-take pictures and videos

相机- 拍摄照片和视频

Other Application UI-draw over other apps

其他应用程序 UI -绘制其他应用程序

Microphone-record audio

麦克风 -录制音频

Lock screen-disable your screen lock

锁屏 -禁用您的屏幕锁定

Your social information-read your contacts -modify your contacts -read call log -write call log -read your social stream -write to your social stream

您的社交信息 -读取您的联系人 - 修改您的联系人 - 读取通话记录 - 写入通话记录 - 读取您的社交流 - 写入您的社交流

Development tools-read sensitive log data

开发工具——读取敏感日志数据

System tools-modify system settings -send sticky broadcast -test access to protected storage

系统工具 - 修改系统设置 - 发送粘性广播 - 测试对受保护存储的访问

Affects battery-control vibration -prevent device from sleeping

影响电池 -控制振动 -防止设备休眠

Audio settings-change your audio settings

音频设置 -更改您的音频设置

Sync Settings-read sync settings -toggle sync on and off -read sync statistics

同步设置-读取同步设置-toggle和关闭-读取同步统计信息同步

Wallpaper-set wallpaper

壁纸-设置壁纸

回答by Priti

I checked play.google.com/store/apps/details?id=and.p2l&hl=en They are not locating the user's current location at all. So based on the number itself they are judging the location of the user. Like if the number starts from 240 ( in US) they they are saying location is Maryland but the person can be in California. So i don't think they are getting the user's location through LocationListner of Java at all.

我检查了 play.google.com/store/apps/details?id=and.p2l&hl=en 他们根本没有定位用户的当前位置。因此,根据数字本身,他们正在判断用户的位置。就像如果数字从 240(在美国)开始,他们说的位置是马里兰州,但这个人可以在加利福尼亚州。所以我认为他们根本没有通过 Java 的 LocationListner 获取用户的位置。

回答by josephus

Quick answer: No, at least not with native SMS service.

快速回答:不,至少不是使用本机 SMS 服务。

Long answer: Sure, but the receiver's phone should have the correct setup first. An app that detects incoming sms, and if a keyword matches, reports its current location to your server, which then pushes that info to the sender.

长答案:当然可以,但接收者的电话应该首先进行正确的设置。检测传入短信的应用程序,如果关键字匹配,则将其当前位置报告给您的服务器,然后将该信息推送给发件人。

回答by Lukas

The answer is: you can't only through sms, i have tried that approach before.

答案是:你不能只通过短信,我以前试过这种方法。

You couldfetch the base station IDs, but this won't help you a lot without the location of the base station itself and this informations are really hard to retrieve from the providers.

可以获取基站 ID,但是如果没有基站本身的位置,这对您无济于事,而且这些信息很难从提供商处检索。

I have looked through the 3 apps you have listed in your question:

我查看了您在问题中列出的 3 个应用程序:

  1. The App uses WiFi and GPRS location service, quite the same approach as Google uses on the phone. phonesavvy maybe has a base station location database or uses a database retrieved e.g. from OpenStreetMap or some similar crowd-based project.
  2. The app analyzes just the number for country code and city code. No location there.
  3. Dito.
  1. 该应用程序使用 WiFi 和 GPRS 定位服务,与 Google 在手机上使用的方法完全相同。phoneavvy 可能有一个基站位置数据库或使用从 OpenStreetMap 或一些类似的基于人群的项目中检索到的数据库。
  2. 该应用程序只分析国家代码和城市代码的数字。那里没有位置。
  3. 迪托。