Visit https://www.pushlink.com/signup.xhtml and create your free account.
You'll be redirected to the dashboard. Copy your API key from the navigation bar.
//project/build.gradleallprojects {repositories {google()jcenter()maven { url "https://jitpack.io" }}}
//project/app/build.gradledependencies {implementation 'com.pushlink:pushlink-android:5.5.3'}
<repositories><repository><id>jitpack.io</id><url>https://jitpack.io</url></repository></repositories><dependency><groupId>com.pushlink</groupId><artifactId>pushlink-android</artifactId><version>5.5.3</version></dependency>
Download pushlink-android-5.5.3.jar [s3 mirror]
<uses-permission android:name="android.permission.INTERNET" /><uses-permission android:name="android.permission.REQUEST_INSTALL_PACKAGES" /><application android:name=".PushlinkSetup" ... ><uses-library android:name="org.apache.http.legacy" android:required="false"/><providerandroid:name="com.pushlink.android.FileProvider"android:authorities="your.package.name" <--- change it ---android:exported="true" /></application>
The use of org.apache.http.legacy
is required in Android 9 (API 28) or higher
public class PushlinkSetup extends android.app.Application {@Overridepublic void onCreate() {super.onCreate();String yourDeviceID = Settings.Secure.getString(getContentResolver(), Settings.Secure.ANDROID_ID);PushLink.start(this, R.mipmap.ic_launcher, "yourApiKey", yourDeviceID);//you can use R.drawable.icon for older sdks}}
Avoiding headaches
Don't call the start method inside an ordinary Activity. Call this as higher as possible inside the class that extends android.app.Application
exactly as shown above. This is the right place to call things that must survive for the whole application lifetime. Also, this is going to be called again if your application was restarted by the android system or anything else.
It's up to you to identify the device
Make sure you've read the Android Device ID Guide.
You can find the Upload Apk button in the main navigation at the Pushlink dashboard.
If you are using Android Studio 3 you need to actually build a release of the APK, not just run. Take a look at Android Studio 3 and FLAG_TEST_ONLY
First installation options:
This use to be performed by a tech person before sending the device to the field.
curl -o yourApp.apk 'https://www.pushlink.com/download?package=some.package.name&api_key=yourApiKey'adb install yourApp.apk
You can also generate a hashed download link in the dashboard to hide your credentials.
Download the APK from QRCode and install it.
That's it. Now, every time you upload a new apk version to Pushlink and make that the current version, all the devices using your application will receive and apply the update.
Take a look at the whole docs to get an idea of how Pushlink can help you with.