转载自:http://blog.csdn.net/lilybaobei/article/details/7197081
关于Flurry的个人观点总结:
1.免费。可以收集用户的分布信息,用户对不同功能的使用频率,用户手机上的具体功能的执行信息(比如某按钮响应的执行时间)。并提供一些分析并以图表的方式显示出来,比如执行时间分布区间直方图,平均执行时间等等。
2.需要在网页上查看数据分析,刷新时间很慢。比如在你的程序执行后大约2个小时以上才能在网页上显示出来(Google Analytics 更是要24h,Localytics快一些二十分钟)。分析项目是固定的。图表显示不能更改或者自定义。不能直接看到所有数据(只能通过图表看到分析过了的数据分布的大概信息)
3.如果一定要获取所有的具体数据信息,可以通过Flurry 的API来通过输入指定的网址和参数来获取指定的数据(XML或JSON)。这一条将在另一篇文章中讲解(http://blog.csdn.net/lilybaobei/article/details/7200981)。
使用说明:
首先要去官方网站上注册(http://www.flurry.com/ 然后点Sign Up)。
注册完登录进去。创建一个Application并下载相关SDK。创建完会Flurry会给你一个这个Application的Key。我们需要在代码中将这个key作为参数传入。
下面的内容是官方网站上提供的指导:
- If you're using
Eclipse
, modify yourJava Build Path
, and chooseAdd External JAR...
- If you're using the
SDK tools
directly, drop it into yourlibs
folder and theant
task will pick it up.
-
(必填项)Required Permission:
android.permission.INTERNET
(可选项)Optional:
android.permission.ACCESS_COARSE_LOCATION
android.permission.ACCESS_FINE_LOCATION
这些Peimission枚举的意思可以参考空间里一篇转帖:
Android Permission(授权)大全
- public void onStart()
- {
- super.onStart();
- FlurryAgent.onStartSession(this, STR_YOUR_API_KEY);
- // your code
- }
public void onStart()
{
super.onStart();
FlurryAgent.onStartSession(this, STR_YOUR_API_KEY);
// your code
}
- public void onStop()
- {
- super.onStop();
- FlurryAgent.onEndSession(this);
- // your code
- }
public void onStop()
{
super.onStop();
FlurryAgent.onEndSession(this);
// your code
}
简单的可以在你的Activity的onStart()和onStop()方法中添加如上代码。
- case R.id.calllog_settings:
- FlurryAgent.logEvent("calllog_settings", true);
- SettingsLauncher.launch(this);
- FlurryAgent.endTimedEvent("calllog_settings");
- return true;
case R.id.calllog_settings:
FlurryAgent.logEvent("calllog_settings", true);
SettingsLauncher.launch(this);
FlurryAgent.endTimedEvent("calllog_settings");
return true;
Flurry Support Home:
http://support.flurry.com/index.php?title=Main_Page
Android API Document:
http://support.flurry.com/index.php?title=Analytics/Code/Doc/Android