Back to project page android-sdk-demo-app.
The source code is released under:
MIT License
If you think the Android project android-sdk-demo-app listed in this page is inappropriate, such as containing malicious code/tools or violating the copyright, please email info at java2s dot com, thanks.
package com.measurence.sdk.android.api_subscription.httppost; /*from w ww .j a v a2 s .c om*/ import android.util.Log; import com.measurence.sdk.android.api_subscriptions.HttpPostSubscription; import com.measurence.sdk.android.api_subscriptions.HttpPostSubscriptionException; import com.measurence.sdk.android.api_subscriptions.MeasurenceAPISubscriptions; import com.measurence.sdk.android.api_subscription.MeasurenceApiSubscriptionService; import com.measurence.sdk.android.util.DeviceMacAddress; public class HttpPostApiSubscriptionService extends MeasurenceApiSubscriptionService { private String LOG_TAG = "Measurence " + MeasurenceApiSubscriptionService.class.getSimpleName(); @Override protected void applyToSubscriptionAndNotifyResult(String user_identity) { try { HttpPostSubscription androidHttpPostSubscription = new HttpPostSubscription( getMeasurencePartnerId(), user_identity, DeviceMacAddress.get(this) ); MeasurenceAPISubscriptions.SubscriptionResult subscriptionResult = measurenceAPISubscriptions.applyToBackEndHttpPostNotification(androidHttpPostSubscription); Log.i(LOG_TAG, "http post subscription result|" + subscriptionResult); notifySubscriptionResult("HTTP Post Subscription succeeded. Outcome: \"" + subscriptionResult + "\""); } catch (HttpPostSubscriptionException e) { notifySubscriptionResult("HTTP Post Subscription failed. Error: \"" + e.getMessage() + "\""); e.printStackTrace(); } } }