> For the complete documentation index, see [llms.txt](https://docs.anchorkmp.io/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.anchorkmp.io/introduction.md).

# Introduction

**AnchorKMP** is a powerful, battery-efficient Cross-Platform (KMP) location tracking library for Android and iOS. It provides a unified API to handle location updates, permissions, and background tracking with ease.

## Key Features

* **Unified API**: Write your location logic once in Kotlin Common code.
* **Background Tracking**: Built-in support for background location updates (Foreground Service on Android, Background Modes on iOS).
* **Permissions Handling**: Simplified API for requesting and checking permissions (Foreground, Background, Notification, Motion).
* **Battery Efficient**: Configurable update intervals, distance filters, and accuracy settings to balance performance and battery life.
* **Customizable**: Tailored configuration for specific platform needs (e.g., Android Notification customization, iOS Activity Type).
* **Modern**: Built with Kotlin Coroutines and Flow.

## How it works

AnchorKMP abstracts away the complexities of `LocationManager` (Android) and `CLLocationManager` (iOS). It uses a singleton `Anchor` object to manage state and exposes a simple Flow-based API for location updates.

On **Android**, it automatically handles the Foreground Service lifecycle required for background tracking.\
On **iOS**, it manages the standard location manager delegates and background capabilities.

## Getting Started

Check out the [Setup](/setup.md) guide to integrate AnchorKMP into your project.


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.anchorkmp.io/introduction.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
