Flurry使用初级教程 (转)

转载自: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作为参数传入。

下面的内容是官方网站上提供的指导:

1 Add FlurryAgent.jar to your application's classpath
  • If you're using Eclipse, modify your Java Build Path, and chooseAdd External JAR...
  • If you're using the SDK tools directly, drop it into your libs folder and the ant task will pick it up.
2 Configure AndroidManifest.xml
(必填项)Required Permission:
android.permission.INTERNET (可选项)Optional: android.permission.ACCESS_COARSE_LOCATION android.permission.ACCESS_FINE_LOCATION 这些Peimission枚举的意思可以参考空间里一篇转帖: Android Permission(授权)大全
Flurry代码使用方法:
  1. public void onStart()  
  2. {  
  3.    super.onStart();  
  4.    FlurryAgent.onStartSession(this, STR_YOUR_API_KEY);  
  5.    // your code   
  6. }  
public void onStart()
{
   super.onStart();
   FlurryAgent.onStartSession(this, STR_YOUR_API_KEY);
   // your code
}

  1. public void onStop()  
  2. {  
  3.    super.onStop();  
  4.    FlurryAgent.onEndSession(this);  
  5.    // your code   
  6. }  
public void onStop()
{
   super.onStop();
   FlurryAgent.onEndSession(this);
   // your code
}


简单的可以在你的Activity的onStart()和onStop()方法中添加如上代码。
请注意把STR_YOUR_API_KEY换成你自己的application key。
按照以上步骤就可以开始最基础的flurry测试了。运行完程序后一般需等待一定时间比如几个小时来在网页上看到数据的更新。
 
另外Flurry还可以记录你的一些事件信息。使用的函数如下:
logEvent (String eventId)
logEvent (String eventId, Map< String, String > parameters)
logEvent (String eventId, boolean timed)
eventId是自己随便定义的。就是相当于为你追踪的这个事件取个名字。
特别的,如果需要检测具体事件的响应时间(比如某个按钮事件),需要注意logEvent (String eventId, boolean timed),将timed参数设为true就可以记录这个event的开始执行时间,然后在你的代码中你认为事件完成的地方再调用 endTimedEvent (String eventId)。这样会记录事件的整个执行时间。 不过需要注意,经过我到目前的研究,不管是通过查看Analytics的分析页面,还是通过API直接获取数据。都得不到单个事件每一次执行的时间。只能得到平均(average),总体(total)。就是你这个事件执行了N次,它算N次的平均执行时间和N次相加的全部执行时间。
参考代码:
  1. case R.id.calllog_settings:  
  2.             FlurryAgent.logEvent("calllog_settings"true);   
  3.                  
  4.                SettingsLauncher.launch(this);  
  5.   
  6.             FlurryAgent.endTimedEvent("calllog_settings");  
  7.                return true;  
 case R.id.calllog_settings:
            	FlurryAgent.logEvent("calllog_settings", true); 
                
                SettingsLauncher.launch(this);

            	FlurryAgent.endTimedEvent("calllog_settings");
                return true;

查看application key
创建完后还想看到application key的话,在你登录进Flurry后Application项中选择一个Application,点击进入后注意左边有一栏Manage,点击可以查看你这个application的key。
 
一些有用的官方链接:

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

 

Table of Contents 1 Introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1 2 Getting started . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2 2.1 2.2 Supported Platforms . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Downloading SLIME . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2.2.1 Downloading from Git . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2.2.2 Git incantations . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2.3 Installation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2.3.1 Installing from Git . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2.4 Running SLIME . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2.5 Setup Tuning . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2.5.1 Basic customization . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2.5.2 Multiple Lisps . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2.5.3 Loading Swank faster . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3 2 2 2 3 3 3 3 4 4 4 5 Using Slime mode . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6 3.1 User-interface conventions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6 3.1.1 Temporary buffers . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6 3.1.2 *inferior-lisp* buffer . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6 3.1.3 Multithreading . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6 3.1.4 Key bindings . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7 3.2 Evaluation commands . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8 3.3 Compilation commands . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9 3.4 Completion commands . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 10 3.5 Finding definitions (“Meta-Point” commands). . . . . . . . . . . . . . . . . 10 3.6 Documentation commands . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11 3.7 Cross-reference commands. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 12 3.7.1 Xref buffer commands . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 13 3.8 Macro-expansion commands . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 13 3.9 Disassembly commands . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 13 3.10 Abort/Recovery commands . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 14 3.11 Inspector commands . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 14 3.12 Profiling commands . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 15 3.13 Shadowed Commands . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 16 3.14 Semantic indentation. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 16 3.15 Reader conditional fontification . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 16 4 SLDB: the SLIME debugger. . . . . . . . . . . . . . . . . . 17 4.1 4.2 4.3 4.4 4.5 Examining frames . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Invoking restarts . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Navigating between frames . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Stepping . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Miscellaneous Commands . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 17 17 18 18 19ii 5 Misc . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 20 5.1 slime-selector . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 20 5.2 slime-macroexpansion-minor-mode . . . . . . . . . . . . . . . . . . . . . . . . . . . . 20 5.3 Multiple connections . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 21 6 Customization . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 23 6.1 Emacs-side . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6.1.1 Hooks . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6.2 Lisp-side (Swank) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6.2.1 Communication style . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6.2.2 Other configurables . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7 Tips and Tricks . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 27 7.1 Connecting to a remote lisp . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7.1.1 Setting up the lisp image . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7.1.2 Setting up Emacs . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7.1.3 Setting up pathname translations . . . . . . . . . . . . . . . . . . . . . . . . . 7.2 Globally redirecting all IO to the REPL . . . . . . . . . . . . . . . . . . . . . . . 7.3 Connecting to SLIME automatically . . . . . . . . . . . . . . . . . . . . . . . . . . . 8 23 23 24 24 25 27 27 28 28 28 29 Contributed Packages . . . . . . . . . . . . . . . . . . . . . . . . . 30 8.1 Loading Contrib Packages . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8.1.1 Loading and unloading “on the fly” . . . . . . . . . . . . . . . . . . . . . . . 8.2 REPL: the “top level”. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8.2.1 REPL commands . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8.2.2 Input navigation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8.2.3 Shortcuts . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8.3 Multiple REPLs . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8.4 inferior-slime-mode . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8.5 Compound Completion . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8.6 Fuzzy Completion . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8.6.1 The Algorithm . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8.6.2 Duplicate Symbols . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8.7 slime-autodoc-mode . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8.8 ASDF . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8.9 Banner . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8.10 Editing Commands . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8.11 Fancy Inspector . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8.12 Presentations . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8.13 Typeout frames . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8.14 TRAMP . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8.15 Documentation Links . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8.16 Xref and Class Browser . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8.17 Highlight Edits . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8.18 Scratch Buffer . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8.19 SLIME Trace Dialog . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8.20 slime-sprof . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8.21 Meta package: slime-fancy . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 30 30 30 31 32 32 33 33 34 35 35 35 36 37 38 38 38 39 41 41 41 42 42 42 42 45 45iii 9 Credits . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 46 Hackers of the good hack . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 46 Thanks! . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 47 Key (Character) Index. . . . . . . . . . . . . . . . . . . . . . . . . . . . 48 Command and Function Index . . . . . . . . . . . . . . . . . . . 50 Variable and Concept Index . . . . . . . . . . . . . . . . . . . . . . 52
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值