Back to project page mobile-connector-sdk-android.
The source code is released under:
Apache License
If you think the Android project mobile-connector-sdk-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.
package com.silverpop.engage.augmentation.plugin; // w ww.ja v a2 s . c o m import android.content.Context; import android.location.Address; import com.silverpop.engage.config.EngageConfig; import com.silverpop.engage.config.EngageConfigManager; import com.silverpop.engage.domain.UBF; /** * Created by jeremydyer on 6/12/14. */ public class UBFLocationNameAugmentationPlugin implements UBFAugmentationPlugin { private static final String TAG = UBFLocationNameAugmentationPlugin.class.getName(); private Context mContext; @Override public void setContext(Context context) { mContext = context; } @Override public boolean isSupplementalDataReady() { if (EngageConfig.currentAddressCache() == null || EngageConfig.addressCacheExpired(mContext)) { return false; } return true; } @Override public boolean processSyncronously() { return false; } @Override public UBF process(UBF ubfEvent) { Address address = EngageConfig.currentAddressCache(); EngageConfigManager cm = EngageConfigManager.get(mContext); //Sets the location name. if (EngageConfig.currentAddressCache() != null) { if (!ubfEvent.getParams().containsKey(cm.ubfLocationNameFieldName())) { String locationName = ""; if (address.getFeatureName() != null) { locationName = address.getFeatureName(); } ubfEvent.addParam(cm.ubfLocationNameFieldName(), locationName); } } return ubfEvent; } }