-
-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: add video learning event - receiver
Refs #155
- Loading branch information
Showing
2 changed files
with
46 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
39 changes: 39 additions & 0 deletions
39
app/src/main/java/ai/elimu/analytics/receiver/VideoLearningEventReceiver.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
package ai.elimu.analytics.receiver; | ||
|
||
import android.content.BroadcastReceiver; | ||
import android.content.Context; | ||
import android.content.Intent; | ||
|
||
import java.util.Calendar; | ||
|
||
import ai.elimu.model.v2.enums.analytics.LearningEventType; | ||
import timber.log.Timber; | ||
|
||
public class VideoLearningEventReceiver extends BroadcastReceiver { | ||
|
||
@Override | ||
public void onReceive(Context context, Intent intent) { | ||
Timber.i("onReceive"); | ||
|
||
String packageName = intent.getStringExtra("packageName"); | ||
Timber.i("packageName: \"" + packageName + "\""); | ||
|
||
Calendar timestamp = Calendar.getInstance(); | ||
Timber.i("timestamp.getTime(): " + timestamp.getTime()); | ||
|
||
Long videoId = intent.getLongExtra("videoId", 0); | ||
Timber.i("videoId: " + videoId); | ||
|
||
String videoTitle = intent.getStringExtra("videoTitle"); | ||
Timber.i("videoTitle: \"" + videoTitle + "\""); | ||
|
||
String learningEventTypeAsString = intent.getStringExtra("learningEventType"); | ||
Timber.i("learningEventTypeAsString: \"" + learningEventTypeAsString + "\""); | ||
LearningEventType learningEventType = LearningEventType.valueOf(learningEventTypeAsString); | ||
Timber.i("learningEventType: " + learningEventType); | ||
|
||
// TODO: new VideoLearningEvent() | ||
|
||
// TODO: Store in database | ||
} | ||
} |