问题描述
请有人告诉如何使用
FlurryAgent.onEvent(String eventId, Map<String, String> parameters)
在一个机器人的活动进行跟踪与乱舞事件?
in an android activity to track events with flurry ?
推荐答案
最简单的使用的onEvent
的是不带参数。
The simplest use of onEvent
is without parameters.
比方说,我们正在编写一个游戏,你想跟踪有多少人开始游戏,有多少完成它。然后,您将有:
Let's say we're writing a game and you want to track how many people start the game and how many complete it. You would then have:
FlurryAgent.onEvent("Started game");
和
FlurryAgent.onEvent("Won game");
在你的code合适的点。
at appropriate points in your code.
如果您想了解当一个事件发生,你可以添加参数来跟踪这样的附加信息的应用程序状态的详细信息:
If you want to know more information about the state of the application when an event occurred, you can add parameters to track additional information like this:
HashMap<String, String> parameters = new HashMap<String, String>();
parameters.put("Final score", String.valueOf(score));
parameters.put("Time taken", String.valueOf(secondsElapsed));
FlurryAgent.onEvent("Won game", parameters);
您最多可以有100个不同的事件名,每个多达10个参数的名称和值最多255个字符长。
You can have up to 100 different event names, each with up to 10 parameters whose names and values are up to 255 characters long.
通知,要求的onEvent
当你不指定乱舞ID。乱舞源于当前会话ID,因此调用的onEvent
必须调用介于两者之间作出 onStartSession
和 onEndSession
- 但如果你按照他们的指引,并在活动的 ONSTART
和的onStop $把这些C $ C>,那么你不必担心。
Notice you don't specify your Flurry ID when calling onEvent
. Flurry derives the ID from the current session, so calls to onEvent
must be made somewhere between calls to onStartSession
and onEndSession
- but if you follow their guidelines and put these in your Activity's onStart
and onStop
then you don't have to worry about that.
这篇关于使用FlurryAgent.onEvent(字符串EVENTID,地图&LT;字符串,字符串&GT;参数)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!