• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

Java MixpanelAPI类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

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



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

示例1: init

import com.mixpanel.android.mpmetrics.MixpanelAPI; //导入依赖的package包/类
public static void init(Context caller){
    sContext = caller;
    if (!sStarted && isLogging()) {
        String android_id = Secure.getString(caller.getContentResolver(), Secure.ANDROID_ID);
        try {

            sMixpanelToken = KeyUtilities.getToken(caller, "mixpanel");

            if (sMixpanelToken == null || sMixpanelToken.equals("")){
                sStarted = false;
                return;
            }

            sStarted = true;
            MixpanelAPI mixpanel = MixpanelAPI.getInstance(sContext, sMixpanelToken);
            mixpanel.identify(android_id);
            mixpanel.getPeople().identify(android_id);
            mixpanel.getPeople().set("name", android_id);
            mixpanel.getPeople().set("Build Version", BuildConfig.VERSION_NAME);
            mixpanel.getPeople().setMap(Collections.<String, Object>unmodifiableMap(mixpanel.getDeviceInfo()));
        }
        catch (Exception ex){
            trackException(ex);
        }
    }
}
 
开发者ID:Microsoft,项目名称:ProjectOxford-Apps-MimickerAlarm,代码行数:27,代码来源:Logger.java


示例2: track

import com.mixpanel.android.mpmetrics.MixpanelAPI; //导入依赖的package包/类
public static void track(Loggable loggable){
    if (isLogging() && sStarted) {
        try {
            MixpanelAPI.getInstance(sContext, sMixpanelToken).track(loggable.Name, loggable.Properties);
        }
        catch (Exception ex) {
            trackException(ex);
        }
    }
    else {
        if (debugTimerName != null) {
            long duration = System.currentTimeMillis() - debugTimerStart;
            Log.d(TAG, debugTimerName + " took " + duration + " milliseconds");
            debugTimerName = null;
        }
        debugPrint(loggable);
    }
}
 
开发者ID:Microsoft,项目名称:ProjectOxford-Apps-MimickerAlarm,代码行数:19,代码来源:Logger.java


示例3: onCreate

import com.mixpanel.android.mpmetrics.MixpanelAPI; //导入依赖的package包/类
@Override
protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);

    mIntentId = getIntent().getIntExtra(INTENT_ID_KEY, Integer.MAX_VALUE);
    mUpdateDisplayState = UpdateDisplayState.claimDisplayState(mIntentId);
    if (null == mUpdateDisplayState) {
        Log.e(LOGTAG, "SurveyActivity intent received, but nothing was found to show.");
        finish();
        return;
    }
    mMixpanel = MixpanelAPI.getInstance(SurveyActivity.this, mUpdateDisplayState.getToken());

    if (isShowingInApp()) {
        onCreateInAppNotification(savedInstanceState);
    } else if (isShowingSurvey()) {
        onCreateSurvey(savedInstanceState);
    } else {
        finish();
    }
}
 
开发者ID:perludem,项目名称:DPR-KITA,代码行数:22,代码来源:SurveyActivity.java


示例4: success

import com.mixpanel.android.mpmetrics.MixpanelAPI; //导入依赖的package包/类
@Override
public void success(LoginApi.ApiDao apiDao, String json) {
    showProgress(false);
    SharePreferences.saveString(RegisterActivity.this, Constant.TAG.USERNAME, username.getText().toString());
    SharePreferences.saveString(RegisterActivity.this, Constant.TAG.PASSWORD, password.getText().toString());
    SharePreferences.saveString(RegisterActivity.this, Constant.TAG.LOGIN_SESSION, json);
    setResult(RESULT_OK);
    finish();

    MixpanelAPI mixpanelAPI = Helper.mixpanel(RegisterActivity.this);
    mixpanelAPI.getPeople().identify(apiDao.getUser_id());
    mixpanelAPI.getPeople().set("$name", username.getText().toString());
    mixpanelAPI.getPeople().set("$email", apiDao.getEmail1());
    mixpanelAPI.getPeople().set("no_hp", inpHp.getText().toString());
    mixpanelAPI.getPeople().set("role", apiDao.getRoles().get(0).toString());
    try {
        JSONObject jsonObject = new JSONObject(json);
        mixpanelAPI.getPeople().set(jsonObject);
        mixpanelAPI.registerSuperProperties(jsonObject);
    } catch (JSONException e) {
    }
    SharePreferences.saveInt(RegisterActivity.this, "OPEN_FIRST_TIME", 1);
    showProgress(false);
}
 
开发者ID:perludem,项目名称:DPR-KITA,代码行数:25,代码来源:RegisterActivity.java


示例5: initMixPanel

import com.mixpanel.android.mpmetrics.MixpanelAPI; //导入依赖的package包/类
private void initMixPanel() {
    if (Constants.enableMixPanel) {
        mMixpanelAPI = MixpanelAPI.getInstance(mContext, Constants.getMixpanelToken());
        mMixpanelAPI.identify(Constants.getCurrentUserId());
        mMixpanelAPI.getPeople().set("last_login", Calendar.getInstance().getTime());
        mMixpanelAPI.getPeople().set("name", Constants.getCurrentUser());
        mMixpanelAPI.getPeople().set("gender", "female");
        mMixpanelAPI.getPeople().set("company", Constants.getCurrentCompany());

        mMixpanelAPI.alias(Constants.getCurrentUserId(), Constants.getCurrentUser());
        JSONObject props = new JSONObject();
        try {
            props.put("User Type", "Crazy woman");
        } catch (JSONException e) {
            e.printStackTrace();
        }
        mMixpanelAPI.registerSuperProperties(props);
    }
}
 
开发者ID:bnsantos,项目名称:android-analytics-example,代码行数:20,代码来源:AnalyticsHelper.java


示例6: init

import com.mixpanel.android.mpmetrics.MixpanelAPI; //导入依赖的package包/类
public static void init(MyApplication newApp,Context context) {
    Log.d(TAG, "init");
    //we sometimes gets called twice (from app startup and from main activity)
    if (app==null) {
        app=newApp;
    }
    if (storedContext==null) {
        storedContext=context;
    }
    if (AppHelpers.isRunningTestBuild()) {
        Log.d(TAG,"Automatically disabling analytics in test build");
        MyApplication.setAnalyticsEnabled(false);
    }

    if (MyApplication.isAnalyticsEnabled()) {
        //Mixpanel
        MixpanelAPI mixpanel = MixpanelAPI.getInstance(storedContext,BuildConfig.MIXPANEL_TOKEN);
    }

}
 
开发者ID:intari,项目名称:readingtracker,代码行数:21,代码来源:MyAnalytics.java


示例7: stopAnalytics

import com.mixpanel.android.mpmetrics.MixpanelAPI; //导入依赖的package包/类
/**
 * pauses 3rd party analytics (and possibile stops). for analytics systems which don't need context
 */
public static void stopAnalytics() {
    if (MyApplication.isAnalyticsEnabled()) {
        Log.d(TAG,"stopAnalytics()");
        if (storedContext==null) {
            Log.d(TAG,"null storedContext");
            return;
        }
        MixpanelAPI mixpanel = MixpanelAPI.getInstance(storedContext,BuildConfig.MIXPANEL_TOKEN);
        if (mixpanel==null) {
            Log.d(TAG,"null mixpanel?!");
            Rollbar.reportMessage("stopAnalytics() - mixpanel is null", "info");
        }
        else {
            mixpanel.flush();
        }

    }
}
 
开发者ID:intari,项目名称:readingtracker,代码行数:22,代码来源:MyAnalytics.java


示例8: trackTimedEventStart

import com.mixpanel.android.mpmetrics.MixpanelAPI; //导入依赖的package包/类
/**
 * Signals start of timed event to 3rd-party analytics systems.
 * Currently only Mixpanel is supported
 * @param name - event name
 */
public static void trackTimedEventStart(String name) {
    if (app==null) {
        Log.e(TAG,"trackTimedEventStart: app is null");
         return;
    }
    //don't track anything if this is disabled on global level
    if (MyApplication.isAnalyticsEnabled()) {
        Log.d(TAG,"Sending start of event "+name+"  to analytics service");
        MixpanelAPI mixpanel = MixpanelAPI.getInstance(storedContext,BuildConfig.MIXPANEL_TOKEN);
        mixpanel.timeEvent(name);
    }
    else {
        Log.d(TAG,"trackTimedEventStart not sending event " + name + "  to analytics service");
    }
}
 
开发者ID:intari,项目名称:readingtracker,代码行数:21,代码来源:MyAnalytics.java


示例9: trackTimedEventStop

import com.mixpanel.android.mpmetrics.MixpanelAPI; //导入依赖的package包/类
/**
 * Signals stop of timed event to 3rd-party analytics systems.
 * Currently only Mixpanel is supported
 * @param name - event name
 */
public static void trackTimedEventStop(String name) {
    if (app==null) {
        Log.e(TAG,"trackTimedEventStop: app is null");
        return;
    }
    //don't track anything if this is disabled on global level
    if (MyApplication.isAnalyticsEnabled()) {
        Log.d(TAG,"Sending stop of event "+name+" (with dimensions) to analytics service");
        MixpanelAPI mixpanel = MixpanelAPI.getInstance(storedContext,BuildConfig.MIXPANEL_TOKEN);
        mixpanel.track(name);
    }
    else {
        Log.d(TAG, "trackTimedEventStop not sending event " + name + " (with dimensions) to analytics service");
    }
}
 
开发者ID:intari,项目名称:readingtracker,代码行数:21,代码来源:MyAnalytics.java


示例10: trackEvent

import com.mixpanel.android.mpmetrics.MixpanelAPI; //导入依赖的package包/类
/**
 * Signals event to be recorded by 3rd-party analytics systems.
 * @param name - event name
 */
public static void trackEvent(String name) {
    if (app==null) {
        Log.e(TAG,"trackEvent: app is null");
        return;
    }
    //don't track anything if this is disabled on global level
    if (MyApplication.isAnalyticsEnabled()) {
        Log.d(TAG,"Sending event "+name+" to analytics service");
        MixpanelAPI mixpanel = MixpanelAPI.getInstance(storedContext,BuildConfig.MIXPANEL_TOKEN);
        mixpanel.track(name);
    }
    else {
        Log.d(TAG, "trackEvent not sending event " + name + " to analytics service");
    }

}
 
开发者ID:intari,项目名称:readingtracker,代码行数:21,代码来源:MyAnalytics.java


示例11: onCreate

import com.mixpanel.android.mpmetrics.MixpanelAPI; //导入依赖的package包/类
@Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        activityState = ActivityState.created;

        uiHandler = new Handler();

        baseContext = (BaseContext) getApplicationContext();

        loading = LoadingOverlay.getInstance();

//        Mint.initAndStartSession(this, Config.BUGSENSE_API_KEY);
//        Mint.addExtraData("activity", this.getClass().getName());

        mixpanelAPI = MixpanelAPI.getInstance(this, Config.MIXPANEL_API_KEY);

//        ActionBar actionBar = getActionBar();
//        actionBar.setDisplayShowTitleEnabled(false);
//        actionBar.setDisplayShowCustomEnabled(true);
    }
 
开发者ID:AAverin,项目名称:android-skeleton-project,代码行数:21,代码来源:BaseActivity.java


示例12: init

import com.mixpanel.android.mpmetrics.MixpanelAPI; //导入依赖的package包/类
public void init(Context context, boolean optOut) {
    GoogleAnalytics ga = GoogleAnalytics.getInstance(context);
    ga.setAppOptOut(optOut);

    if (!optOut) {
        // Initializing the google analytics
        this.mTracker = ga.newTracker(R.xml.app_tracker);
        // Initializing the mixpanelapi analytics
        this.mMixpanelAPI = MixpanelAPI.getInstance(context, "0f9f5280a4fb76478215544e42fa1299");
    }
}
 
开发者ID:sinhaDroid,项目名称:BlogBookApp,代码行数:12,代码来源:BlogBookAnalytics.java


示例13: ProfileModule

import com.mixpanel.android.mpmetrics.MixpanelAPI; //导入依赖的package包/类
public ProfileModule(ReactApplicationContext reactContext) {
  super(reactContext);
  new Prefs(reactContext);
  ServiceBuilder.init(Constants.BASE_URL, reactContext);
  registerMessageHandler();

  mixpanel = MixpanelAPI.getInstance(reactContext, Constants.MIXPANEL_TOKEN);
  mixpanel.identify(Prefs.getAccountId());
  mixpanel.getPeople().identify(mixpanel.getDistinctId());
}
 
开发者ID:humaniq,项目名称:react-native-android-library-humaniq-api,代码行数:11,代码来源:ProfileModule.java


示例14: BlockchainModule

import com.mixpanel.android.mpmetrics.MixpanelAPI; //导入依赖的package包/类
public BlockchainModule(ReactApplicationContext reactContext) {
  super(reactContext);
  new Prefs(reactContext);
  ServiceBuilder.init(Constants.BASE_URL, reactContext);

  mixpanel = MixpanelAPI.getInstance(reactContext, Constants.MIXPANEL_TOKEN);
  mixpanel.identify(Prefs.getAccountId());
  mixpanel.getPeople().identify(mixpanel.getDistinctId());
}
 
开发者ID:humaniq,项目名称:react-native-android-library-humaniq-api,代码行数:10,代码来源:BlockchainModule.java


示例15: PhotoValidationModule

import com.mixpanel.android.mpmetrics.MixpanelAPI; //导入依赖的package包/类
public PhotoValidationModule(ReactApplicationContext reactContext) {
  super(reactContext);
  new Prefs(reactContext);
  ServiceBuilder.init(Constants.BASE_URL, reactContext);

  mixpanel = MixpanelAPI.getInstance(reactContext, Constants.MIXPANEL_TOKEN);
  mixpanel.identify(Prefs.getAccountId());
  mixpanel.getPeople().identify(mixpanel.getDistinctId());
}
 
开发者ID:humaniq,项目名称:react-native-android-library-humaniq-api,代码行数:10,代码来源:PhotoValidationModule.java


示例16: ContactsModule

import com.mixpanel.android.mpmetrics.MixpanelAPI; //导入依赖的package包/类
public ContactsModule(ReactApplicationContext reactContext) {
  super(reactContext);
  new Prefs(reactContext);
  ServiceBuilder.init(Constants.BASE_URL, reactContext);

  mixpanel = MixpanelAPI.getInstance(reactContext, Constants.MIXPANEL_TOKEN);
  mixpanel.identify(Prefs.getAccountId());
  mixpanel.getPeople().identify(mixpanel.getDistinctId());
}
 
开发者ID:humaniq,项目名称:react-native-android-library-humaniq-api,代码行数:10,代码来源:ContactsModule.java


示例17: onCreate

import com.mixpanel.android.mpmetrics.MixpanelAPI; //导入依赖的package包/类
@Override
protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);

    setContentView(R.layout.activity_main);


    if (savedInstanceState != null){
        mAdClearOn = savedInstanceState.getBoolean(ADCLEAR_SIGN);
    }

    if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.KITKAT) {
        WebView.setWebContentsDebuggingEnabled(true);
    }

    mediaCodeReceiverRegister();

    final String permissions[] = {"android.permission.READ_CONTACTS", "android.permission.READ_EXTERNAL_STORAGE",
            "android.permission.WRITE_EXTERNAL_STORAGE"};

    final String permissionsUI[] = {"Permission Read Contact Granted", "Permission Read External Storage Granted",
            "Permission Write External Storage Granted"};

    final Runnable runnables[] = {new Runnable() {
        @Override
        public void run() {
            webtrekk = initWithNormalParameter();

            webtrekk.getCustomParameter().put("own_para", "my-value");
        }
    }, null, null};

    permissionRequest(permissions, permissionsUI, runnables);

    ((TextView)findViewById(R.id.main_version)).setText(getString(R.string.hello_world) + "\nLibrary Version:" + Webtrekk.mTrackingLibraryVersionUI);
    MixpanelAPI mixpanel = MixpanelAPI.getInstance(this, "9e956a2e5169ddb44eb87b6acb0eee95");
    updateAdClearCaption();
}
 
开发者ID:Webtrekk,项目名称:webtrekk-android-sdk,代码行数:39,代码来源:MainActivity.java


示例18: init

import com.mixpanel.android.mpmetrics.MixpanelAPI; //导入依赖的package包/类
public void init(Context context) {
    GoogleAnalytics googleAnalytics = GoogleAnalytics.getInstance(context);
    googleTracker = googleAnalytics.newTracker(R.xml.google_analytics);

    mixpanel = MixpanelAPI.getInstance(context, Constant.MIXPANEL_TOKEN);
    JSONObject props = new JSONObject();
    try {
        props.put("platform", "android");
    } catch (JSONException e) {
    }
    mixpanel.registerSuperProperties(props);
}
 
开发者ID:jianliaoim,项目名称:talk-android,代码行数:13,代码来源:AnalyticsHelper.java


示例19: trackDurationStart

import com.mixpanel.android.mpmetrics.MixpanelAPI; //导入依赖的package包/类
public static void trackDurationStart(Loggable loggable){
    if (isLogging() && sStarted) {
        try {
            MixpanelAPI.getInstance(sContext, sMixpanelToken).timeEvent(loggable.Name);
        }
        catch (Exception ex) {
            trackException(ex);
        }
    }
    else {
        debugTimerName = loggable.Name;
        debugTimerStart = System.currentTimeMillis();
        debugPrint(loggable);
    }
}
 
开发者ID:Microsoft,项目名称:ProjectOxford-Apps-MimickerAlarm,代码行数:16,代码来源:Logger.java


示例20: trackException

import com.mixpanel.android.mpmetrics.MixpanelAPI; //导入依赖的package包/类
public static void trackException(Exception ex) {
    if (isLogging() && sStarted) {
        try {
            Loggable.AppException appException = new Loggable.AppException(Loggable.Key.APP_EXCEPTION, ex);
            MixpanelAPI.getInstance(sContext, sMixpanelToken).track(appException.Name, appException.Properties);
        } catch (Exception mixpanelEx) {
            Log.e(TAG, mixpanelEx.getMessage());
        }
    }
    else {
        // This is called in a debug only scenario
        Log.e(TAG, "Logging exception:" , ex);
    }
}
 
开发者ID:Microsoft,项目名称:ProjectOxford-Apps-MimickerAlarm,代码行数:15,代码来源:Logger.java



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
Java QuadCurve类代码示例发布时间:2022-05-21
下一篇:
Java ClasspathContainerInitializer类代码示例发布时间:2022-05-21
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap