[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"project-7432":3},{"id":4,"name":5,"fullName":6,"owner":7,"repo":5,"description":8,"homepage":9,"htmlUrl":10,"language":11,"languages":10,"totalLinesOfCode":10,"stars":12,"forks":13,"watchers":14,"openIssues":15,"contributorsCount":16,"subscribersCount":16,"size":16,"stars1d":16,"stars7d":16,"stars30d":16,"stars90d":16,"forks30d":16,"starsTrendScore":16,"compositeScore":14,"rankGlobal":10,"rankLanguage":10,"license":17,"archived":18,"fork":19,"defaultBranch":20,"hasWiki":18,"hasPages":19,"topics":21,"createdAt":10,"pushedAt":10,"updatedAt":22,"readmeContent":23,"aiSummary":24,"trendingCount":16,"starSnapshotCount":16,"syncStatus":25,"lastSyncTime":26,"discoverSource":27},7432,"location-samples","android\u002Flocation-samples","android","Multiple samples showing the best practices in location APIs on Android.","",null,"Kotlin",2703,2721,32,165,0,"Apache License 2.0",true,false,"main",[],"2026-06-12 02:01:39","> **Warning**\n> This sample has been deprecated and is no longer being maintained.\n> \n> Find the new location samples in the new [platform-samples repo](https:\u002F\u002Fgithub.com\u002Fandroid\u002Fplatform-samples\u002Ftree\u002Fmain\u002Fsamples\u002Flocation).\n\n\n~~Google Play Location & Context Samples~~\n======================================\n\nThe [location and context APIs](https:\u002F\u002Fdevelopers.google.com\u002Flocation-context\u002F) harness the sensors and signals of mobile devices to provide awareness of user actions and their environment, enabling delightful and engaging experiences that simplify user interactions, provide assistance, and help users to better understand themselves.\n\nThis repo contains the following samples:\n\n- [Activity Recognition](https:\u002F\u002Fgithub.com\u002Fandroid\u002Flocation-samples\u002Ftree\u002Fmain\u002FActivityRecognition) (Kotlin) - Demonstrates the\n[ActivityRecognitionApi](https:\u002F\u002Fdevelopers.google.com\u002Fandroid\u002Freference\u002Fcom\u002Fgoogle\u002Fandroid\u002Fgms\u002Flocation\u002FActivityRecognitionApi) to determine the user's current activity.\n\n- [AwarenessApisSampleKotlin](https:\u002F\u002Fgithub.com\u002Fandroid\u002Flocation-samples\u002Ftree\u002Fmain\u002FAwarenessApisSampleKotlin) (Kotlin) - Demonstrates use of the [Awareness APIs](https:\u002F\u002Fdevelopers.google.com\u002Fandroid\u002Freference\u002Fcom\u002Fgoogle\u002Fandroid\u002Fgms\u002Fawareness\u002FAwareness#getSnapshotClient(android.app.Activity)) to intelligently react to the current situation of the user. \n\n- [ForegroundLocationUpdates](https:\u002F\u002Fgithub.com\u002Fandroid\u002Flocation-samples\u002Ftree\u002Fmain\u002FForegroundLocationUpdates) (Kotlin) - Get updates about a device's location using a bound foreground service.\n\n- [Geofencing](https:\u002F\u002Fgithub.com\u002Fandroid\u002Flocation-samples\u002Ftree\u002Fmain\u002FGeofencing) (Java) - Create geofences and process enter and exit transitions.\n\n- [LocationAddress](https:\u002F\u002Fgithub.com\u002Fandroid\u002Flocation-samples\u002Ftree\u002Fmain\u002FLocationAddress) (Kotlin) - Use the [Geocode API](http:\u002F\u002Fdeveloper.android.com\u002Freference\u002Fandroid\u002Flocation\u002FGeocoder.html) to display a device's location as an address.\n\n- [LocationUpdatesBackgroundKotlin](https:\u002F\u002Fgithub.com\u002Fandroid\u002Flocation-samples\u002Ftree\u002Fmain\u002FLocationUpdatesBackgroundKotlin) (Kotlin) - Demonstrates the correct way to retrieve location updates in the background.\n\n- [SleepSampleKotlin](https:\u002F\u002Fgithub.com\u002Fandroid\u002Flocation-samples\u002Ftree\u002Fmain\u002FSleepSampleKotlin) (Kotlin) - Demonstrates use of the Sleep API to recognize a user's sleep activity.\n\n\nPrerequisites\n--------------\n\n- Android API Level >v9\n- Android Build Tools >v21\n- Google Support Repository\n\nGetting Started\n---------------\n\nThese samples use the Gradle build system. To build a sample, use the\n\"gradlew build\" command or use \"Import Project\" in Android Studio.\n\nSupport\n-------\n\n- Stack Overflow: http:\u002F\u002Fstackoverflow.com\u002Fquestions\u002Ftagged\u002Fgoogle-play-services\n\nIf you've found an error in these samples, please file an issue:\nhttps:\u002F\u002Fgithub.com\u002Fandroid\u002Flocation-samples\u002Fissues\n\nPatches are encouraged, and may be submitted according to the instructions in\nCONTRIBUTING.md.\n\nLicense\n-------\n\nThese samples are distributed under the terms of the Apache License (Version 2.0).\nSee the [license](LICENSE) for more information.\n","该项目展示了在Android平台上使用位置API的最佳实践。它通过Kotlin语言实现，涵盖了活动识别、环境感知、前台位置更新、地理围栏、地址解析、后台位置更新以及睡眠检测等多个示例，旨在帮助开发者更好地理解和利用移动设备上的传感器和信号来增强用户体验。这些样本适合于需要根据用户行为或环境变化提供个性化服务的应用场景，如健康监测应用、基于位置的服务等。尽管该项目已被弃用且不再维护，但其提供的代码示例仍然具有参考价值。",2,"2026-06-11 03:12:18","top_language"]