Skip to content

Files

37 lines (24 loc) · 1.68 KB

File metadata and controls

37 lines (24 loc) · 1.68 KB

FeatureHub SDK for Android/Polling

Overview

This SDK is intended for client libraries, particularly for Android as keeping the radio on would drain the battery quickly. It does this by making GET requests for the data but sets a period for which it will hold off making new requests (a timeout, which you can set to 0 if you have your own timer). This will allow you to keep requesting updates but they will not actually issue calls unless the context changes or the timeout has occurred.

This library uses:

  • OKHttp 4 (for http)

  • Jackson 2.11 (for json)

  • SLF4j (for logging)

If you need your Android client to use another technology, please let us know or feel free to contribute another version.

Visit our official web page for more information about the platform here

Using on Android

As it requires internet access, you will need to add to your AndroidManifest.xml the usual:

<uses-permission android:name="android.permission.INTERNET"/>

If you are using it locally and not behind https, you will also need to specify an attribute on your <application> tag, which allows clear text traffic.

android:usesCleartextTraffic="true"

You will need to store your repository in a central location, using a static or via a DI tool like Dagger.Using a static might look something like this:

Core uses Java’s ServiceLoader capability to automatically discover the JerseyClient implementation. Please simply follow the instructions in the Java Core library.

As per that documentation you can manually configure the Edge provider to be the AndroidFeatureHubClientFactory if you wish.