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


Java ParseAnalytics.trackAppOpenedInBackground方法代碼示例

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


在下文中一共展示了ParseAnalytics.trackAppOpenedInBackground方法的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: 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

示例4: 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

示例5: 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

示例6: 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

示例7: 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

示例8: 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

示例9: 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

示例10: onCreate

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

    //anonymously track this app opening
    ParseAnalytics.trackAppOpenedInBackground(getIntent());
    
    final SharedPreferences sharedPref = getSharedPreferences(getString(R.string.preference_file_key), MODE_PRIVATE);
    mProvince = sharedPref.getString(getString(R.string.province), "British Columbia");
    
    TextView fedNameText = (TextView)findViewById(R.id.federalNameMain);
    fedNameText.setText(sharedPref.getString(getString(R.string.federal_name), ""));
    
    TextView provNameText = (TextView)findViewById(R.id.provincialNameMain);
    provNameText.setText(sharedPref.getString(getString(R.string.provincial_name), ""));
    
    TextView muniContactsText = (TextView)findViewById(R.id.municipalMain);

    //list of all contacts which is stored in SharedPreferences. Yeah, I'm awesome at Android...
    //convert list to actual contacts here. We should always have current list in municipal_contacts.
    String contactString = sharedPref.getString("saved_muni_contacts", "");
    if(!contactString.isEmpty()){
        municipal_contacts = Contact.convertStringToContacts(contactString);
    } else{
        municipal_contacts = new ArrayList<>();
    }
    numMunicipalContacts = municipal_contacts.size();
    if(numMunicipalContacts == 1)
        muniContactsText.setText(numMunicipalContacts + " Contact");
    else
        muniContactsText.setText(numMunicipalContacts + " Contacts");
    
    setupPhoneButtons(sharedPref);
    setupEmailButtons(sharedPref);
    setupBottomButtons(sharedPref);
}
 
開發者ID:DemocracyLink,項目名稱:DemocracyLink-Android,代碼行數:38,代碼來源:MainActivity.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());
  Intent intent = new Intent(MainActivity.this, LoginActivity.class);
  startActivity(intent);

}
 
開發者ID:CarlXue,項目名稱:COMP90018,代碼行數:10,代碼來源:MainActivity.java

示例12: onCreate

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

    ParseAnalytics.trackAppOpenedInBackground(getIntent());
    ParsePush.subscribeInBackground("IRSensor", new SaveCallback() {
        @Override
        public void done(ParseException e) {

        }
    });

    if (!isGooglePlayServicesAvailable()) {
        finish();
    }
    createLocationRequest();
    googleApiClient = new GoogleApiClient.Builder(this)
        .addApi(LocationServices.API)
        .addConnectionCallbacks(this)
        .addOnConnectionFailedListener(this)
        .build();

    // init Kandy SDK!!
    Kandy.initialize(getApplicationContext(), "DAK35a030f39497484593f5d5372a195704", "DAS4f7751f0b9a04a9383acd3e6954edd5c");

    //mainText = (TextView)findViewById(R.id.maintext);

    listView = (ListView) findViewById(R.id.list);

    pref = PreferenceManager.getDefaultSharedPreferences(getBaseContext());
    //fd= pref.edit();
    Set<String> values = new HashSet<String>();
    values = pref.getStringSet("numbers", values);
    arrayList = new ArrayList<String>(values);
    adapter = new ArrayAdapter<String>(this,android.R.layout.simple_list_item_1, android.R.id.text1, arrayList);
    listView.setAdapter(adapter);
    listView.setDividerHeight(3);
    listView.setOnItemLongClickListener(new OnItemLongClickListener() {
        @Override
        public boolean onItemLongClick(AdapterView<?> parent, View view, int arg2, long arg3) {
            arrayList.remove(arg2);
            adapter.notifyDataSetChanged();
            //TODO: persist
            return false;
        }
    });
}
 
開發者ID:Nyceane,項目名稱:HackathonPADLS,代碼行數:50,代碼來源:MainActivity.java

示例13: onCreate

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

  username = (EditText) findViewById(R.id.editText);


    if (ParseUser.getCurrentUser() != null) {

        showUserList();

    }

  ParseAnalytics.trackAppOpenedInBackground(getIntent());
}
 
開發者ID:angeshpokharel,項目名稱:Snapchat-parse,代碼行數:17,代碼來源:MainActivity.java

示例14: onSplashActivityCreated

import com.parse.ParseAnalytics; //導入方法依賴的package包/類
@Override
public void onSplashActivityCreated(Activity activity) {
    // Track app opened event
    ParseAnalytics.trackAppOpenedInBackground(activity.getIntent());
}
 
開發者ID:bakerframework,項目名稱:baker-android-refactor,代碼行數:6,代碼來源:ParsePlugin.java

示例15: onCreate

import com.parse.ParseAnalytics; //導入方法依賴的package包/類
@Override
protected void onCreate(final Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    ParseAnalytics.trackAppOpenedInBackground(getIntent());
    setContentView(R.layout.activity_main);
    mDrawerLayout = (DrawerLayout) findViewById(R.id.drawer_layout);
    Toolbar toolbar = (Toolbar) findViewById(R.id.toolbar);
    setSupportActionBar(toolbar);

    if (savedInstanceState != null) {
        Fragment activeFragment =
                getSupportFragmentManager().findFragmentById(R.id.schedule_container);
        if (activeFragment instanceof TalkListFragment) {
            mTalkListFragment = (TalkListFragment) activeFragment;
        }
        mFilterMenuSelectedId = savedInstanceState.getInt(INST_ST_FILTER_MENU_ID);
        mFilterMenuSelectedTag = savedInstanceState.getString(INST_ST_FILTER_MENU_TAG);
    }

    mNavigationView = (NavigationView) findViewById(R.id.navigation);
    final View drawerHeader = mNavigationView.getHeaderView(0);
    mNavNotificationsToggle = (CompoundButton) drawerHeader.findViewById(R.id.nav_notifications_switch);
    mNavNotificationsToggle.setChecked(FavoritesNotificationScheduler.isNotificationsEnabled(this));
    mNavNotificationsToggle.setOnClickListener(new View.OnClickListener() {
        @Override
        public void onClick(View v) {
            FavoritesNotificationScheduler
                    .setNotificationsEnabled(MainActivity.this, mNavNotificationsToggle.isChecked());
        }
    });
    // Can't define in XML because of file ordering
    ViewCompat.setLabelFor(drawerHeader.findViewById(R.id.nav_notifications_label), mNavNotificationsToggle.getId());

    // listen for navigation events
    mNavigationView.setNavigationItemSelectedListener(this);

    // set up the hamburger icon to open and close the drawer
    mDrawerToggle = new ActionBarDrawerToggle(this, mDrawerLayout, toolbar, R.string.drawer_open,
            R.string.drawer_close);
    mDrawerLayout.setDrawerListener(mDrawerToggle);
    mDrawerToggle.syncState();

    navigate(R.id.nav_schedule);
}
 
開發者ID:xebia,項目名稱:event-schedule-android,代碼行數:45,代碼來源:MainActivity.java


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