了解位置数据外文翻译资料

 2022-07-25 09:07

How accurate is Android GPS? Part 1: Understanding Location Data

by agup Posted: Sunday, 1/27/2013

There are many different ways for developers to get access to location information using the Android SDK, and there are already plenty of code examples on the internet showing how to do that. This post, on the other hand, focuses on putting the location data into context and offers suggestions on how to use it in the best possible way. In this series Irsquo;ll discuss various aspects of the Android SDKrsquo;s android.location package and how you can best take advantage of them to build a great end-user experience.

To try out GPS different usage scenarios, be sure to download the GPSTester app, both the .apk and source code are available on github.

Six types of location data

Itrsquo;s not just about latitude and longitude. The great thing about the Android SDK is you get access to a ton of information related to location. The fun, challenging and sometimes frustrating part is deciphering the information. There are six types of location data that you have programmatic access to. This data comes from whatrsquo;s referred to as a provider, and it will be either a cellular network-based or a GPS provider. As yoursquo;ll see, you can use these providers in a variety of different ways.

All locations derived from the LocationManager are guaranteed to provide a valid latitude, longitude and timestamp, all the other parameters are optional depending on who manufactured the handset and who is providing cellular service. However, if you have a device that doesnrsquo;t give you access to the accuracy parameter then the location data is practically worthless. I havenrsquo;t come across such a device yet, but Irsquo;m assuming itrsquo;s possible. My advice: always check for null location parameter values in your production code.

Cached GPS. Most Androids have the ability to store the last know GPS location. This is typically used when an application first starts up, and you can retrieve the timestamp, latitude, longitude and accuracy.

1

locationManager.getLastKnownLocation(LocationManager.GPS_PROVIDER);

Cached Network. Android devices can also store the last known location as determined by the cellular carrierrsquo;s network location provider. The provider gathers information from the cell network and WiFi, if itrsquo;s turned on, then sends that off to a remote server-side process that crunches the information and sends back an approximate location. This is not available in all countries. Just like the GPS, yoursquo;ll typically retrieve the timestamp, latitude, longitude and accuracy.

1

locationManager.getLastKnownLocation(LocationManager.NETWORK_PROVIDER);

Real-time GPS. This is the raw information that is streamed off the GPS. When a GPS is first turned on it wonrsquo;t immediately return any information, it has to basically warm up first. The warm up time varies by device and can typically take from one minute or longer if you are inside a building. More on that in a bit. Depending on what your provider allows you can get access to timestamp, latitude, longitude, altitude, bearing, speed, accuracy and distance travelled.

1

locationManager.requestLocationUpdates(LocationManager.GPS_PROVIDER,time,distance,listener);

Real-time Network. This is the raw network location provider information returned by the cellular carrier, such as ATamp;T in the U.S. Different carriers use different information to determine location such as WiFi data, GPS information, nearby cell towers, etc. Depending on what your carrier allows, you can get access to timestamp, latitude, longitude, altitude, accuracy and distance travelled.

1

locationManager.requestLocationUpdates(LocationManager.NETWORK_PROVIDER,time,distance,listener);

Passive. This option just means that your application can listen for location updates while it is in a minimized state. The idea is to save battery power, such that your applications providers arenrsquo;t running full speed ahead while the app is miminized. That would be huge battery drain. Passive location can listen for another application to request location updates. You may be able to get access to timestamp, latitude, longitude, altitude and accuracy. As far as I know, you wonrsquo;t be able to determine from which provider this information was derived.

1

lt;receiver android:name='.PassiveLocationChangedReceiver' android:enabled='true'/gt;

NMEA. Although itrsquo;s not human readable, you can get access to the raw NMEA strings. Typically these strings are used for programmatic access and would only make sense to a developer or engineer. This data is often used in maritime apps. The data is only available once the GPS has warmed up, which is a concept discussed in more detail below.

1

addNmeaListener(GpsStatus.NmeaListene

全文共25836字,剩余内容已隐藏,支付完成后下载完整资料


GPS的精确使用

Part 1: Understanding Loc ation Data第1部分:了解位置数据

作者Andy Gup

作者aA发布时间:周日,2013年1月27日

开发人员有许多不同的方式可以使用Android SDK获取位置信息,并且在互联网上已经有大量的代码示例显示如何做到这一点。这篇文章中,侧重于将位置数据放入背景和提供建议如何以最好的方式使用它。在本系列中我将讨论Android SDK的安卓系统的各个方面。位置包和如何最好的利用它们来建立一个伟大的终端用户体验。

尝试GPS不同的使用场景,一定要下载GPSTester应用,apk和源代码可用在github上。Six types of location data

六个类型的位置数据

It#39;s not just about latitude and longitude.不仅仅是纬度和经度。Android SDK的伟大之处是你获得大量的信息与位置有关。有趣,有挑战性,有时令人沮丧的是解密信息。有六种类型的位置数据编程访问。这些数据来自被称为一个提供者,它将移动网络或GPS提供者。正如您所见,您可以在各种不同的方式使用这些供应商。

保证提供一个有效的纬度,经度和时间戳,所有其他参数都是可选的取决于谁制造手机,谁是提供移动电话服务。然而,如果你有一个设备,并不给你访问精度参数位置数据几乎是毫无价值的。我还没有遇到这样的装置,但我假设这是有可能的。我的建议是:总是检查空位置在生产代码中参数值。

Cached GPS . 缓存GPS ,Most Androids have the ability to store the last know GPS location.大多数Android具有存储的最后知道GPS位置的能力。 This is typically used when an application first starts up, and you can retrieve the timestamp, latitude, longitude and accuracy.这通常用于在应用程序第一次启动时,你可以获取到时间戳,纬度,经度和准确性。

1

locationManager.getLastKnownLocation(LocationManager.GPS_PROVIDER);locationManager.getLastKnownLocation(LocationManager.GPS_PROVIDER);

Cached Network . 缓存网络 ,Android devices can also store the last known location as determined by the cellular carrier#39;s network location provider.Android设备还可以存储最后一个已知的由蜂窝运营商的网络位置提供确定​​的位置。 The provider gathers information from the cell network and WiFi, if it#39;s turned on, then sends that off to a remote server-side process that crunches the information and sends back an approximate location.提供者收集来自细胞网络和WiFi信息,如果它接通,则发送一个关闭到远程服务器端过程仰卧起坐的信息,并发送回一个大致位置。 This is not available in all countries.这并非在所有国家提供。

locationManager.getLastKnownLocation(LocationManager.NETWORK_PROVIDER);

Just like the GPS, you#39;ll typically retrieve the timestamp, latitude, longitude and accuracy.Real-time GPS . 实时GPS, This is the raw information that is streamed off the GPS.这是原始的GPS信息。当GPS是第一次打开它不会立即回复任何信息,它基本上先暖身。预热时间因设备而异,如果你在一个建筑。通常可以一分钟或更长时间,更详细的介绍了一下。 取决于你的提供者允许您可以访问时间戳、纬度、经度、高度、轴承、速度、准确,性和行驶距离。

locationManager.requestLocationUpdates(LocationManager.GPS_PROVIDER,time,distance,listener);

Real-time Network. This is the raw network location provider information returned by the cellular carrier, such as ATamp;T in the US Different carriers use different information to determine location such as WiFi data, GPS information, nearby cell towers, etc. Depending on what your carrier allows, you can get access to timestamp, latitude, longitude, altitude, accuracy and distance travelled. 实时网络, 这是原始网络位置提供者信息返回的细胞载体,如美国电话电报公司(ATamp;T)在美国不同的运营商使用不同的信息来确定位置如无线数据、GPS信息,附近的基站,等等。这取决于你的运营商允许,你可以访问时间戳,纬度,经度,高度,准确性和行驶距离。

locationManager.requestLocationUpdates(LocationManager.NETWORK_PROVIDER,time,distance,listener);

Passive .被动 , 这个选项只是意味着你的应用程序可以监听位置更新时处于最小化状态。The idea is to save battery power, such that your applications providers aren#39;t running full speed ahead while the app is miminized.这样做是为了节省电池电量,这样您的应用程序供应商没有运行全速前进。这将是巨大的电池消耗。被动的位置可以侦听另一个应用程序请求位置更新。你可以获得时间戳、纬度、经度、海拔和准确性。据我所知,你无法确定从哪个提供者这信息。

lt;receiverandroid:name='.PassiveLocationChangedReceiver'android:enabled='true'/gt;

NMEA. Although it#39;s not human readable, you can get access to the raw NMEA strings. NMEA,虽然它不是人类可读的,你可以访问原始的NMEA字符串。通常这些字符串用于编程访问,只会让开发人员或工程师访问。这些数据通常是用于海上应用。数据只可用一次GPS热身,这是一个概念在下面更详细地讨论。

1

addNmeaListener (GpsStatus.NmeaListener); addNmeaListener(GpsStatus.NmeaListener);

Working with cached locations 使用缓存的位置

Working with cached locations is an interesting problem because the first location you get is not going to be the most accurate, and typically it can be wildly inaccurate compared to your actual, physical location.使用缓存的地点工作是一个有趣的问题,因为你得到的第一个位置是不会是最准确的,通常它可以比作实际的物理位置是极不准确。 Think of the location capabilities on the device as being similar to a car engine on a cold morning.想想设备上的定位功能作为类似于在一个寒冷的早晨,汽车发动机。 The engine needs to warm up first before it can perform optimally, and this typically takes a few minutes.发动机需要预热第一,才可以达到最佳性能,而这通常需要几分钟。 And once the engine is warmed up, if you make a quick stop at the grocery store the engine will still be mostly warm when you come back out.一旦发动机升温,如果你在杂货店做一个快速停止,发动机仍然会主要是温暖的,当你回来的。

使用缓存的位置是一个有趣的问题,因为你得到的第一位置不会是最准确的, 通常它和实际的物理位置相比是极不准确。好比设备上的位置的功能是类似于汽车发动机在一个寒冷的早晨。发动机需要预热第一,才可以达到最佳性能,而这通常需要几分钟。一旦发动机升温,如果你在杂货店做一个快速停止,发动机仍然会是温暖的。

位置提供者组件的行为方式非常相似。当一个应用程序第一次启动了提供者可能是“冷”。唯一的信息将通过直接访问网络缓存,缓存的GPS和被动监听器。另外,如果应用程序启动时,供应商仍然温暖甚至热,那么你将得到更好的精度与缓存的结果和实时位置可能会很快开始流。

Cached locations aren#39;t always best 1st choice. When an app first launches, the inclination of many developers is to simply grab the cached location data and use that as a starting point, but as implied abovehellip;be careful! 缓存的位置并不总是最好的第一选择。当一个应用程序首次启动,众多开发商的倾向是简单地抓取缓存的位置数据,并把它作为一个出发点,但正如上文暗示的......要小心! Caveat emptor applies here.购者自慎在这里也同样适用。 Cached locations are simply the very last result stored on the phone and it#39;s not always what you expect.缓存的位置仅仅是存储在手机上的最后的结果,你所期望它并非总是如此。 As you can see from the Cached Network Provider screenshot taken from the GPSTester app, the accuracy of that data snapshot is 1780 meters (1.1 miles).正如你可以从GPSTester应用程序所采取的缓存网络提供的截图看到,数据快照的准确性1780米(1.1英里)。 Keeping that in mind, consider these use cases:牢记这一点,考虑这些用例:

Business traveler – You last opened the a

全文共8362字,剩余内容已隐藏,支付完成后下载完整资料


资料编号:[154485],资料为PDF文档或Word文档,PDF文档可免费转换为Word

原文和译文剩余内容已隐藏,您需要先支付 30元 才能查看原文和译文全部内容!立即支付

以上是毕业论文外文翻译,课题毕业论文、任务书、文献综述、开题报告、程序设计、图纸设计等资料可联系客服协助查找。