Android Open Source - hello-contexthub-android Hello Context Hub App

From Project

Back to project page hello-contexthub-android.


The source code is released under:

MIT License

If you think the Android project hello-contexthub-android listed in this page is inappropriate, such as containing malicious code/tools or violating the copyright, please email info at java2s dot com, thanks.

Java Source Code

package com.contexthub.hellocontexthub;
//from   w w w .  j a v a2  s. c  om
import android.content.Context;
import android.util.Log;

import com.chaione.contexthub.sdk.SensorPipelineEvent;
import com.chaione.contexthub.sdk.SensorPipelineListener;
import com.chaione.contexthub.sdk.ContextHub;

 * Created by andy on 9/26/14.
public class HelloContextHubApp extends Application implements SensorPipelineListener {

    private static Context instance;

    public HelloContextHubApp() {
        instance = this;

    public static Context getInstance() {
        return instance;

    public void onCreate() {
        ContextHub.init(this, "YOUR-APP-ID-HERE");

    public void onEventReceived(SensorPipelineEvent event) {
        Log.d(getClass().getName(), event.getEventDetails().toString());

    public boolean shouldPostEvent(SensorPipelineEvent sensorPipelineEvent) {
        return true;

    public void onBeforeEventPosted(SensorPipelineEvent sensorPipelineEvent) {


    public void onEventPosted(SensorPipelineEvent sensorPipelineEvent) {


Java Source Code List