Branch: master
Find file History
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
..
Failed to load latest commit information.
app
gradle/wrapper
.gitignore
README.md
build.gradle
gradle.properties
gradlew
gradlew.bat
settings.gradle

README.md

BroadcastReceiver Example

Overview

If you would like notifications from the ObservationGraph SDK in the app’s background state, we recommend integrating Engine via BroadcastReceivers as opposed to Listeners. We provide the abstract class FactualClientReceiver that extends a BroadcastReceiver and replaces FactualClientListener.

Integration

The main difference between our Listener example and BroadcastReceiver example is that you must reference your Receiver in your AndroidManifest.xml. We do the following in our example:

...
        <receiver android:name=".LoggingFactualClientReceiver"/>
    </application>
...

The LoggingFactualClientReceiver extends FactualClientReceiver.

Setting or registering a receiver is also a little different, for example:

Setting the FactualClientReceiver in MainActivity.java:

...
FactualObservationGraph.setListener(LoggingFactualClientReceiver.class);
...