Android application which collects, provides and uploads learning event data.
The various types of learning events are handled by the Android receivers at app/src/main/java/ai/elimu/analytics/receiver
.
A learning event is an event without any corresponding testing of the student's mastery of a concept. For example; A student presses a word in a storybook and listens to its pronunciation.
StoryBookLearningEvent
WordLearningEvent
LetterLearningEvent
The various types of assessment events are handled by the Android receivers at app/src/main/java/ai/elimu/analytics/receiver
.
An assessment event is an event that involves testing of whether or not the student is able to master a concept. For example; A word is sounded out, and the student is asked select the corresponding written text amongst a list of alternatives (multiple choice).
WordAssessmentEvent
LetterAssessmentEvent
Compile APK:
./gradlew clean build
Install APK:
adb install app/build/outputs/apk/debug/ai.elimu.analytics-<versionCode>-debug.apk
A utils
library (.aar
) makes it easier for other Android apps to report learning/assessment events.
See https://jitpack.io/#elimu-ai/analytics/ for the latest version.
Note
To use the utils
library in another Android app, add the dependency in app/build.gradle
:
implementation 'com.github.elimu-ai:analytics:<version>@aar'
For an example of an app that is reporting learning events, see https://github.com/elimu-ai/vitabu:
- https://github.com/elimu-ai/vitabu/blob/main/app/build.gradle#L51
- https://github.com/elimu-ai/vitabu/blob/main/app/src/main/java/ai/elimu/vitabu/ui/storybook/ChapterFragment.java#L150
Important
When adding a new database @Entity
(or modifying an existing one), you need to prepare a database
migration (SQL script) in
app/src/main/java/ai/elimu/analytics/db/RoomDb.java
.
Follow these steps:
- Add the new/modified
@Entity
toapp/src/main/java/ai/elimu/analytics/entity/
- Add the entity's DAO interface to
app/src/main/java/ai/elimu/analytics/dao/
- Include the DAO interface in
app/src/main/java/ai/elimu/analytics/db/RoomDb.java
- Include the entity in the
entities
section of the@Database
inapp/src/main/java/ai/elimu/analytics/db/RoomDb.java
- Bump the
@Database
version inapp/src/main/java/ai/elimu/analytics/db/RoomDb.java
- Build the code with
./gradlew clean build
- Open the new database schema generated at
app/schemas/ai.elimu.analytics.db.RoomDb/<version>.json
- Under
entities
, find the matchingtableName
and copy its SQL script from thecreateSql
property.
- Under
- Open
RoomDb.java
and add a new method for the latest migration- Paste the SQL script from the above JSON schema, and replace
${TABLE_NAME}
with the name of the table you created/modified. - Include the migration in the
getDatabase
method inRoomDb.java
.
- Paste the SQL script from the above JSON schema, and replace
- To run the database migration, launch the application on your device.
- To verify that your database migration ran successfully, look at the Logcat output and
ensure that there are no RoomDb errors:
2023-10-25 15:40:55.640 15303-914 RoomDb ai.elimu.analytics.debug I migrate (5 --> 6) 2023-10-25 15:40:55.641 15303-914 RoomDb ai.elimu.analytics.debug I sql: CREATE TABLE IF NOT EXISTS `LetterSoundCorrespondenceLearningEvent` (`letterSoundCorrespondenceLearningEventId` INTEGER, `androidId` TEXT NOT NULL, `packageName` TEXT NOT NULL, `time` INTEGER NOT NULL, `id` INTEGER PRIMARY KEY AUTOINCREMENT)
Tip
You can also use Android Studio's Database Inspector to verify that the database migration succeeded:
elimu.ai - Free open-source learning software for out-of-school children β¨π
Website π Β β’Β Wiki π Β β’Β Projects π©π½βπ» Β β’Β Milestones π― Β β’Β Community ππ½ Β β’Β Support π