本文整理匯總了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());
}
}
});
}
示例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);
}
示例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);
}
示例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);
}
示例5: onCreate
import com.parse.ParseAnalytics; //導入方法依賴的package包/類
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
ParseAnalytics.trackAppOpenedInBackground(getIntent());
}
示例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());
}
}
示例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);
}
示例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());
}
示例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);
}
}
示例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);
}
示例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);
}
示例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;
}
});
}
示例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());
}
示例14: onSplashActivityCreated
import com.parse.ParseAnalytics; //導入方法依賴的package包/類
@Override
public void onSplashActivityCreated(Activity activity) {
// Track app opened event
ParseAnalytics.trackAppOpenedInBackground(activity.getIntent());
}
示例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);
}