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
- Host: GitHub
- URL: https://github.com/krlan2789/unity-background-location
- Owner: krlan2789
- Created: 2023-06-26T08:49:10.000Z (almost 3 years ago)
- Default Branch: main
- Last Pushed: 2024-11-19T17:37:58.000Z (over 1 year ago)
- Last Synced: 2025-01-11T05:21:25.740Z (over 1 year ago)
- Topics: android, gps-tracker, gps-tracking, location-tracker, location-tracking, unity, unity3d-plugin
- Language: C#
- Homepage: https://erlankurnia.github.io/article/3/Android%20Background%20Location%20for%20Unity
- Size: 15.6 MB
- Stars: 1
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
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