当前位置: 首页>>代码示例>>Java>>正文


Java Properties类代码示例

本文整理汇总了Java中com.segment.analytics.Properties的典型用法代码示例。如果您正苦于以下问题:Java Properties类的具体用法?Java Properties怎么用?Java Properties使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。


Properties类属于com.segment.analytics包,在下文中一共展示了Properties类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: singUpTaskSuccess

import com.segment.analytics.Properties; //导入依赖的package包/类
private void singUpTaskSuccess(String email, String password, AccountInfo accountInfo, ParticleCloud cloud) {
    SEGAnalytics.track("android account creation", new Properties()
            .putValue("email", email)
            .putValue("firstname", accountInfo.getFirstName())
            .putValue("lastname", accountInfo.getLastName())
            .putValue("isbusiness", accountInfo.isBusinessAccount())
            .putValue("company", accountInfo.getCompanyName()));
    log.d("onAccountCreated()!");
    if (isFinishing()) {
        return;
    }
    if (useOrganizationSignup || useProductionSignup) {
        // with org setup, we're already logged in upon successful account creation
        onLoginSuccess(cloud);
        SEGAnalytics.track("Auth: Signed Up New Customer");
    } else {
        SEGAnalytics.track("Auth: Signed Up New User");
        attemptLogin(email, password);
    }
}
 
开发者ID:Datatellit,项目名称:xlight_android_native,代码行数:21,代码来源:CreateAccountActivity.java

示例2: ReportPagesRead

import com.segment.analytics.Properties; //导入依赖的package包/类
private void ReportPagesRead()
{
    try {
        // let's differentiate between pages read and audio book pages read: (BL-5082)
        Properties p = new Properties();
        p.putValue("title", mBookName);
        p.putValue("audioPages", mAudioPagesPlayed);
        p.putValue("nonAudioPages", mNonAudioPagesShown);
        p.putValue("totalNumberedPages", mNumberedPageCount);
        p.putValue("lastNumberedPageRead", mLastNumberedPageRead);
        p.putValue("questionCount", mAdapter.mQuestions.size());
        p.putValue("contentLang", mContentLang1);
        if (mBrandingProjectName != null) {
            p.putValue("brandingProjectName", mBrandingProjectName);
        }
        Analytics.with(BloomReaderApplication.getBloomApplicationContext()).track("Pages Read", p);
    } catch (Exception e) {
        Log.e(TAG, "Pages Read", e);
        BloomReaderApplication.VerboseToast("Error reporting Pages Read");
    }
}
 
开发者ID:BloomBooks,项目名称:BloomReader,代码行数:22,代码来源:ReaderActivity.java

示例3: reportLoadBook

import com.segment.analytics.Properties; //导入依赖的package包/类
private void reportLoadBook(String path)
{
    try {
        String filenameWithExtension = new File(path).getName();
        // this mBookName is used by subsequent analytics reports
        mBookName = filenameWithExtension.substring(0, filenameWithExtension.length() - BookOrShelf.BOOK_FILE_EXTENSION.length());
        Properties p = new Properties();
        p.putValue("title", mBookName);
        p.putValue("totalNumberedPages", mNumberedPageCount);
        p.putValue("contentLang", mContentLang1);
        p.putValue("questionCount", mAdapter.mQuestions.size());
        if (mBrandingProjectName != null) {
            p.putValue("brandingProjectName", mBrandingProjectName);
        }
        Analytics.with(BloomReaderApplication.getBloomApplicationContext()).track("BookOrShelf opened", p);
    } catch (Exception error) {
        Log.e("Reader", "Error reporting load of " + path + ".  "+ error);
        BloomReaderApplication.VerboseToast("Error reporting load of "+path);
    }
}
 
开发者ID:BloomBooks,项目名称:BloomReader,代码行数:21,代码来源:ReaderActivity.java

示例4: getEventContext

import com.segment.analytics.Properties; //导入依赖的package包/类
/**
 * This function sets the Context values of values passed
 *
 * @param courseId
 * @param unitUrl
 * @param component
 * @return A {@link Properties} object populated with analytics-event info
 */
private Properties getEventContext(String courseId, String unitUrl, String component) {
    Properties cxtProps = new Properties();
    if (courseId != null) {
        cxtProps.putValue(Analytics.Keys.COURSE_ID, courseId);
    }
    if (unitUrl != null) {
        cxtProps.putValue(Analytics.Keys.OPEN_BROWSER, unitUrl);
    }
    if (component != null) {
        cxtProps.putValue(Analytics.Keys.COMPONENT, component);
    }
    cxtProps.putValue(Analytics.Keys.APP, Analytics.Values.APP_NAME);

    return cxtProps;
}
 
开发者ID:edx,项目名称:edx-app-android,代码行数:24,代码来源:SegmentEvent.java

示例5: toProperties

import com.segment.analytics.Properties; //导入依赖的package包/类
public Properties toProperties(@Nullable ReadableMap readableMap) {
    if (this.nullOrEmpty(readableMap)) {
        return null;
    }

    Properties properties = new Properties();
    properties.putAll(this.toMap(readableMap));

    return properties;
}
 
开发者ID:charlires,项目名称:react-native-segment-analytics,代码行数:11,代码来源:SegmentAnalyticsModule.java

示例6: onCreate

import com.segment.analytics.Properties; //导入依赖的package包/类
@Override
protected void onCreate(Bundle savedInstanceState) {
  super.onCreate(savedInstanceState);
  setContentView(R.layout.activity_main);

  LeanplumPushService.setGcmSenderId(LeanplumPushService.LEANPLUM_SENDER_ID);

  // Create an analytics client with the given context and Segment write key.
  Analytics analytics = new Analytics
      .Builder(getApplicationContext(), SEGMENT_WRITE_KEY)
      .use(LeanplumIntegration.FACTORY)
      .build();

  analytics.onIntegrationReady(LeanplumIntegration.LEANPLUM_SEGMENT_KEY,
      new Analytics.Callback() {
        @Override
        public void onReady(Object instance) {
          Leanplum.track("test");
        }
      });

  // Set the initialized instance as a globally accessible instance.
  Analytics.setSingletonInstance(analytics);

  Traits traits = new Traits()
      .putName("First Last")
      .putEmail("[email protected]");
  Analytics.with(getApplicationContext())
      .identify("f4ca124298", traits, null);

  Properties properties = new Properties()
      .putValue("plan", "Enterprise");
  Analytics.with(getApplicationContext()).track("Signed up", properties);
  Analytics.with(getApplicationContext()).screen("Main", "Start");
}
 
开发者ID:Leanplum,项目名称:Leanplum-Segment-Android,代码行数:36,代码来源:MainActivity.java

示例7: trackButtonClicked

import com.segment.analytics.Properties; //导入依赖的package包/类
public void trackButtonClicked(View view) {
  Properties properties = new Properties()
      .putPrice(0.99)
      .putCurrency("USD")
      .putTitle("InApp Purchase");
  Analytics.with(getApplicationContext())
      .track("Track Button Clicked!", properties);
}
 
开发者ID:Leanplum,项目名称:Leanplum-Segment-Android,代码行数:9,代码来源:MainActivity.java

示例8: SegmentEvent

import com.segment.analytics.Properties; //导入依赖的package包/类
public SegmentEvent() {
    this.properties = new Properties();
    this.data = new Properties();
    this.properties.putValue(Analytics.Keys.DATA, this.data);

    setCustomProperties();

    // Set app name in the context properties
    Properties cxtProps = new Properties();
    cxtProps.putValue(Analytics.Keys.APP, Analytics.Values.APP_NAME);
    this.properties.put(Analytics.Keys.CONTEXT, cxtProps);
}
 
开发者ID:edx,项目名称:edx-app-android,代码行数:13,代码来源:SegmentEvent.java

示例9: trackSegmentEvent

import com.segment.analytics.Properties; //导入依赖的package包/类
/**
 * This function is used to send the event to Segment and log the output.
 *
 * @param eventName     The name of the event.
 * @param eventProperties   The Properties of the event.
 */
private void trackSegmentEvent(@NonNull String eventName, @NonNull Properties eventProperties) {
    String csv = "Track," + eventName;
    for (String parameterName : eventProperties.keySet()) {
        csv += "," + parameterName + "=" + eventProperties.get(parameterName);
    }
    logger.debug(csv);
    tracker.track(eventName, eventProperties);
}
 
开发者ID:edx,项目名称:edx-app-android,代码行数:15,代码来源:SegmentAnalytics.java

示例10: trackSegmentScreenEvent

import com.segment.analytics.Properties; //导入依赖的package包/类
/**
 * This function is used to send the event to Segment and log the output.
 */
private void trackSegmentScreenEvent(@NonNull String screenCategory,
                                     @NonNull String screenName,
                                     @NonNull Properties screenProperties) {
    String csv = "Screen," + screenName;
    for (String pName : screenProperties.keySet()) {
        csv += "," + pName + "=" + screenProperties.get(pName);
    }
    Log.d(SegmentAnalytics.class.getName(), csv);
    tracker.screen(screenCategory, screenName, screenProperties);
}
 
开发者ID:edx,项目名称:edx-app-android,代码行数:14,代码来源:SegmentAnalytics.java

示例11: onCreate

import com.segment.analytics.Properties; //导入依赖的package包/类
@Override
protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.activity_success);

    deviceNameView = Ui.findView(this, R.id.device_name);
    deviceNameLabelView = Ui.findView(this, R.id.device_name_label);
    SEGAnalytics.screen("Device Setup: Setup Result Screen");
    particleCloud = ParticleCloudSDK.getCloud();

    int resultCode = getIntent().getIntExtra(EXTRA_RESULT_CODE, -1);

    final boolean isSuccess = list(RESULT_SUCCESS, RESULT_SUCCESS_UNKNOWN_OWNERSHIP).contains(resultCode);
    if (!isSuccess) {
        ImageView image = Ui.findView(this, R.id.result_image);
        image.setImageResource(R.drawable.fail);
        deviceNameView.setVisibility(View.GONE);
        Properties analyticProperties = new Properties();

        switch (resultCode) {
            case RESULT_FAILURE_CLAIMING:
                analyticProperties.putValue("reason", "claiming failed");
                break;
            case RESULT_FAILURE_CONFIGURE:
                analyticProperties.putValue("reason", "cannot configure");
                break;
            case RESULT_FAILURE_NO_DISCONNECT:
                analyticProperties.putValue("reason", "cannot disconnect");
                break;
            case RESULT_FAILURE_LOST_CONNECTION_TO_DEVICE:
                analyticProperties.putValue("reason", "lost connection");
                break;
        }
        SEGAnalytics.track("Device Setup: Failure", analyticProperties);
    } else {
        showDeviceName(particleCloud);
        SEGAnalytics.track("Device Setup: Success", RESULT_SUCCESS_UNKNOWN_OWNERSHIP == resultCode ?
                new Properties().putValue("reason", "not claimed") : null);
    }

    Pair<? extends CharSequence, CharSequence> resultStrings = buildUiStringPair(resultCode);
    Ui.setText(this, R.id.result_summary, resultStrings.first);
    Ui.setText(this, R.id.result_details, resultStrings.second);

    Ui.findView(this, R.id.action_done).setOnClickListener(v -> {
        deviceNameView.setError(null);
        if (isSuccess && !BaseActivity.setupOnly) {
            if (deviceNameView.getVisibility() == View.VISIBLE && deviceNameView.getText().toString().isEmpty()) {
                deviceNameView.setError(getString(R.string.error_field_required));
            } else {
                finishSetup(v.getContext(), deviceNameView.getText().toString(), true);
            }
        } else {
            leaveActivity(v.getContext(), false);
        }
    });

    Ui.setTextFromHtml(this, R.id.action_troubleshooting, R.string.troubleshooting)
            .setOnClickListener(v -> {
                Uri uri = Uri.parse(v.getContext().getString(R.string.troubleshooting_uri));
                startActivity(WebViewActivity.buildIntent(v.getContext(), uri));
            });

}
 
开发者ID:Datatellit,项目名称:xlight_android_native,代码行数:65,代码来源:SuccessActivity.java

示例12: onCreate

import com.segment.analytics.Properties; //导入依赖的package包/类
@Override
protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.activity_success);
    ParticleDeviceSetupLibrary.getInstance().getApplicationComponent().activityComponentBuilder()
            .apModule(new ApModule()).build().inject(this);
    ButterKnife.bind(this);
    SEGAnalytics.screen("Device Setup: Setup Result Screen");

    int resultCode = getIntent().getIntExtra(EXTRA_RESULT_CODE, -1);
    isSuccess = list(RESULT_SUCCESS, RESULT_SUCCESS_UNKNOWN_OWNERSHIP).contains(resultCode);

    if (!isSuccess) {
        ImageView image = Ui.findView(this, R.id.result_image);
        image.setImageResource(R.drawable.fail);
        deviceNameView.setVisibility(View.GONE);
        Properties analyticProperties = new Properties();

        switch (resultCode) {
            case RESULT_FAILURE_CLAIMING:
                analyticProperties.putValue("reason", "claiming failed");
                break;
            case RESULT_FAILURE_CONFIGURE:
                analyticProperties.putValue("reason", "cannot configure");
                break;
            case RESULT_FAILURE_NO_DISCONNECT:
                analyticProperties.putValue("reason", "cannot disconnect");
                break;
            case RESULT_FAILURE_LOST_CONNECTION_TO_DEVICE:
                analyticProperties.putValue("reason", "lost connection");
                break;
        }
        SEGAnalytics.track("Device Setup: Failure", analyticProperties);
    } else {
        showDeviceName(particleCloud);
        SEGAnalytics.track("Device Setup: Success", RESULT_SUCCESS_UNKNOWN_OWNERSHIP == resultCode ?
                new Properties().putValue("reason", "not claimed") : null);
    }

    Pair<? extends CharSequence, CharSequence> resultStrings = buildUiStringPair(resultCode);
    Ui.setText(this, R.id.result_summary, resultStrings.first);
    Ui.setText(this, R.id.result_details, resultStrings.second);
    Ui.setTextFromHtml(this, R.id.action_troubleshooting, R.string.troubleshooting);
}
 
开发者ID:particle-iot,项目名称:spark-setup-android,代码行数:45,代码来源:SuccessActivity.java

示例13: properties

import com.segment.analytics.Properties; //导入依赖的package包/类
/** The page and screen methods also take a properties dictionary, just like track. */
@NonNull
public Properties properties() {
  return getValueMap(PROPERTIES_KEY, Properties.class);
}
 
开发者ID:segmentio,项目名称:analytics-android,代码行数:6,代码来源:ScreenPayload.java

示例14: addCategoryToBiEvents

import com.segment.analytics.Properties; //导入依赖的package包/类
/**
 * This method sets category and labels to BI events
 *
 * @param props
 * @param category
 * @param label
 * @return An updated {@link Properties} object with CATEGORY and LABEL
 */
private Properties addCategoryToBiEvents(Properties props, String category, String label) {
    props.put(Keys.CATEGORY, category);
    props.put(Keys.LABEL, label);
    return props;
}
 
开发者ID:edx,项目名称:edx-app-android,代码行数:14,代码来源:SegmentAnalytics.java

示例15: properties

import com.segment.analytics.Properties; //导入依赖的package包/类
/**
 * A dictionary of properties that give more information about the event. We have a collection of
 * special properties that we recognize with semantic meaning. You can also add your own custom
 * properties.
 */
@NonNull
public Properties properties() {
  return getValueMap(PROPERTIES_KEY, Properties.class);
}
 
开发者ID:segmentio,项目名称:analytics-android,代码行数:10,代码来源:TrackPayload.java


注:本文中的com.segment.analytics.Properties类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。