Android Open Source - mobile-connector-sdk-android U B F A P I Fragment






From Project

Back to project page mobile-connector-sdk-android.

License

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.

Java Source Code

package com.silverpop.engage.demo.engagetest.fragment;
/*from   www. ja v  a  2  s. co  m*/
import android.os.AsyncTask;
import android.os.Bundle;
import android.support.v4.app.Fragment;
import android.util.Log;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.Button;
import android.widget.Toast;

import com.android.volley.VolleyError;
import com.silverpop.engage.UBFManager;
import com.silverpop.engage.config.EngageConfig;
import com.silverpop.engage.config.EngageConfigManager;
import com.silverpop.engage.demo.engagetest.R;
import com.silverpop.engage.domain.UBF;
import com.silverpop.engage.domain.XMLAPI;
import com.silverpop.engage.exception.XMLResponseParseException;
import com.silverpop.engage.response.EngageResponseXML;

/**
 * Created by jeremydyer on 6/5/14.
 */
public class UBFAPIFragment
    extends Fragment {

    private static final String TAG = UBFAPIFragment.class.getName();

    private Button mInstalled;
    private Button mSessionStart;
    private Button mSessionEnd;
    private Button mGoalStart;
    private Button mGoalAbandoned;
    private Button mNamedEvent;

    public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
        super.onCreateView(inflater, container, savedInstanceState);
        View v = inflater.inflate(R.layout.ubfapi_view, container, false);

        mInstalled = (Button)v.findViewById(R.id.ubfInstalledButton);
        mInstalled.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View view) {
                UBF installed = UBF.installed(getActivity(), null);
                UBFManager.get().postEvent(installed);
            }
        });

        mSessionStart = (Button)v.findViewById(R.id.ubfSessionStarted);
        mSessionStart.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View view) {
                UBF sessionStarted = UBF.sessionStarted(getActivity(), null, EngageConfig.currentCampaign(getActivity()));
                UBFManager.get().postEvent(sessionStarted);
            }
        });

        mSessionEnd = (Button)v.findViewById(R.id.ubfSessionEnded);
        mSessionEnd.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View view) {
                UBF sessionEnded = UBF.sessionEnded(getActivity(), null);
                UBFManager.get().postEvent(sessionEnded);
            }
        });

        mGoalStart = (Button)v.findViewById(R.id.ubfGoalStarted);
        mGoalStart.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View view) {
                UBF namedGoal = UBF.goalCompleted(getActivity(), "EngageSDK-Demo Goal Name", null);
                UBFManager.get().postEvent(namedGoal);
            }
        });

        mGoalAbandoned = (Button)v.findViewById(R.id.ubfGoalAbandoned);
        mGoalAbandoned.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View view) {
                UBF goalAban = UBF.goalAbandoned(getActivity(), "EngageSDK-Demo Goal Name", null);
                UBFManager.get().postEvent(goalAban);
            }
        });

        mNamedEvent = (Button)v.findViewById(R.id.ubfNamedEvent);
        mNamedEvent.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View view) {
                UBF namedEvent = UBF.namedEvent(getActivity(), "EngageSDK-Demo Testing Goal Name", null);
                UBFManager.get().postEvent(namedEvent);
            }
        });

        mNamedEvent = (Button)v.findViewById(R.id.ubfNamedEvent);
        mNamedEvent.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View view) {
                UBF namedEvent = UBF.namedEvent(getActivity(), "EngageSDK-Demo Testing Goal Name", null);
                UBFManager.get().postEvent(namedEvent);
            }
        });

        return v;
    }
}




Java Source Code List

com.silverpop.engage.EngageApplication.java
com.silverpop.engage.UBFManager.java
com.silverpop.engage.XMLAPIManager.java
com.silverpop.engage.augmentation.UBFAugmentationServiceImpl.java
com.silverpop.engage.augmentation.UBFAugmentationService.java
com.silverpop.engage.augmentation.plugin.UBFAddressAugmentationPlugin.java
com.silverpop.engage.augmentation.plugin.UBFAugmentationPlugin.java
com.silverpop.engage.augmentation.plugin.UBFCoordinatesAugmentationPlugin.java
com.silverpop.engage.augmentation.plugin.UBFLocationNameAugmentationPlugin.java
com.silverpop.engage.config.EngageConfigManagerTests.java
com.silverpop.engage.config.EngageConfigManager.java
com.silverpop.engage.config.EngageConfigTest.java
com.silverpop.engage.config.EngageConfig.java
com.silverpop.engage.deeplinking.EngageDeepLinkManager.java
com.silverpop.engage.demo.engagetest.Application.java
com.silverpop.engage.demo.engagetest.EngageNotificationReceiver.java
com.silverpop.engage.demo.engagetest.MainActivity.java
com.silverpop.engage.demo.engagetest.PushReceiver.java
com.silverpop.engage.demo.engagetest.fragment.EngageConfigFragment.java
com.silverpop.engage.demo.engagetest.fragment.UBFAPIFragment.java
com.silverpop.engage.demo.engagetest.fragment.XMLAPIFragment.java
com.silverpop.engage.domain.EngageEvent.java
com.silverpop.engage.domain.JSONable.java
com.silverpop.engage.domain.UBFTests.java
com.silverpop.engage.domain.UBF.java
com.silverpop.engage.domain.XMLAPIEnum.java
com.silverpop.engage.domain.XMLAPITest.java
com.silverpop.engage.domain.XMLAPI.java
com.silverpop.engage.exception.XMLResponseParseException.java
com.silverpop.engage.location.manager.EngageLocationManager.java
com.silverpop.engage.location.manager.plugin.EngageLocationManagerDefault.java
com.silverpop.engage.location.receiver.EngageLocationReceiver.java
com.silverpop.engage.location.receiver.plugin.EngageLocationReceiverBase.java
com.silverpop.engage.location.receiver.plugin.EngageLocationReceiverGeocode.java
com.silverpop.engage.location.receiver.plugin.EngageLocationReceiverHardcodeTest.java
com.silverpop.engage.network.Credential.java
com.silverpop.engage.network.EngageClient.java
com.silverpop.engage.network.RequestCacheWrapper.java
com.silverpop.engage.network.UBFClient.java
com.silverpop.engage.network.XMLAPIClient.java
com.silverpop.engage.response.EngageResponseXMLTests.java
com.silverpop.engage.response.EngageResponseXML.java
com.silverpop.engage.response.XMLAPIResponseNode.java
com.silverpop.engage.store.EngageLocalEventStoreTest.java
com.silverpop.engage.store.EngageLocalEventStore.java
com.silverpop.engage.store.EngageSQLiteHelper.java
com.silverpop.engage.util.EngageExpirationParserTests.java
com.silverpop.engage.util.EngageExpirationParser.java
com.silverpop.engage.util.TimedAsyncTask.java