草庐IT

ACTIVATE_LOCATION

全部标签

android - Fused Location Api setSmallestDisplacement 忽略/不工作

我正在尝试创建一个服务,该服务将在每x秒和y距离后接收位置更新。我在x秒后收到更新,但从未在y距离后收到更新。我已经用不同的值对其进行了多次测试,似乎setSmallestDisplacement根本不起作用。关于这个问题有各种帖子,但没有任何解决方案。如果有人可以帮助我,甚至为我指明不同的方向,我将不胜感激。我的服务publicclassGPS_ServiceextendsServiceimplementsGoogleApiClient.ConnectionCallbacks,GoogleApiClient.OnConnectionFailedListener,LocationLis

android - android xpath 中的 "TransformerException: A location step was expected"

我一直在尝试从xml文件中提取数据,但我一直收到此错误,我不确定自己做错了什么。10-2314:20:29.250:WARN/System.err(3541):---------------linkedto------------------10-2314:20:29.250:WARN/System.err(3541):javax.xml.xpath.XPathExpressionException:javax.xml.transform.TransformerException:Alocationstepwasexpectedfollowingthe'/'or'//'token.这是

java - Android 如何使用 location.distanceTo()

我正在使用fragement,我需要获取我当前的位置(纬度和经度)我需要用目标位置计算我当前的位置。你能帮我一下吗?计算位置的最佳方法是什么:如何使用lat和lng获取我当前位置和目的地位置的距离;LocationManagerlocationManager;Locationlocatio;locationManager=(LocationManager)getActivity().getSystemService(Context.LOCATION_SERVICE);location=locationManager.getLastKnownLocation(LocationManage

android - 谷歌位置 API : request location updates with pending intent?

我已经开始使用thistutorial实现GoogleLocationAPI.我已经设法让它在我的应用程序中正常工作,它会以正确的时间间隔更新我的位置等。现在我正在研究如何在设备处于sleep模式时更新我的​​位置。根据documentation,这种方法是要走的路:publicvoidrequestLocationUpdates(LocationRequestrequest,PendingIntentcallbackIntent);我的问题是,如何设置此PendingIntent,以及如何处理它?我看过有关如何处理其他类型Intent的教程,但我不确定如何将它们应用到此。

Window.location用法

Window.location详细介绍本文翻译自@samanthaming发表于dev.to的博文原文地址window.locationCheatsheet-DEVCommunity👩‍💻👨‍💻如果你需要获取网站的URL信息,那么window.location对象就是为你准备的。使用它提供的属性来获取当前页面地址的信息,或使用其方法进行某些页面的重定向或刷新。https://www.samanthaming.com/tidbits/?filter=JS#2window.location.origin→'https://www.samanthaming.com'.protocol→'https:

android - 我想使用 google fused location api 获得准确的位置?

我正在使用FusedlocationApi,我得到的位置精度约为10米。有时它提供4到8米的精度。我希望使用此融合位置Api或任何其他方式获得更高的准确性。有什么方法可以获取精度小于4米的位置。我正在通过这种方式获取位置。publicclassGetCurrentLocationimplementsConnectionCallbacks,OnConnectionFailedListener,LocationListener{privatestaticfinalStringTAG="location-updates-sample";publicstaticfinallongUPDATE_

【conda activate】命令激活以及conda常用命令

目录一、前情:二、解决方法:三、conda相关命令:3.1与环境相关的命令3.1与包相关的命令一、前情:使用conda创建虚拟环境后,进入虚拟环境,然后在虚拟环境中使用pip命令安装某个包(condainstall可供安装的包数量有限)。但是使用condaactivate命令进入虚拟环境时,提起该命令还不可用,需要初始化,如下所示:CommandNotFoundError:Yourshellhasnotbeenproperlyconfiguredtouse'condaactivate'.Ifusing'condaactivate'fromabatchscript,changeyourinvoc

android - LocationServices.FusedLocationApi.removeLocationUpdates(mGoogleApiClient, 这个);尝试转换为 com.google.android.gms.location.LocationListener)

我已经在Android上设置了一个基于位置的map,但是当我尝试调用时:LocationServices.FusedLocationApi.removeLocationUpdates(mGoogleApiClient,this);Androidstudio试图让我将其转换为LocationServices.FusedLocationApi.removeLocationUpdates(mGoogleApiClient,(com.google.android.gms.location.LocationListener)this);然而,这会导致应用程序在调用时崩溃。我的应用有以下位置代码:

android - android.location.LocationManager.PASSIVE_PROVIDER 是什么意思?

我理解GPS_PROVIDER的意思(位置来自GPS信号)和NETWORK_PROVIDER(位置由手机信号塔和无线接入点确定),但我不明白PASSIVE_PROVIDER的含义,尽管API中有定义:Aspeciallocationproviderforreceivinglocationswithoutactuallyinitiatingalocationfix.Thisprovidercanbeusedtopassivelyreceivelocationupdateswhenotherapplicationsorservicesrequestthemwithoutactuallyre

android - 权限 ACCESS_MOCK_LOCATION 被忽略?

我没有做过广泛的测试,但有证据表明应用程序list中的android.permission.ACCESS_MOCK_LOCATION并不像人们假设的那样工作(即如果存在-允许模拟位置提供者,否则不允许)。所以像https://play.google.com/store/apps/details?id=com.lexa.fakegps这样的假GPS应用程序与任何应用程序一起工作,无论它是否设置了ACCESS_MOCK_LOCATION。如果用户允许设备设置中的虚假位置似乎就足够了。也许ACCESS_MOCK_LOCATION真的意味着应用程序本身可以是模拟位置提供者?如果是这样,那么它应