# Getting Started

{% hint style="info" %}
Pushlink is currently working for all Android versions. Tested up to the **Android 14 - API 33**. See the [changelog](https://docs.pushlink.com/changelog) to check compatibility.
{% endhint %}

## 1 Create an Account to obtain an API Key

Visit <https://www.pushlink.com/signup.xhtml> and create your free account.&#x20;

You'll be redirected to the dashboard. Copy your API key from the navigation bar.

## 2 Import Pushlink in your Android Project

### Option #1: Gradle

```groovy
...
  repositories {
    google()
    mavenCentral()
    maven { url "https://jitpack.io" }
  }
...
```

```groovy
//project/app/build.gradle
dependencies {
  implementation 'com.pushlink:pushlink-android:5.6.0'
  ...
}
```

### Option #2: Maven

```xml
<repositories>
  <repository>
    <id>jitpack.io</id>
    <url>https://jitpack.io</url>
  </repository>
</repositories>

<dependency>
  <groupId>com.pushlink</groupId>
  <artifactId>pushlink-android</artifactId>
  <version>5.6.0</version>
</dependency>
```

### Option #3: Download JAR File

[Download pushlink-android-5.6.0.jar ](https://jitpack.io/com/pushlink/pushlink-android/5.6.0/pushlink-android-5.6.0.jar)[\[s3 mirror\]](https://s3.amazonaws.com/bin.pushlink.com/pushlink-android-5.6.0.jar)

## 3 Set up permissions in your AndroidManifest.xml

```xml
<uses-permission android:name="android.permission.INTERNET" />
<uses-permission android:name="android.permission.REQUEST_INSTALL_PACKAGES" />
<uses-permission android:name="android.permission.POST_NOTIFICATIONS" />
<application android:name=".PushlinkSetup" ... >
  <uses-library android:name="org.apache.http.legacy" android:required="false"/>
  <provider 
    android:name="com.pushlink.android.FileProvider" 
    android:authorities="your.package.name" <--- change it ---
    android:exported="true" />
</application>
```

## 4 Call `PushLink.start()` in the Main UI Thread

```java
public class PushlinkSetup extends android.app.Application {
  @Override
  public void onCreate() {
    super.onCreate();
    String yourDeviceID = Settings.Secure.getString(getContentResolver(), Settings.Secure.ANDROID_ID);
    PushLink.start(this, R.mipmap.ic_launcher, "yourApiKey", yourDeviceID);
  }
}
```

{% hint style="warning" %}
**Don't call the start method inside an ordinary Activity**

Call this inside the class that extends `android.app.Application` precisely, as shown above.&#x20;
{% endhint %}

{% hint style="info" %}
**It's up to you to identify the device**

Make sure you've read the [Android Device ID Guide](https://docs.pushlink.com/android-device-id-guide).
{% endhint %}

## 5 Build the APK and upload it to Pushlink

You can find the Upload APK button in the menu bar at the Pushlink dashboard.

{% hint style="danger" %}
**Don't forget, or your installation will fail:**

1 - Upload a fully signed release APK to Pushlink.

2 - Increment the [versionCode](https://docs.pushlink.com/downgrade-an-apk)

3 - Give your app installation and notification permissions.

4 - Adapt your app to the [newer Android versions](https://docs.pushlink.com/android-versions)
{% endhint %}

## 6 Enroll your devices (Install & run)

First installation options:

### Option #1: From the terminal

A tech person usually performs this before sending the device to the field.

```bash
curl -o yourApp.apk 'https://www.pushlink.com/download?package=some.package.name&api_key=yourApiKey'
adb install yourApp.apk
```

{% hint style="info" %}
You can also generate a **hashed download link** in the dashboard to hide your credentials.
{% endhint %}

### Option #2: From the device itself

Download the APK from **QRCode** and install it.

![](https://3807780648-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-LEuZr4CqIWfHJ0tGCot%2F-LLydbvYWcS4p3owxgNN%2F-LLyeGHr1h8NyOusKLSV%2FScreenshot%20\(8\).png?alt=media\&token=3db79f45-a653-473c-a2ca-4cae943c60b9)

## Final words

That's it. Now, every time you upload a new app version to Pushlink and make that the current version, all the devices using your application will receive and apply the update.&#x20;

Look at all the documentation to understand how Pushlink can help you.
