Calavera
Calavera

Reputation: 13

Can I implement activity tracker using firebase?

Someone knows if it can be possible on android or if I have to use Analytics, event and hit builders?

It is for tracking popular activities and fragments.

Sorry if it's a dumb question but i'm newbie and I don't know what summary and guide I have to follow for this.

Thanks!

Upvotes: 0

Views: 492

Answers (2)

ZeroOne
ZeroOne

Reputation: 9117

Yes.. but is it difference from gcm

public void sendScreenName(String screen){
    Bundle bundle = new Bundle();
    bundle.putString(FirebaseAnalytics.Param.ITEM_NAME, screen);
    FirebaseAnalytics.getInstance(this).logEvent(screen.toLowerCase(),bundle);
}

public void sendUserProperties(String name, String value){
    FirebaseAnalytics.getInstance(this).setUserProperty(name.toLowerCase(),value);
}

public void sendSessionTimeOut(long time){
    FirebaseAnalytics.getInstance(this).setSessionTimeoutDuration(time);
}

Please make sure your screen name is lowercase or not contain digit/space/symbol. or it will not recorded

Upvotes: 0

quanlt
quanlt

Reputation: 844

Yes, you can. You can do something like

Bundle params = new Bundle();
params.putString("activityName", getClass.getSimpleName());
mFirebaseAnalytics.logEvent("startActivity", params);

You can read their documentation from here

Upvotes: 2

Related Questions