---
title: "How can I add GPS service to my application?"
slug: "how-can-i-add-gps-service-to-my-application"
updated: 2024-02-07T16:44:33Z
published: 2024-02-07T16:44:33Z
---

> ## Documentation Index
> Fetch the complete documentation index at: https://support.vuzix.com/llms.txt
> Use this file to discover all available pages before exploring further.

# How can I add GPS service to my application?

The Blade pulls GPS location data from a linked companion device.

As such, you will need to define a location listener:

```java
private final LocationListener mLocationListener = new LocationListener() {
	@Override
	public void onLocationChanged(final Location location) {
        	//your code here
    	}
};
```

Then utilize the LocationManager API to register for updates:

```java
mLocationManager = (LocationManager) getSystemService(LOCATION_SERVICE);
mLocationManager.requestLocationUpdates(LocationManager.GPS_PROVIDER, LOCATION_REFRESH_TIME, LOCATION_REFRESH_DISTANCE, mLocationListener);
```

And finally, add the permissions to access the data by adding one of the following to your manifest:

```java
<uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION"/>
```

or

```java
<uses-permission android:name="android.permission.ACCESS_FINE_LOCATION"/>
```
