An open API service indexing awesome lists of open source software.

https://github.com/krlan2789/unity-background-location

Unity Project - LAN LiveLocation Sample
https://github.com/krlan2789/unity-background-location

android gps-tracker gps-tracking location-tracker location-tracking unity unity3d-plugin

Last synced: about 2 months ago
JSON representation

Unity Project - LAN LiveLocation Sample

Awesome Lists containing this project

README

          

# Setting Up Background Location in Unity with LAN LiveLocation Plugin

This guide walks you through setting up background location functionality in Unity using the LAN LiveLocation plugin. Follow the steps below to ensure a smooth integration.

---

## Supported Platforms

- **Android OS**: Tested on Android 10 and Android 14 devices.
- **iOS**: Coming soon.

---

## Requirements and Installation

### Step 1: Install External Dependency Manager for Unity

To manage dependencies, you need to install the External Dependency Manager for Unity:

- Follow the [manual installation guide](https://openupm.com/packages/com.google.external-dependency-manager/#modal-manualinstallation).
- Alternatively, download and import the [latest custom package](https://github.com/googlesamples/unity-jar-resolver/blob/master/external-dependency-manager-latest.unitypackage).

### Step 2: Install the Live Location Plugin

Add the Live Location plugin to your Unity project:

1. Open the **Package Manager** window.
2. Click the **Add** button in the toolbar.
3. Select **Add package from git URL**.
4. Paste the following URL: `https://github.com/krlan2789/Unity-LAN-LiveLocation-Plugin.git`.

### Step 3: Set Minimum API Level

Ensure the minimum API level is set to **API Level 26**.

### Step 4: Verify Build Settings

Check and configure the required build settings.

### Step 5: Update AndroidManifest.xml

Add the following permissions to `Assets/Plugins/Android/AndroidManifest.xml`:

```xml










...

```

### Step 6: Update launcherTemplate.gradle

Insert the following script into `Assets\Plugins\Android\launcherTemplate.gradle`:

```gradle
android {
...
packagingOptions {
pickFirst('META-INF/okio.kotlin_module')
pickFirst('META-INF/kotlinx_coroutines_core.version')
}
}
```

### Step 7: Update mainTemplate.gradle

Insert the following script into `Assets\Plugins\Android\mainTemplate.gradle`:

```gradle
android {
...
packagingOptions {
pickFirst('META-INF/okio.kotlin_module')
pickFirst('META-INF/kotlinx_coroutines_core.version')
}
}
```

### Step 8: Update gradleTemplate.properties

Insert the following script into `Assets\Plugins\Android\gradleTemplate.properties`:

```properties
android.enableJetifier=true
android.suppressUnsupportedCompileSdk=34
```

---

## Common Errors and Troubleshooting

### `Custom Gradle Properties Template` :

### `Custom Launcher Gradle` and `Custom Main Gradle` :

---

By following these steps, you can successfully integrate background location functionality into your Unity project using the LAN LiveLocation plugin