{"id":15111188,"url":"https://github.com/birjuvachhani/locus-android","last_synced_at":"2025-04-05T22:09:15.157Z","repository":{"id":43208290,"uuid":"156821431","full_name":"BirjuVachhani/locus-android","owner":"BirjuVachhani","description":"An Awesome Kotlin Location library to retrieve location merely in 3 lines of code","archived":false,"fork":false,"pushed_at":"2023-09-14T06:26:41.000Z","size":1242,"stargazers_count":365,"open_issues_count":15,"forks_count":40,"subscribers_count":8,"default_branch":"master","last_synced_at":"2025-03-29T21:05:39.174Z","etag":null,"topics":["android","android-development","android-library","android-location","android-permission","android-studio","fusedlocationproviderclient","hacktoberfest","hacktoberfest-accepted","hacktoberfest2023","kotlin-android","kotlin-android-extensions","kotlin-dsl","kotlin-extensions","kotlin-language","location"],"latest_commit_sha":null,"homepage":"https://birju.dev/posts/retrieve-location-in-just-3-lines-android/","language":"Kotlin","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/BirjuVachhani.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE","code_of_conduct":"CODE_OF_CONDUCT.md","threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2018-11-09T06:43:13.000Z","updated_at":"2025-03-21T06:51:26.000Z","dependencies_parsed_at":"2024-10-23T03:17:03.605Z","dependency_job_id":null,"html_url":"https://github.com/BirjuVachhani/locus-android","commit_stats":null,"previous_names":[],"tags_count":25,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/BirjuVachhani%2Flocus-android","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/BirjuVachhani%2Flocus-android/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/BirjuVachhani%2Flocus-android/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/BirjuVachhani%2Flocus-android/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/BirjuVachhani","download_url":"https://codeload.github.com/BirjuVachhani/locus-android/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247406091,"owners_count":20933803,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["android","android-development","android-library","android-location","android-permission","android-studio","fusedlocationproviderclient","hacktoberfest","hacktoberfest-accepted","hacktoberfest2023","kotlin-android","kotlin-android-extensions","kotlin-dsl","kotlin-extensions","kotlin-language","location"],"created_at":"2024-09-26T00:02:17.879Z","updated_at":"2025-04-05T22:09:15.095Z","avatar_url":"https://github.com/BirjuVachhani.png","language":"Kotlin","funding_links":["https://www.buymeacoffee.com/birjuvachhani"],"categories":[],"sub_categories":[],"readme":"![banner](https://github.com/BirjuVachhani/locus-android/blob/master/new_banner.png)\n\n# Locus-Android\n\n[![License](https://img.shields.io/badge/License-Apache%202.0-2196F3.svg?style=for-the-badge)](https://opensource.org/licenses/Apache-2.0)\n[![language](https://img.shields.io/github/languages/top/BirjuVachhani/location-extension-android.svg?style=for-the-badge\u0026colorB=f18e33)](https://kotlinlang.org/)\n[![Platform](https://img.shields.io/badge/Platform-Android-green.svg?style=for-the-badge)](https://www.android.com/)\n[![API](https://img.shields.io/badge/API-16%2B-F44336.svg?style=for-the-badge)](https://android-arsenal.com/api?level=16)\n[![Release](https://jitpack.io/v/BirjuVachhani/locus-android.svg?style=flat-square)](https://jitpack.io/BirjuVachhani/locus-android)\n\nLocus is a tiny kotlin library for android which makes it super very easy to retrieve location with just few lines of\ncode. Everything including permission model and Location settings resolution is handled internally which removes a lot\nof boilerplate code any developer have to write every time.\n\n# Looking for Maintainers\n\nIts been a long time since I moved away from native Android development so I am finding it hard to keep up with the latest changes with the location\npermissions in newever Android versions and fix issues reported here. I'd love someone to actively maintain this library and look into the issues. If you are interested and up to the task, drop a mail at `brvachhani@gmail.com` or comment on [this issue](https://github.com/BirjuVachhani/locus-android/issues/74). Thanks!\n\n### Documentation:\n\nSee [Wiki](https://github.com/BirjuVachhani/locus-android/wiki) for more information and configuration!\n\n### Read blog here:\n\n#### [The Legendary Task of Retrieving Location in Just 3 lines of code.](https://birju.dev/posts/retrieve-location-in-just-3-lines-android/)\n\n## Features\n\n* Android R support (Please report if any issue is found)\n* Completely written in Kotlin\n* Easy Initialization\n* Handles Permission Model\n* No Boilerplate\n* Built on Kotlin DSL\n* Manifest Permission Check\n* Life-Cycle Aware Location Updates\n* Location Settings Check\n* Location Settings Request\n* Custom Location Options Configuration\n* Custom Rationale Dialog configuration\n* Custom Permission Blocked Dialog configuration\n\n## IMPORTANT:\n\n### Breaking Changes from v4.0.0\n\n\u003e Text Customizations using `Locus.configure{}` block which were deprecated in `v3.2.0` have been now removed completely. This means `rationaleText`, `rationaleTitle`, `blockedTitle`, `blockedText`, `resolutionTitle`, and `resolutionText` no longer exist on `Locus.configure{}`. Migration would be to customize/override them from `strings.xml`.\n\n#### Before\n\n```kotlin\nLocus.configure {\n    rationaleTitle = \"Rationale Title\"\n    rationaleTitle = \"This is a rationale message.\"\n    blockedTitle = \"Permission Blocked Title\"\n    blockedText = \"This is a permission blocked message.\"\n    resolutionTitle = \"Permission Resolution Title\"\n    resolutionText = \"This is a permission resolution message.\"\n}\n```\n\n#### Now\n\n*strings.xml*\n\n```xml\n\n\u003cstring name=\"locus_rationale_title\"\u003eRationale Title\u003c/string\u003e\n\u003cstring name=\"locus_rationale_message\"\u003eThis is a rationale message.\u003c/string\u003e\n\u003cstring name=\"locus_permission_blocked_title\"\u003ePermission Blocked Title\u003c/string\u003e\n\u003cstring name=\"locus_permission_blocked_message\"\u003eThis is a permission blocked message.\u003c/string\u003e\n\u003cstring name=\"locus_location_resolution_title\"\u003ePermission Resolution Title\u003c/string\u003e\n\u003cstring name=\"locus_location_resolution_message\"\u003eThis is a permission resolution message.\u003c/string\u003e\n\u003cstring name=\"grant\"\u003eGrant\u003c/string\u003e\n\u003cstring name=\"deny\"\u003eDeny\u003c/string\u003e\n```\n\ncheckout [strings.xml](https://github.com/BirjuVachhani/locus-android/blob/master/app/src/main/res/values/strings.xml).\n\n### How to disable background location permission if you don't use it.\n\nIt has been brought to my attention recently that this library includes background location permission in its `AndroidManifest.xml` file. This could cause a problem when publishing app on Google Play Store in a case where your does not actually request or use background location. If that happens then this is what you need to do.\n\nJust add this line in your app's `AndroidManifest.xml` file and you should be good to go.\n```xml\n\u003cuses-permission tools:node=\"remove\" android:name=\"android.permission.ACCESS_BACKGROUND_LOCATION\" /\u003e\n```\n\nFeel free to re-open [#53](https://github.com/BirjuVachhani/locus-android/issues/53) issue or file a new one if this does not work for you.\n\n## Gradle Dependency\n\n1. Add the JitPack repository.\n\n**For Classic Android Project:**\n\nAdd this in your project's build.gradle file.\n\n```\nallprojects {\n    repositories {\n        ...\n        maven { url 'https://jitpack.io' } // add this line only\n    }\n}\n```\n\n**For Compose Android Project:**\n\nAdd this in your project's settings.gradle file.\n\n```\ndependencyResolutionManagement {\n    repositoriesMode.set(RepositoriesMode.FAIL_ON_PROJECT_REPOS)\n    repositories {\n        ...\n        maven { url 'https://jitpack.io' } // add this line only\n    }\n}\n```\n\n2. Add the dependency in your app's build.gradle file\n\n[![Release](https://jitpack.io/v/BirjuVachhani/locus-android.svg?style=flat-square)](https://jitpack.io/BirjuVachhani/locus-android)\n\n```\ndependencies {\n    implementation 'com.github.BirjuVachhani:locus-android:latest-version'\n    implementation 'com.google.android.gms:play-services-location:latest-version'\n}\n```\n\n## Usage\n\nSee [Wiki](https://github.com/BirjuVachhani/locus-android/wiki) on how to get started with **Locus**.\n\n## Background Location Permission Removal\n\nThis package adds background location permission to the manifest file regardless whether you are using it or not. If you are not requesting background location permission and you are not planning to use it in future, consider adding this line into your manifest file. This is only required when you publish your app to Google Playstore because they might reject your app because of this. See realted issue #53.\n\n```xml\n\u003cuses-permission tools:node=\"remove\" android:name=\"android.permission.ACCESS_BACKGROUND_LOCATION\" /\u003e\n```\n\n### Pull Request\n\nTo generate a pull request, please consider\nfollowing [Pull Request Template](https://github.com/BirjuVachhani/locus-android/blob/master/PULL_REQUEST_TEMPLATE.md).\n\n### Issues\n\nTo submit an issue, please check\nthe [Issue Template](https://github.com/BirjuVachhani/locus-android/blob/master/ISSUE_TEMPLATE.md).\n\nCode of Conduct\n---\n[Code of Conduct](https://github.com/BirjuVachhani/locus-android/blob/master/CODE_OF_CONDUCT.md)\n\n## Contribution\n\nYou are most welcome to contribute to this project!\n\nPlease have a look\nat [Contributing Guidelines](https://github.com/BirjuVachhani/locus-android/blob/master/CONTRIBUTING.md), before\ncontributing and proposing a change.\n\n\u003ca href=\"https://www.buymeacoffee.com/birjuvachhani\" target=\"_blank\"\u003e\u003cimg src=\"https://cdn.buymeacoffee.com/buttons/default-blue.png\" alt=\"Buy Me A Coffee\" style=\"height: 51px !important;width: 217px !important;\" \u003e\u003c/a\u003e\n\n# License\n\n```\n   Copyright © 2019 BirjuVachhani\n\n   Licensed under the Apache License, Version 2.0 (the \"License\");\n   you may not use this file except in compliance with the License.\n   You may obtain a copy of the License at\n\n       http://www.apache.org/licenses/LICENSE-2.0\n\n   Unless required by applicable law or agreed to in writing, software\n   distributed under the License is distributed on an \"AS IS\" BASIS,\n   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n   See the License for the specific language governing permissions and\n   limitations under the License.\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbirjuvachhani%2Flocus-android","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fbirjuvachhani%2Flocus-android","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbirjuvachhani%2Flocus-android/lists"}