Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add video learning event #163

Merged
merged 6 commits into from
Sep 27, 2024
Merged
Show file tree
Hide file tree
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@ android {
applicationId "ai.elimu.analytics"
minSdkVersion 24
targetSdkVersion 33
versionCode 3001021
versionName "3.1.21"
versionCode 3001022
versionName "3.1.22-SNAPSHOT"
setProperty("archivesBaseName", "${applicationId}-${versionCode}")
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
javaCompileOptions {
Expand Down Expand Up @@ -40,7 +40,7 @@ android {
dependencies {
implementation fileTree(dir: 'libs', include: ['*.jar'])

implementation 'com.github.elimu-ai:model:model-2.0.73' // See https://jitpack.io/#elimu-ai/model
implementation 'com.github.elimu-ai:model:model-2.0.74' // See https://jitpack.io/#elimu-ai/model

implementation 'com.jakewharton.timber:timber:5.0.1'
implementation 'com.google.android.material:material:1.5.0'
Expand Down
7 changes: 7 additions & 0 deletions app/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,13 @@
<action android:name="ai.elimu.intent.action.STORYBOOK_LEARNING_EVENT" />
</intent-filter>
</receiver>
<receiver android:name=".receiver.VideoLearningEventReceiver"
android:enabled="true"
android:exported="true">
<intent-filter>
<action android:name="ai.elimu.intent.action.VIDEO_LEARNING_EVENT" />
</intent-filter>
</receiver>
<receiver android:name=".receiver.BootReceiver"
android:exported="true">
<intent-filter>
Expand Down
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
}
}
6 changes: 3 additions & 3 deletions utils/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ android {
defaultConfig {
minSdkVersion 24
targetSdkVersion 33
versionName "3.1.21"
versionName "3.1.22-SNAPSHOT"
setProperty("archivesBaseName", "utils-${versionName}")
}

Expand All @@ -25,7 +25,7 @@ android {
}

dependencies {
implementation 'com.github.elimu-ai:model:model-2.0.73' // See https://jitpack.io/#elimu-ai/model
implementation 'com.github.elimu-ai:model:model-2.0.74' // See https://jitpack.io/#elimu-ai/model
testImplementation 'junit:junit:4.13.2'
}

Expand All @@ -36,7 +36,7 @@ publishing {
utils(MavenPublication) {
groupId 'ai.elimu.analytics'
artifactId 'utils'
version '3.1.21'
version '3.1.22-SNAPSHOT'
artifact("${buildDir}/outputs/aar/utils-${version}-release.aar")
}
}
Expand Down
Loading