草庐IT

source_location

全部标签

android - Bitmap.createBitmap(Bitmap source, int x, int y, int width, int height) 返回错误的位图

我必须裁剪位图图像。为此,我正在使用Bitmapbitmap=Bitmap.createBitmap(imgView.getWidth(),imgView.getHeight(),Bitmap.Config.RGB_565);Bitmapresult=Bitmap.createBitmap(bitmap,imgView.getLeft()+10,imgView.getTop()+50,imgView.getWidth()-20,imgView.getHeight()-100);bitmap.recycle();Canvascanvas=newCanvas(result);imgView

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

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

java - OpenStreetMap 是否有 Point(Source) to Point(Destination) direction uri 在 Android 中使用?

在我的应用程序中,我集成了OpenStreetMap,我在其中获取了源坐标和目标坐标。我需要使用Intent类将这些坐标传递给OpenStreetMap应用程序,为此我需要Uri。经过2天的搜索,我得到了这个Urihttp://www.openstreetmap.org/?mlat=latitude&mlon=longitude&zoom=12目前只支持一个位置,但我不想要它。谁能帮我解决这个问题?提前致谢...下面是我的代码IntentsendLocationToMap=newIntent(android.content.Intent.ACTION_VIEW,Uri.parse("h

android - 膨胀 gzip HTTP 响应正文时获取 "source exhausted prematurely"

当我尝试使用okhttp进行HTTP调用时出现以下错误:W/System.err:java.io.EOFException:sourceexhaustedprematurelyW/System.err:atokio.InflaterSource.read(InflaterSource.java:83)W/System.err:atokio.GzipSource.read(GzipSource.java:80)W/System.err:atokio.Buffer.writeAll(Buffer.java:1135)W/System.err:atokio.RealBufferedSourc

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_

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 - 构建 yasm/source/patched-yasm/util.h :78:23: error: libintl. h 时出错:没有这样的文件或目录

构建将近半小时后,出现以下错误。到目前为止,谷歌搜索没有任何帮助......Infileincludedfromexternal/chromium_org/third_party/yasm/source/patched-yasm/libyasm/phash.c:2:external/chromium_org/third_party/yasm/source/patched-yasm/util.h:78:23:error:libintl.h:Nosuchfileordirectorymake:***[out/host/darwin-x86/obj/STATIC_LIBRARIES/thir