當前位置: 首頁>>代碼示例>>Java>>正文


Java ParseAnalytics類代碼示例

本文整理匯總了Java中com.parse.ParseAnalytics的典型用法代碼示例。如果您正苦於以下問題:Java ParseAnalytics類的具體用法?Java ParseAnalytics怎麽用?Java ParseAnalytics使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。


ParseAnalytics類屬於com.parse包,在下文中一共展示了ParseAnalytics類的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。

示例1: start

import com.parse.ParseAnalytics; //導入依賴的package包/類
@Kroll.method
public void start()
{
    setState(STATE_RUNNING);
    // App opens analytics
    ParseAnalytics.trackAppOpenedInBackground(TiApplication.getAppRootOrCurrentActivity().getIntent());
    ParseInstallation.getCurrentInstallation().put("androidId", getAndroidId());
    ParseInstallation.getCurrentInstallation().saveInBackground(new SaveCallback() {
        public void done(ParseException e) {
            if (e != null) {
                Log.e(TAG, "Installation initialization failed: " + e.getMessage());
            }
            // fire event
            try {
            	JSONObject pnData = new JSONObject();
	pnData.put("objectId", getObjectId());
	pnData.put("installationId", getCurrentInstallationId());
	KrollDict data = new KrollDict(pnData);
             module.fireEvent("installationId", data);
} catch (JSONException e1) {
	Log.e(TAG, "InstallationId event failed: " + e1.getMessage());
}
        }
    });
}
 
開發者ID:gimdongwoo,項目名稱:Titanium-Parse-Android,代碼行數:26,代碼來源:ParseModule.java

示例2: onCreate

import com.parse.ParseAnalytics; //導入依賴的package包/類
@Override
protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.activity_main);

    ParseAnalytics.trackAppOpenedInBackground(getIntent());

    toolbar = (Toolbar) findViewById(R.id.toolbar);
    setSupportActionBar(toolbar);

    // Find our drawer view
    mDrawer = (DrawerLayout) findViewById(R.id.drawer_layout);
    drawerToggle = setupDrawerToggle();

    // Tie DrawerLayout events to the ActionBarToggle
    mDrawer.setDrawerListener(drawerToggle);

    // Find our drawer view
    nvDrawer = (NavigationView) findViewById(R.id.nvView);
    // Setup drawer view
    setupDrawerContent(nvDrawer);


}
 
開發者ID:hhua,項目名稱:product-hunt-android,代碼行數:25,代碼來源:MainActivity.java

示例3: EnablePush

import com.parse.ParseAnalytics; //導入依賴的package包/類
public static void EnablePush(TiApplication app) {
  Context appContext = app.getApplicationContext();
  Activity appActivity = app.getAppCurrentActivity();

  if (appContext == null) {
    Log.e(TAG, "Application context is null, can't initialize Parse");
    return;
  }
  else if (appActivity == null) {
    Log.e(TAG, "Application activity is null, can't initialize Parse");
    return;
  }
  else {
    //PushService.setDefaultPushCallback(appContext, appActivity.getClass());
    ParseAnalytics.trackAppOpened(appActivity.getIntent());
    ParseInstallation.getCurrentInstallation().saveInBackground();
  }
}
 
開發者ID:E2010,項目名稱:android-parse-module-titanium-3-5,代碼行數:19,代碼來源:ParseSingleton.java

示例4: onStop

import com.parse.ParseAnalytics; //導入依賴的package包/類
@Override
    protected void onStop() {
        super.onStop();
        ((App) getApplication()).getGoogleApiClient().disconnect();
        Map<String, String> params = new HashMap<>();
//
//        params.put("total time", timeFormat((System.currentTimeMillis()-activityStartTime)/1000));
//        ParseAnalytics.trackEventInBackground("application close", params);

        long timeElapsed = System.nanoTime() - activityStartTime;
        timeElapsed = timeElapsed / 1000000000;//Convert to seconds;
        params.put("spent/min", String.valueOf((timeElapsed / 60)));
        params.put("spent/sec", String.valueOf((timeElapsed % 60)));
        ParseAnalytics.trackEventInBackground("mainactivity/close", params);

    }
 
開發者ID:Greplr,項目名稱:Greplr_Android,代碼行數:17,代碼來源:MainActivity.java

示例5: onBindViewHolder

import com.parse.ParseAnalytics; //導入依賴的package包/類
@Override
        public void onBindViewHolder(final ViewHolder viewHolder, final int i) {
            viewHolder.offerName.setText(offerList.get(i).getTitle());
            viewHolder.availability.setText(offerList.get(i).getAvailability());
            viewHolder.offerDescription.setText(offerList.get(i).getDescription());

//            if(Boolean.valueOf(searchList.get(i).getCodAvailable()))
//                viewHolder.cod.setText("COD Available : Yes");
//            else
//                viewHolder.cod.setText("COD Available : No");

            Picasso.with(getActivity()).load(offerList.get(i).getImageUrls().get(0).getUrl()).fit().centerCrop().into(viewHolder.icon);
            viewHolder.view.setOnClickListener(new View.OnClickListener() {
                @Override
                public void onClick(View v) {
                    Map<String, String> params = new HashMap<>();
                    params.put("success", "true");
                    params.put("offer name clicked", offerList.get(i).getTitle());
                    ParseAnalytics.trackEventInBackground("shopping/search clicked", params);
                    Intent browserIntent = new Intent(Intent.ACTION_VIEW, Uri.parse(offerList.get(i).getUrl()));
                    startActivity(browserIntent);
                }
            });
        }
 
開發者ID:Greplr,項目名稱:Greplr_Android,代碼行數:25,代碼來源:ShoppingOffersFragment.java

示例6: onCreate

import com.parse.ParseAnalytics; //導入依賴的package包/類
@Override
protected void onCreate(Bundle savedInstanceState) {
	super.onCreate(savedInstanceState);
	setContentView(R.layout.activity_login);

	loginButton = (Button) findViewById(R.id.loginButton);
	loginButton.setOnClickListener(new View.OnClickListener() {
		@Override
		public void onClick(View v) {
			Log.i(AnypicApplication.TAG, "Login button clicked");
			onLoginButtonClicked();
		}
	});
	
	// Check if there is a currently logged in user
	// and they are linked to a Facebook account.
	ParseUser currentUser = ParseUser.getCurrentUser();
	if ((currentUser != null) && ParseFacebookUtils.isLinked(currentUser)) {
		// Go to the main photo list view activity
		showHomeListActivity();
	}
	
	// For push notifications
	ParseAnalytics.trackAppOpened(getIntent());
}
 
開發者ID:salmank888,項目名稱:Anypic-Android,代碼行數:26,代碼來源:LoginActivity.java

示例7: parseBootstrap

import com.parse.ParseAnalytics; //導入依賴的package包/類
private void parseBootstrap() {
    try {
        Thread.sleep(3000);
    } catch(InterruptedException ex) {
        Thread.currentThread().interrupt();
    }
    ParseAnalytics.trackAppOpenedInBackground(getIntent());

    Parse.setLogLevel(Parse.LOG_LEVEL_DEBUG);

    for (int i = 0; i < 1; i++) {
        System.out.print("XXX wrinting" + i);
        ParseObject testObject = new ParseObject("TestObject");
        testObject.put("foo", "bar");
        testObject.saveInBackground();
    }

    Map<String, String> dimensions = new HashMap<String, String>();
    // What type of news is this?
    dimensions.put("category", "politics");
    // Is it a weekday or the weekend?
    dimensions.put("dayType", "weekday");
    // Send the dimensions to Parse along with the 'read' event

    ParseAnalytics.trackEventInBackground("read", dimensions);
}
 
開發者ID:wkoszek,項目名稱:sensorama,代碼行數:27,代碼來源:MainActivity.java

示例8: onPushOpen

import com.parse.ParseAnalytics; //導入依賴的package包/類
@Override
protected void onPushOpen(Context context, Intent intent) {

    // Send a Parse Analytics "push opened" event
    ParseAnalytics.trackAppOpenedInBackground(intent);

    String psPostId = null;
    try {
        JSONObject pushData = new JSONObject(intent.getStringExtra(KEY_PUSH_DATA));
        psPostId = pushData.optString(PUSH_POST_ID_EXTRA, null);
    } catch (JSONException e) {
        e.printStackTrace();
    }

    Intent activityIntent = new Intent(context, ActivityMain.class);
    activityIntent.putExtra(PUSH_POST_ID_EXTRA, psPostId);
    activityIntent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
    activityIntent.addFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP);
    context.startActivity(activityIntent);
}
 
開發者ID:lalongooo,項目名稱:permutas-sep-android,代碼行數:21,代碼來源:PushBroadcastReceiver.java

示例9: onCreate

import com.parse.ParseAnalytics; //導入依賴的package包/類
@Override
protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);

    setContentView(R.layout.activity_main);

    ParseAnalytics.trackAppOpened(getIntent());

    mFacebookButton = (Button) findViewById(R.id.facebook);
    mFacebookButton.setOnClickListener(this);

    mSignUpButton = (Button) findViewById(R.id.signup);
    mSignUpButton.setOnClickListener(this);

    mLoginButton = (Button) findViewById(R.id.login);
    mLoginButton.setOnClickListener(this);

    if (ParseUser.getCurrentUser() != null) {
        showInboxActivity();
        finish();
    }
}
 
開發者ID:cat-chat,項目名稱:cat-chat-android,代碼行數:23,代碼來源:MainActivity.java

示例10: onCreate

import com.parse.ParseAnalytics; //導入依賴的package包/類
/** Called when the activity is first created. */
public void onCreate(Bundle savedInstanceState) {
	super.onCreate(savedInstanceState);
	setContentView(R.layout.registerpage);
	EditText passwordField = (EditText) findViewById(R.id.registerPassword2);
	passwordField.setOnKeyListener(new OnKeyListener()
	{
	    public boolean onKey(View v, int keyCode, KeyEvent event)
	    {
	        if (event.getAction() == KeyEvent.ACTION_DOWN)
	        {
	            switch (keyCode)
	            {
	                case KeyEvent.KEYCODE_DPAD_CENTER:
	                case KeyEvent.KEYCODE_ENTER:
	                    registerButtonClicked(v);
	                    return true;
	                default:
	                    break;
	            }
	        }
	        return false;
	    }
	});
	ParseAnalytics.trackAppOpened(getIntent());
}
 
開發者ID:arturf1,項目名稱:EatingClub,代碼行數:27,代碼來源:RegisterPage.java

示例11: onCreate

import com.parse.ParseAnalytics; //導入依賴的package包/類
@Override
protected void onCreate(Bundle savedInstanceState) {
  super.onCreate(savedInstanceState);
  setContentView(R.layout.activity_main);

  ParseAnalytics.trackAppOpenedInBackground(getIntent());
}
 
開發者ID:alaskalinuxuser,項目名稱:apps_small,代碼行數:8,代碼來源:MainActivity.java

示例12: onPushOpen

import com.parse.ParseAnalytics; //導入依賴的package包/類
@Override
public void onPushOpen(Context context, Intent intent) {
    Intent i = context.getPackageManager().getLaunchIntentForPackage(context.getApplicationContext().getPackageName());
    // Push open analytics
    ParseAnalytics.trackAppOpenedInBackground(intent);

    /* Check if the app is running or in background. If not, just start the app and add the
     * notification as Extra */
    if (ParseModule.getInstance() == null || ParseModule.getInstance().getState() == ParseModule.STATE_DESTROYED) {
        Log.d("onPushOpen", "App was killed; resume the app without triggering 'notificationopen'");
        i.putExtras(intent.getExtras());
        context.startActivity(i);
        return;
    }

    /* Otherwise, just resume the app if necessary, and trigger the event */
    try {
        KrollDict data = new KrollDict(new JSONObject(intent.getExtras().getString("com.parse.Data")));

        if (ParseModule.getInstance().getState() != ParseModule.STATE_RUNNING) {
            Log.d("onPushOpen", "App was in background; resume the app and trigger 'notificationopen'");
            context.startActivity(i);
        } else {
            Log.d("onPushOpen", "App is running in foreground; trigger 'notificationopen'");
        }

        ParseModule.getInstance().fireEvent("notificationopen", data);
    } catch (Exception e) {
        Log.d("onPushOpen", e.getMessage());
    }
}
 
開發者ID:gimdongwoo,項目名稱:Titanium-Parse-Android,代碼行數:32,代碼來源:ParseModuleBroadcastReceiver.java

示例13: onPushOpen

import com.parse.ParseAnalytics; //導入依賴的package包/類
@Override
protected void onPushOpen(Context context, Intent intent) {
    ParseAnalytics.trackAppOpenedInBackground(intent);
    FirebaseAnalytics.getInstance(context).logEvent(Constants.EVENT_NOTIFICATION_OPEN,
            new Bundle());

    Intent activityIntent = MainActivity.getNewIntent(context);
    activityIntent.putExtras(intent.getExtras());
    context.startActivity(activityIntent);
}
 
開發者ID:Gnzlt,項目名稱:UCOmove,代碼行數:11,代碼來源:PushNotificationReceiver.java

示例14: onCreate

import com.parse.ParseAnalytics; //導入依賴的package包/類
@Override
protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.activity_login);
    Toolbar toolbar = (Toolbar) findViewById(R.id.toolbar);
    setSupportActionBar(toolbar);

    ParseAnalytics.trackAppOpenedInBackground(getIntent());
}
 
開發者ID:hhua,項目名稱:product-hunt-android,代碼行數:10,代碼來源:LoginActivity.java

示例15: onPushOpen

import com.parse.ParseAnalytics; //導入依賴的package包/類
protected void onPushOpen(Context context, Intent intent) {
    // Send a Parse Analytics "push opened" event
    ParseAnalytics.trackAppOpenedInBackground(intent);

    String uriString = null;
    String eventObjectId = null;
    try {
        JSONObject pushData = new JSONObject(intent.getStringExtra(KEY_PUSH_DATA));
        uriString = pushData.optString("uri", null);
        eventObjectId = pushData.optString("eventObjectId", null);
    } catch (JSONException e) {
        Timber.e("Unexpected JSONException when receiving push data: " + e);
    }

    Class<? extends Activity> cls = getActivity(context, intent);
    Intent activityIntent;
    if (uriString != null) {
        activityIntent = new Intent(Intent.ACTION_VIEW, Uri.parse(uriString));
    } else if(!TextUtils.isEmpty(eventObjectId)) {
        activityIntent = new Intent(EventDetailActivity.newIntent(context, eventObjectId));
    } else {
        activityIntent = new Intent(context, cls);
    }

    activityIntent.putExtras(intent.getExtras());
/*
  In order to remove dependency on android-support-library-v4
  The reason why we differentiate between versions instead of just using context.startActivity
  for all devices is because in API 11 the recommended conventions for app navigation using
  the back key changed.
 */
    if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.JELLY_BEAN) {
        TaskStackBuilderHelper.startActivities(context, cls, activityIntent);
    } else {
        activityIntent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
        activityIntent.addFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP);
        context.startActivity(activityIntent);
    }
}
 
開發者ID:LibertACAO,項目名稱:libertacao-android,代碼行數:40,代碼來源:LibertacaoPushBroadcastReceiver.java


注:本文中的com.parse.ParseAnalytics類示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。