gps

浅析LocationManager的位置定位

落花浮王杯 提交于 2020-02-04 03:32:10
针对定位服务,android的API里提供了LocationManager这么一个类 通过getLastKnownLocation(String provider)以及requestLocationUpdates(String provider, long minTime, float minDistance, LocationListener listener)方法可以获取到当前位置 此类提供两种定位方式:GPS定位和网络定位(基站+WIFI) GPS定位的provider是LocationManager.GPS_PROVIDER, 网络定位则是LocationManager.NETWORK_PROVIDER 不过这两个接口都受限于系统设置,如下图: 如果上面两个开关都关了,自然就无法获取到GPS经纬度了(如何摆脱这种限制通过其他方式获取经纬度在下一章再介绍) (假定开关都打开的前提) GPS定位的获取方式 通过getLastKnownLocation(String provider)传对应参数,此时得到的Location并非当前的GPS位置信息,而是上一次获取到的位置信息 而requestLocationUpdates才是真正去请求位置信息的更新,可以理解为调用该方法后,会安装指定的规则去收集GPS信息,例如你请求locationManager

Ruby on Rails : How to use TCP socket to connect with GPS Device

淺唱寂寞╮ 提交于 2020-02-04 01:16:09
问题 ruby 2.3.0p0 (2015-12-25 revision 53290) [x86_64-linux], Rails 4.2.4 I am using cloud9 IDE and webrick server. My project is to track GPS in real time. I want to use TCP connection to communicate with GPS tracking device which requires to transmit data in hexa decimal format like 0x01. i put the following code in controller. GPS device protocol is confidential . so i am unable to provide that here. my server is running on port 8080. the device sending data to this port. But i don't know how

随机GPS数据(地图坐标)

牧云@^-^@ 提交于 2020-02-03 04:37:19
随机GPS数据(地图坐标) 昨天又接了个小任务,还是GPS的,要做一个随机生成GPS坐标数据的工具,而且要求生成的数据不能太"离谱",也就是说要在一定范围之内,因为是模拟车行,所以可能有个限速的要求吧,不能一辆汽车每小时1w公里的速度行驶。。那就~~! 快下班接的任务~~!然后。。马上关机回家。。吃饭,看了会电视~~!11点了。。才想起来有任务。打开电脑~~! 既然是不能太离谱。。那就要在某个范围内移动。。唉,百度了下经纬度的2点距离公式~~! double lat1,long1;// 经度 , 纬度 1 double lat2,long2;// 经度 , 纬度 2 const float pi = float(3.1415926);//pi const float EarthRadiu = float(6378.245);// 地球半径 float Wei_Km = ( pi * EarthRadiu )/180 ; // 每度纬度多少公里 double lat0; // 比较纬度,取两点小纬度的那个 if(lat1<lat2) lat0 = lat1; else lat0 = lat2; Jing_Km = (pi * (EarthRadiu * float( cos(Lat*pi/180 ))))/180;// 在 lat0 上,每度经度间的距离 double cx, cy,

Kalman Filter for GPS android [closed]

房东的猫 提交于 2020-02-01 02:47:56
问题 Closed. This question is off-topic. It is not currently accepting answers. Want to improve this question? Update the question so it's on-topic for Stack Overflow. Closed 6 years ago . To get a more accurate data from GPS, Kalman filter is being recommended. But I can't find any tutorial how to implement Kalman Filter for GPS, android. 回答1: GPS Data are already heavily Kalman filtered. This is done inside the GPS receiver. Dont expect an accuracy gain in position (lat / lon) if you create your

GPS接收机总结

混江龙づ霸主 提交于 2020-01-29 06:00:20
GPS接收机一般按照是否封装分为板卡和接收机。 接收机一般是厂家在板卡基础上面搭配外围电路封装成整机。 接收机板卡接口一般含有串口、网口。定向功能需要有双天线来实现,定向精度和基线(主天线和副天线)长度有关。主天线用于定位,副天线用于配合主天线定向使用。 定位功能:位置信息包含经纬高即经度纬度高程信息,纬度差0.00001°对应1米,高程结果单位是米。定位数据可以设置数据输出频率,频率越高接收机板卡价格越高。 定向功能:定向数据输出频率不固定,输出频率一般不可控。定向结果是主天线起始指向副天线的方向和地球真北之间的夹角。 GPS时间:GPS输出时间与北京时间相差8小时,需要在结果基础上面加8小时。 观测卫星:GPS系统共有24颗卫星,均分布在6个轨道面上面,可保证地球表面上任意一点都能够观测到4颗以上的卫星。地面上GPS接收机同时接收4颗以上卫星的信号,即可确定自身所在的经纬度、高度及精确时间。可以设置天线俯仰角来设置天线观测到的卫星数量。 单频和双频:单频和双频指L1和L2载波信息,通过接收双频L1和L2双频载波信息,来消除电离层误差,提高定位精度。 差分基准站:差分基准站首先需要得到自身精确坐标,这个精确坐标可以通过测绘局进行测绘或者通过基准站自己取一段时间的定位数据平均值。当接收机板卡执行posave on 指令后即设置为基准站使用

Detect or prevent if user uses fake location

隐身守侯 提交于 2020-01-28 18:15:43
问题 I will block a user from using my app if they fake the location. So I use isFromMockProvider to check if the location is fake (follow here). But isFromMockProvider() may return false for faked locations in some cases. public void onLocationChanged(Location location) { textView.append("long:"+location.getLatitude()+" - lat:"+location.getLongitude()+" - isMock :"+location.isFromMockProvider() + "\n"); } My case is : I use app Fake GPS location for fake to a location then I disable fake location

Detect or prevent if user uses fake location

ぃ、小莉子 提交于 2020-01-28 18:15:08
问题 I will block a user from using my app if they fake the location. So I use isFromMockProvider to check if the location is fake (follow here). But isFromMockProvider() may return false for faked locations in some cases. public void onLocationChanged(Location location) { textView.append("long:"+location.getLatitude()+" - lat:"+location.getLongitude()+" - isMock :"+location.isFromMockProvider() + "\n"); } My case is : I use app Fake GPS location for fake to a location then I disable fake location

How to programmatically enable GPS in Android Cupcake

99封情书 提交于 2020-01-26 09:17:29
问题 I'm currently writing an app in Android that works with the GPS. At the moment I'm able to work out whether the GPS is enabled. My problem is that I want to enable the GPS on app startup if it is disabled. How can I do this programmaticaly? 回答1: You can't, starting with Android 1.5. The most you can do is pop open the activity to allow the user to toggle it on/off. Use the action held in android.provider.Settings.ACTION_LOCATION_SOURCE_SETTINGS to craft an Intent to open this activity. 回答2:

How to programmatically enable GPS in Android Cupcake

最后都变了- 提交于 2020-01-26 09:17:06
问题 I'm currently writing an app in Android that works with the GPS. At the moment I'm able to work out whether the GPS is enabled. My problem is that I want to enable the GPS on app startup if it is disabled. How can I do this programmaticaly? 回答1: You can't, starting with Android 1.5. The most you can do is pop open the activity to allow the user to toggle it on/off. Use the action held in android.provider.Settings.ACTION_LOCATION_SOURCE_SETTINGS to craft an Intent to open this activity. 回答2:

LocationManager is sending Last location all time

拟墨画扇 提交于 2020-01-25 10:01:06
问题 I have involved with location problems. I am getting my first time location and if i tried for next location, it is giving me Last location all time. I changed my location may times but all time, I am getting Last latitude and longitude. I think, GPS don't refresh. If i restarted to my phone and try again. it display to correct location and if i tried again, it is displaying me Last location. I am sharing my source code @Override protected void onResume() { super.onResume(); if(mMap!= null)