在每一个活动乱舞分析? [英] Flurry analytics in every Activity?

查看:111
本文介绍了在每一个活动乱舞分析?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我要整合乱舞分析在我的Andr​​oid应用程序,它看起来真的很简单。但我不熟悉乱舞以及它是如何工作的。

I want to integrate flurry analytics in my android application, it looks really simple. But i am not familiar with flurry and how it works.

我应该添加code:

public void onStart()
{
super.onStart();
FlurryAgent.onStartSession(sample, "APIXXXXXXXXXXXX");

}

在每一个活动?

我的应用程序使用了大量的活动,我真的不关心跟踪的活动所使用,对安装,会话和会话时长仅数。不过是会话长度可如果乱舞code在启动活动只增加?

My application uses a lot of activities and i don't really care for tracking which of the activities is used, only the number of installations, sessions and session length. But is the session length available if the flurry code is only added in the startup activity?

我知道大多数的我想要的信息可在游戏商店了,但我想尝试这种有在不同平台的应用程序的概述。

I know most of the information i want is available in play store already, but i want to try this to have an overview of applications on different platforms.

推荐答案

下面是一个很好的答案: http://stackoverflow.com /一/一百六十三万五千八百十七分之八百○六万二千五百六十八

Here is a great answer : http://stackoverflow.com/a/8062568/1635817

我建议你创建一个BaseActivity,并告诉你所有的活动,以扩展它,所以你不必复制/粘贴这些行的每一个活动课。

I suggest you to create a "BaseActivity" and to tell all your activities to extend it so you don't have to copy/paste those lines in every activity class.

事情是这样的:

public class BaseActivity extends Activity
{
    public void onStart()
    {
       super.onStart();
       FlurryAgent.onStartSession(this, "YOUR_KEY");
       // your code
    }

    public void onStop()
    {
       super.onStop();
       FlurryAgent.onEndSession(this);
       // your code
    }
}

在回应@conor评论:

In response to @conor comment :

从<一个href="http://support.flurry.com/sdkdocs/v3/android/classcom_1_1flurry_1_1android_1_1_flurry_agent.html#a6d845c03274c90a4280c93d2cf6111c6">Flurry's文档

只要有已调用任何上下文   onStartSession(背景,字符串),但不onEndSession(背景),则   会议将继续进行。此外,如果一个新的上下文调用   onStartSession(上下文,字符串),10秒内(默认会话   最后语境超时长度)调用onEndSession,那么   课程将会恢复,而不是正在创建一个新的会话。   会话长度,使用频率,事件和错误将继续   跟踪作为同一会话的一部分。这确保了作为用户   转变从一个活动到另一个应用程序中的他们将   没有一个单独的会话跟踪对于每个活动的,但会产生   单个会话跨越许多活动。

So long as there is any Context that has called onStartSession(Context, String) but not onEndSession(Context), the session will be continued. Also, if a new Context calls onStartSession(Context, String) within 10 seconds (the default session timeout length) of the last Context calling onEndSession, then the session will be resumed, instead of a new session being created. Session length, usage frequency, events and errors will continue to be tracked as part of the same session. This ensures that as a user transitions from one Activity to another in your application they will not have a separate session tracked for each Activity, but will have a single session that spans many activities.

这篇关于在每一个活动乱舞分析?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆