Browse Source

Integrate Flurry

master
Chris Smith 14 years ago
parent
commit
a393f8126b

BIN
code/ContextAnalyser/dist/ContextAnalyser.apk View File


+ 4
- 1
code/ContextAnalyser/nbproject/project.properties View File

@@ -19,10 +19,13 @@ dist.apk=${dist.dir}/ContextAnalyser.apk
19 19
 dist.dir=dist
20 20
 dist.javadoc.dir=${dist.dir}/javadoc
21 21
 excludes=
22
+file.reference.FlurryAgent.jar=../ActivityRecorder/lib/FlurryAgent.jar
23
+file.reference.FlurryAgent.jar-1=lib/FlurryAgent.jar
22 24
 gen.source.dir=${src.dir}
23 25
 includes=**
24 26
 intermediate.dex=${build.dir}/classes.dex
25
-javac.classpath=
27
+javac.classpath=\
28
+    ${file.reference.FlurryAgent.jar-1}
26 29
 # Space-separated list of extra javac options
27 30
 javac.compilerargs=
28 31
 javac.deprecation=false

+ 7
- 0
code/ContextAnalyser/src/uk/co/md87/android/contextanalyser/ContextAnalyserService.java View File

@@ -30,6 +30,7 @@ import android.location.Location;
30 30
 import android.os.Handler;
31 31
 import android.os.IBinder;
32 32
 import android.util.Log;
33
+import com.flurry.android.FlurryAgent;
33 34
 
34 35
 import java.io.IOException;
35 36
 import java.util.Collection;
@@ -115,6 +116,8 @@ public class ContextAnalyserService extends Service {
115 116
         names.putAll(dataHelper.getUnnamedLocations());
116 117
 
117 118
         handler.postDelayed(scheduleRunnable, POLLING_DELAY);
119
+
120
+        FlurryAgent.onStartSession(this, "MKB8YES3C6CFB86PXYXK");
118 121
     }
119 122
     
120 123
     public void poll() {
@@ -219,6 +222,7 @@ public class ContextAnalyserService extends Service {
219 222
                 intent.putExtra("old", lastLocation == null ? -1 : lastLocation.getId());
220 223
                 intent.putExtra("new", location.getId());
221 224
                 sendBroadcast(intent, Manifest.permission.RECEIVE_UPDATES);
225
+                FlurryAgent.onEvent("broadcast_context_location");
222 226
             }
223 227
 
224 228
             activityLog.clear();
@@ -245,6 +249,7 @@ public class ContextAnalyserService extends Service {
245 249
             intent.putExtra("old", lastActivity);
246 250
             intent.putExtra("new", newActivity);
247 251
             sendBroadcast(intent, Manifest.permission.RECEIVE_UPDATES);
252
+            FlurryAgent.onEvent("broadcast_activity");
248 253
 
249 254
             lastActivity = newActivity;
250 255
         }
@@ -299,6 +304,7 @@ public class ContextAnalyserService extends Service {
299 304
         intent.putExtra("best_target", bestTarget);
300 305
         intent.putExtra("best_probability", (float) best / total);
301 306
         sendBroadcast(intent, Manifest.permission.RECEIVE_UPDATES);
307
+        FlurryAgent.onEvent("broadcast_prediction");
302 308
     }
303 309
 
304 310
     @Override
@@ -306,6 +312,7 @@ public class ContextAnalyserService extends Service {
306 312
         super.onDestroy();
307 313
 
308 314
         handler.removeCallbacks(scheduleRunnable);
315
+        FlurryAgent.onEndSession(this);
309 316
     }
310 317
 
311 318
     @Override

Loading…
Cancel
Save