草庐IT

gps_unit_location

全部标签

android - 查找位置 : Google Play Location Service or Android platform location APIs

我正在尝试为我的新导航应用程序获取用户位置。我想经常检查用户的位置,它必须是准确的。我使用示例中的以下代码来获取位置。publicclassMainActivityextendsActivityimplementsLocationListener{privateLocationManagerlocationManager;privateStringprovider;privateTextViewa;privateTextViewb;@OverridepublicvoidonCreate(BundlesavedInstanceState){super.onCreate(savedInst

android - Ionic 与 Android 模拟器 : Automatically send location?

我的安卓模拟器有问题。当我关闭并重新打开我的应用程序时,位置不会自动发送。我必须进入ExtendedControls->Location并单击IonicGeolocationgetCurrentPosition函数的“发送”按钮才能接收它。当我启动android模拟器并且应用程序第一次打开时,这不是必需的。知道如何无论如何自动发送位置吗? 最佳答案 一般来说,对于插件的测试,我们需要在真实设备中进行验证,但作为您关于在模拟器中使用它的原始问题,为了解决这个问题,尝试清除cordova缓存(如果您使用的是VisualStudio,您可

android - 从我的 Android 中的 GPS 硬件获得最高的 GPS 更新率

我必须从与GPS一起使用的其他平台对Android进行编程。在其他平台上,我可以访问GPS硬件(我有一个低级GPS驱动程序),这样我每秒可以获得5次甚至更多的GPS更新现在我使用三星GalaxyS2(我很清楚它的GPS非常强大,每秒可以提供几次更新目前,当我将GPS提供商设置为以最短距离和最短时间提供更新时,如下所示:mlocManager.requestLocationUpdates(LocationManager.GPS_PROVIDER,0,0,mlocListener);我每秒更新1次(或两次更新之间的最小间隔为800毫秒),这对我的应用程序来说太低了。有没有办法强制GPS硬件

android - 为什么 play-services-location 需要 android.permission.WRITE_EXTERNAL_STORAGE 和 android.permission.READ_EXTERNAL_STORAGE 权限?

我在AndroidManifest.xml中只有:将APK上传到开发者控制台后,它添加了两个新权限:我的build.gradle:applyplugin:'com.android.application'android{compileSdkVersion22buildToolsVersion"22.0.1"defaultConfig{applicationId"net.perspiratron.ifpaprofile"minSdkVersion15targetSdkVersion22versionCode3versionName"1.2"}buildTypes{release{mini

android - ICS Android 以编程方式启用 gps?

我知道这个问题在这里被问了很多,但只是想知道自从ICS发布后,有没有办法以编程方式启用gps?我正在尝试启用gps并将设备的位置发送到电子邮件,应用程序将在收到短信时启动。 最佳答案 isthereawaytoenablegpsprogrammatically?我希望不会,因为那将是一个隐私漏洞。据我所知,所有允许恶意软件以编程方式启用GPS的已知漏洞现已关闭。amtryingtoenablegpsandsendthelocationofthedevicetoanemail用户控制是否启用GPS。

android - 在 Kitkat (4.4) 中检查 gps 是否开启

在kitkat下方,我知道gps是否在提供者列表中打开Stringproviders=Secure.getString(context.getContentResolver(),Secure.LOCATION_PROVIDERS_ALLOWED);if(TextUtils.isEmpty(providers)){returnfalse;}returnproviders.contains(LocationManager.GPS_PROVIDER);但在kitkat中,Secure.LOCATION_PROVIDERS_ALLOWED已被弃用。Javaodc说“使用Secure.LOCAT

java - 在尝试使用 GPS 之前如何检查它是否已启用

我有以下代码,但它并不好,因为有时GPS需要很长时间我怎样才能做到以下几点:检查GPS是否启用如果启用了GPS,则使用GPS,否则使用网络提供商。如果GPS需要超过30秒,请使用网络。我可以用我自己的逻辑使用时间或Thread.sleep来做到这一点,但我认为可能有更稳定的方法//AcquireareferencetothesystemLocationManagerLocationManagerlocationManager=(LocationManager)this.getSystemService(Context.LOCATION_SERVICE);//Definealistene

android - ACCESS_FINE_LOCATION 权限

我有点害羞。但是找不到问题所在。这是我的list。这是我的代码:publicclassMainActivityextendsAppCompatActivity{LocationManagerlocationManager;LocationListenerlocationListener;@OverrideprotectedvoidonCreate(BundlesavedInstanceState){super.onCreate(savedInstanceState);setContentView(R.layout.activity_main);Toolbartoolbar=(Toolb

以编程方式打开/关闭 Android 设备 GPS

我正在使用以下代码打开/关闭GPS。//EnableGPSIntentintent=newIntent("android.location.GPS_ENABLED_CHANGE");intent.putExtra("enabled",true);context.sendBroadcast(intent);//DisableGPSIntentintent=newIntent("android.location.GPS_ENABLED_CHANGE");intent.putExtra("enabled",false);context.sendBroadcast(intent);我需要以编程

android - 使用 Google API 进行后台位置更新 - Fused Location Provider 不准确

我一直在使用GoogleApiClient进行后台位置更新并进行测试,以进行基于间隔和位移的更新。经过几天的测试和分析,我发现了一些出乎我意料的输出变化。在使用setInterval和setFastestInterval进行基于间隔的更新时,假设我已将Interval设置为15分钟和最快间隔为10分钟,90%的时间我在预期的间隔(10到15分钟)内获得更新。但有时我注意到更新花费的时间比指定的间隔长得多,例如,差异大约是30分钟和60分钟。知道为什么会有差异吗?在使用setMinimumDisplacement进行基于距离的更新时,假设我已将Displacement设置为200米,我只