Java Code Examples for com.umeng.analytics.MobclickAgent#onEvent()

The following examples show how to use com.umeng.analytics.MobclickAgent#onEvent() . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: StudyFragment.java    From Alibaba-Android-Certification with MIT License 6 votes vote down vote up
@Override
public void onClick(View v) {
    switch (v.getId()){
        case R.id.t_start:
            MobclickAgent.onEvent(mContext,"GiftStudy");
            Bundle k=new Bundle();
            IntentHelper.openClassResult(mContext,StudyAct.class, AppConstants.REQUEST_CODE);
            break;
        case R.id.study_delete:
            XDialog.showSelectDialog(mContext, "是否清空做题记录", new XDialog.DialogClickListener() {
                @Override
                public void confirm() {
                    DataManager.getInstance().saveListAsync(mContext,CACHE_HISTORY_STUDY,new ArrayList<QuestionModel>());
                }
                @Override
                public void cancel() {

                }
            });
            break;
    }
}
 
Example 2
Source File: MaterializeApplication.java    From materialize with GNU General Public License v3.0 6 votes vote down vote up
@Override
public void onCreate() {
    super.onCreate();

    MobclickAgent.setCatchUncaughtExceptions(false);

    if (BuildConfig.FIR_ENABLED) {
        FIR.init(this);
    }

    MaterializeSharedState.init(this);

    MobclickAgent.setDebugMode(BuildConfig.DEBUG);

    HashMap<String, String> event = new HashMap<>();
    event.put("launcher", MaterializeSharedState.getInstance().getLauncher());
    MobclickAgent.onEvent(this, "launcher", event);
}
 
Example 3
Source File: MainActivity.java    From AppPlus with MIT License 6 votes vote down vote up
@Override
public boolean onOptionsItemSelected(MenuItem item) {
    switch (item.getItemId()) {
        case android.R.id.home:
            mDrawerLayout.openDrawer(GravityCompat.START);
            break;
        case R.id.action_search:
            Intent intent = new Intent(this, SearchActivity.class);
            startActivity(intent);
            MobclickAgent.onEvent(this, "search");
            break;
        case R.id.action_opinion:
            NavigationManager.gotoSendOpinion(this);
            MobclickAgent.onEvent(MainActivity.this, "title_send_opinion");
            break;
    }
    return true;
}
 
Example 4
Source File: FreightTrackBaiduMapFragment.java    From ESeal with Apache License 2.0 6 votes vote down vote up
private void umengOnEvent(String id, Integer type, String name) {
    Map<String, String> map = new HashMap<>();
    map.put("deviceId", id);
    map.put("name", name);
    switch (type) {
        case DeviceSearchSuggestion.DEVICE_BLE:
            map.put("type", "BLE");
            break;
        case DeviceSearchSuggestion.DEVICE_BEIDOU_MASTER:
            map.put("type", "BEIDOU_MASTER");
            break;
        case DeviceSearchSuggestion.DEVICE_BEIDOU_NFC:
            map.put("type", "BEIDOU_NFC");
            break;
        default:
            break;
    }
    MobclickAgent.onEvent(getContext(), "getLocationData", map);
}
 
Example 5
Source File: MainActivity.java    From freeiot-android with MIT License 6 votes vote down vote up
@Override
public boolean onOptionsItemSelected(MenuItem item) {
    // Handle action bar item clicks here. The action bar will
    // automatically handle clicks on the Home/Up button, so long
    // as you specify a parent activity in AndroidManifest.xml.
    int id = item.getItemId();

    //noinspection SimplifiableIfStatement
    if (id == R.id.action_add) {
        ActivityUtils.start(MainActivity.this, GateWayConfigActivity.class, R.anim.slide_in_from_right, R.anim.slide_out_to_left);

        MobclickAgent.onEvent(MainActivity.this, AnalyticsUtils.AnalyticsEventKeys.EVENT_ADD_DEVICE);
        return true;
    }

    return super.onOptionsItemSelected(item);
}
 
Example 6
Source File: MissionListenerForNotification.java    From AnimeTaste with MIT License 5 votes vote down vote up
@Override
public void onPause(M3U8Mission mission) {
    notifyBuilder = new NotificationCompat.Builder(context)
            .setSmallIcon(android.R.drawable.stat_sys_download)
            .setContentTitle(mission.getShowName())
            .setContentText(context.getString(R.string.download_pause))
            .setProgress(100,mission.getPercentage(),false)
            .setContentInfo(mission.getPercentage() + "%")
            .addAction(R.drawable.ic_action_rocket,context.getString(R.string.download_resume), resumePendingIntent)
            .addAction(R.drawable.ic_action_cancel,context.getString(R.string.download_cancel), cancelPendingIntent)
            .setContentIntent(contentPendingIntent)
            .setOngoing(true);
    notificationManager.notify(mission.getMissionID(),notifyBuilder.build());
    MobclickAgent.onEvent(context,"download_pause");
}
 
Example 7
Source File: SharePopWindow.java    From QiQuYing with Apache License 2.0 5 votes vote down vote up
/**
 * 收藏
 */
private void collect() {
	if(mJoke == null) {
		return;
	}
	String jokeContent = FastjsonUtil.serialize(mJoke);
	collectDAO.collect(userId, mJoke.getId(), jokeContent);
	ImgToastUtils.showMessage(context, "收藏成功", R.drawable.ic_toast_fav);
	MobclickAgent.onEvent(context, "collect");
}
 
Example 8
Source File: AboutFragment.java    From AppPlus with MIT License 5 votes vote down vote up
@Override
    public boolean onPreferenceClick(android.preference.Preference preference) {
        String key = preference.getKey();
        //用if判断 效率不会很好 待改善
        if(key.equals(getString(R.string.preference_key_about))){
            String htmlFileName =  Utils.isChineseLanguage()?"about_ch.html":"about.html";
            DialogUtil.showCustomDialogFillInWebView(mContext, mContext.getSupportFragmentManager(), getString(R.string.preference_title_about), htmlFileName, "about");
            MobclickAgent.onEvent(mContext, "setting_about");
        }
        if(key.equals(getString(R.string.preference_key_score))){
//            NavigationManager.gotoMarket(mContext,getActivity().getPackageName());
            AppRate.with(getActivity()).showRateDialog(getActivity());
            MobclickAgent.onEvent(mContext, "setting_market");
        }
        if(key.equals(getString(R.string.preference_key_opinion))){
            NavigationManager.gotoSendOpinion(getActivity());
            MobclickAgent.onEvent(getActivity(), "send_email");
        }
        if(key.equals(getString(R.string.preference_key_check_update))){
            UmengUpdateAgent.setUpdateListener(new CheckUmengUpdateListener());
            UmengUpdateAgent.forceUpdate(mContext);
            MobclickAgent.onEvent(mContext, "setting_check_update");
        }
        if(key.equals(getString(R.string.preference_key_license))){
            DialogUtil.showCustomDialogFillInWebView(mContext, mContext.getSupportFragmentManager(), getString(R.string.preference_title_license), "license.html", "license");
            MobclickAgent.onEvent(mContext, "setting_license");
        }
        return false;
    }
 
Example 9
Source File: WatchStateService.java    From earth with GNU General Public License v3.0 5 votes vote down vote up
@Override
public void onPeerConnected(Node peer) {
    Log.v(TAG, "watch connected");

    startService(new Intent(this, WatchSyncService.class));
    startService(new Intent(this, WatchTransferService.class));

    MobclickAgent.onEvent(this, "watch_launched");
}
 
Example 10
Source File: MobclickAgentProxy.java    From android-project-wo2b with Apache License 2.0 5 votes vote down vote up
public static void onEvent(Context arg0, String arg1, String arg2)
{
	if (!DEBUG)
	{
		MobclickAgent.onEvent(arg0, arg1, arg2);
	}
}
 
Example 11
Source File: MobclickAgentProxy.java    From android-project-wo2b with Apache License 2.0 5 votes vote down vote up
public static void onEvent(Context arg0, String arg1, String arg2, int arg3)
{
	if (!DEBUG)
	{
		MobclickAgent.onEvent(arg0, arg1, arg2, arg3);
	}
}
 
Example 12
Source File: PlayActivity.java    From AnimeTaste with MIT License 5 votes vote down vote up
@Override
public void onClick(View v) {
    switch (v.getId()) {
        case R.id.pre_play_button:
            startPlayAnimation(mLastPos, mAnimation);
            break;
        case R.id.play_btn:
            if (mVV.isPlaying()) {
                mPlayBtn.setBackgroundResource(R.drawable.play_btn_style);
                pausePlay();
            } else {
                mPlayBtn.setBackgroundResource(R.drawable.pause_btn_style);
                restorePlay();
            }
            mController.setVisibility(View.INVISIBLE);
            break;
        case R.id.comment_edit_text:
            comment();
            break;
        case R.id.recommend_item:
            stopPlay();
            Animation animation = (Animation) v.getTag();
            Intent intent = new Intent(mContext, PlayActivity.class);
            intent.putExtra("Animation", animation);
            mContext.startActivity(intent);
            MobclickAgent.onEvent(mContext, "recommend");
            finish();
            break;
        case R.id.zoom_btn:
            if (mCurrentScape == OrientationHelper.LANDSCAPE) {
                setMinSize();
            } else {
                setMaxSize();
            }
            break;
        default:
            break;
    }

}
 
Example 13
Source File: UmengAnalytics.java    From MiBandDecompiled with Apache License 2.0 5 votes vote down vote up
public static void event(Context context, String s, String s1)
{
    if (!b)
    {
        return;
    } else
    {
        Log.v("UmengAnalyticsTracker", (new StringBuilder()).append("Event : ").append(s).append(", Value : ").append(s1).toString());
        MobclickAgent.onEvent(context, s, s1);
        return;
    }
}
 
Example 14
Source File: CountEventHelper.java    From FriendBook with GNU General Public License v3.0 5 votes vote down vote up
/**
 * 统计书籍详情打开
 */
public static void countBookDetail(Context context, Book book) {
    HashMap<String, String> map = new HashMap<>();
    map.put("bookId", book.getId());
    map.put("bookName", book.getName());
    map.put("bookAuthor", book.getAuthor());
    map.put("bookTypeName", book.getBookTypeName());
    map.put("bookIsFinished", String.valueOf(book.isFinished()));
    map.put("bookWordNum", String.valueOf(book.getBookWordNum()));
    MobclickAgent.onEvent(context, "book_detail", map);
}
 
Example 15
Source File: FlutterUmengAnalyticsPlugin.java    From flutter_umeng_analytics with MIT License 5 votes vote down vote up
/**
 * 计数事件统计 例如:统计微博应用中”转发”事件发生的次数,那么在转发的函数里调用该函数
 *
 * @param call
 * @param result
 */
public void eventCounts(MethodCall call, Result result) {
    /**
     * 参数1: context 当前宿主进程的ApplicationContext上下文 参数2: eventId 为当前统计的事件ID 参数3: label
     * 为事件的标签属性
     */
    MobclickAgent.onEvent((Context) activity, (String) call.argument("eventId"), (String) call.argument("label"));
    result.success(null);
}
 
Example 16
Source File: AdvertiseActivity.java    From AnimeTaste with MIT License 4 votes vote down vote up
@Override
public void onPageFinished(WebView view, String url) {
    super.onPageFinished(view, url);
    MobclickAgent.onEvent(AdvertiseActivity.this,"ad");
}
 
Example 17
Source File: SettingActivity.java    From AnimeTaste with MIT License 4 votes vote down vote up
@Override
public void onClick(View v) {
	switch (v.getId()) {
	case R.id.only_for_wifi:
		break;
	case R.id.use_hd:

		break;
	case R.id.suggestion:
		Intent intent = new Intent(mContext, FeedbackActivity.class);
		startActivity(intent);
		break;
	case R.id.recommend:
		Intent shareIntent = new Intent(Intent.ACTION_SEND);
		shareIntent.setType("text/plain");
		shareIntent.putExtra(android.content.Intent.EXTRA_SUBJECT,
				getText(R.string.share_title));
		shareIntent.putExtra(android.content.Intent.EXTRA_TEXT,
				getText(R.string.share_app_body));
		startActivity(Intent.createChooser(shareIntent,
				getText(R.string.share_via)));
		break;
	case R.id.focus_us:
		mWeibo = new SinaWeibo(mContext);
		mWeibo.setPlatformActionListener(this);
		mWeibo.authorize();
		break;
	case R.id.cancel_auth:
		ShareSDK.getPlatform(mContext, SinaWeibo.NAME).removeAccount();
		ShareSDK.getPlatform(mContext, QZone.NAME).removeAccount();
		mSharedPreferences.edit().remove("login").commit();
		MobclickAgent.onEvent(mContext, "logout");
		Toast.makeText(mContext, R.string.logout_success,
				Toast.LENGTH_SHORT).show();
		break;
	case R.id.rate_for_us:
		Uri uri = Uri.parse("market://details?id="
				+ mContext.getPackageName());
		Intent goToMarket = new Intent(Intent.ACTION_VIEW, uri);
		try {
			startActivity(goToMarket);
			MobclickAgent.onEvent(mContext, "rate");
		} catch (ActivityNotFoundException e) {
			Toast.makeText(mContext, R.string.can_not_open_market,
					Toast.LENGTH_SHORT).show();
		}
           break;
       case R.id.clear_cache:
           new Thread(){
               @Override
               public void run() {
                   super.run();
                   CacheUtils.deleteCache(mContext);
               }
           }.start();
           Toast.makeText(mContext,R.string.clear_ok,Toast.LENGTH_SHORT).show();
           break;
	default:
		break;
	}
}
 
Example 18
Source File: CountEventHelper.java    From FriendBook with GNU General Public License v3.0 4 votes vote down vote up
/**
 * 统计书籍搜索
 */
public static void countBookSearch(Context context, String keyword) {
    HashMap<String, String> map = new HashMap<>();
    map.put("keyword", keyword);
    MobclickAgent.onEvent(context, "book_search", map);
}
 
Example 19
Source File: WatchSyncService.java    From earth with GNU General Public License v3.0 4 votes vote down vote up
private void sendOnWatchConnected() {
    MobclickAgent.onEvent(this, "watch_connected");
}
 
Example 20
Source File: RLAnalyticsHelper.java    From Roid-Library with Apache License 2.0 2 votes vote down vote up
/**
 * @param context
 * @param event
 */
public static void onEvent(Context context, String event) {
    MobclickAgent.onEvent(context, event);
}