Skip to content

Commit

Permalink
#381 Add usage of Event Tracker library
Browse files Browse the repository at this point in the history
  • Loading branch information
Jo Grimstad committed Mar 7, 2017
1 parent 017141b commit aa78a1f
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 14 deletions.
2 changes: 2 additions & 0 deletions app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -89,6 +89,8 @@ dependencies {
compile project(':openCVLibrary310')
compile 'ch.zhaw:facerecognitionlibrary:1.3.0'

compile 'org.literacyapp.analytics:eventtracker:1.0.0'

compile 'com.android.support:appcompat-v7:23.4.0'
compile 'com.android.support:cardview-v7:23.4.0'
compile 'com.android.support:design:23.4.0'
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,12 +15,15 @@

import org.literacyapp.LiteracyApplication;
import org.literacyapp.R;
import org.literacyapp.analytics.eventtracker.EventTracker;
import org.literacyapp.content.task.ScrollingLetterActivity;
import org.literacyapp.contentprovider.dao.AudioDao;
import org.literacyapp.contentprovider.dao.LetterDao;
import org.literacyapp.contentprovider.model.content.Letter;
import org.literacyapp.contentprovider.model.content.multimedia.Audio;
import org.literacyapp.logic.CurriculumHelper;
import org.literacyapp.model.enums.content.LiteracySkill;
import org.literacyapp.model.enums.content.NumeracySkill;
import org.literacyapp.util.MediaPlayerHelper;
import org.literacyapp.util.MultimediaHelper;
import org.literacyapp.util.TtsHelper;
Expand Down Expand Up @@ -67,13 +70,9 @@ public void onClick(View v) {

playLetterSound(letter);

Intent intent = new Intent();
intent.setPackage("org.literacyapp.analytics");
intent.setAction("literacyapp.intent.action.USAGE_EVENT");
intent.putExtra("packageName", getPackageName());
intent.putExtra("literacySkill", "LETTER_IDENTIFICATION");
intent.putExtra("letter", letter.getText());
sendBroadcast(intent);
EventTracker.reportUsageEvent(getApplicationContext(),
LiteracySkill.LETTER_IDENTIFICATION,
letter.getText());

Intent scrollingLetterIntent = new Intent(getApplicationContext(), ScrollingLetterActivity.class);
scrollingLetterIntent.putExtra("letter", letter.getText());
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,12 +16,14 @@

import org.literacyapp.LiteracyApplication;
import org.literacyapp.R;
import org.literacyapp.analytics.eventtracker.EventTracker;
import org.literacyapp.content.task.NumberActivity;
import org.literacyapp.contentprovider.dao.AudioDao;
import org.literacyapp.contentprovider.dao.NumberDao;
import org.literacyapp.contentprovider.model.content.Number;
import org.literacyapp.contentprovider.model.content.multimedia.Audio;
import org.literacyapp.logic.CurriculumHelper;
import org.literacyapp.model.enums.content.NumeracySkill;
import org.literacyapp.util.MediaPlayerHelper;
import org.literacyapp.util.MultimediaHelper;
import org.literacyapp.util.TtsHelper;
Expand Down Expand Up @@ -80,13 +82,9 @@ public void onClick(View v) {

playNumberSound(number);

Intent intent = new Intent();
intent.setPackage("org.literacyapp.analytics");
intent.setAction("literacyapp.intent.action.USAGE_EVENT");
intent.putExtra("packageName", getPackageName());
intent.putExtra("numeracySkill", "NUMBER_IDENTIFICATION");
intent.putExtra("number", number.getValue());
sendBroadcast(intent);
EventTracker.reportUsageEvent(getApplicationContext(),
NumeracySkill.NUMBER_IDENTIFICATION,
number.getValue());

Intent numberIntent = new Intent(getApplicationContext(), NumberActivity.class);
numberIntent.putExtra("number", number.getValue());
Expand Down

0 comments on commit aa78a1f

Please sign in to comment.