构建位置感知应用
移动应用的其中一个独特功能是位置感知。移动用户无论走到哪里都会随身携带设备,因此为您的应用添加位置感知功能可给用户带来更契合环境的体验。借助 Google Play 服务中提供的各种地理位置 API,您可以更方便地向应用中添加自动地理位置跟踪、错误街道侧检测、地理围栏和运动状态识别等地理位置感知功能。
开发资源
请求适当的权限
根据应用功能的用例声明权限并发出请求。
接收位置信息更新
使用一体化位置信息提供程序向用户提供相关性更高的位置信息。
优化电量消耗
提高用户设备的电池能效。遵循与后台位置信息限制相关的准则。
将地图添加到您的应用中
在地图上标出感兴趣的地点,允许用户控制地图上显示的内容。
最新资讯
Marvel Strike Force and Google Play Instant join forces to improve install rate
Founded in 2017, FoxNext Games was created to expand the universes of cherished franchises like The Simpsons, Alien, Ice Age, and Avatar through interactive and immersive next-generation storytelling.
OneSoft uses instant apps to boost Galaxy Attack install rate by 15%
With over 50 million reported installs and more than 500,000 five-star ratings, Galaxy Attack is a popular alien shooter game.
Evino attracts new customers with Google Play Instant
With more than a million app customers, Evino is an innovative online wine business based in Brazil.
Ultimate Guitar takes advantage of 10MB limit for instant apps and improves install rate by 8%
With chords and tabs for over 1.1 million songs, Ultimate Guitar (UG) is one of the fastest growing guitarist communities in the world.
其他资源
如需详细了解如何在应用中请求访问位置信息,请参阅下列补充资源:
Codelab
- 通过 Kotlin 在 Android 10 中获取位置信息:了解如何在搭载 Android 10 的设备上请求获取位置信息,包括在应用使用期间请求获取位置信息。