Skip to content

πŸ“Š Android application which collects, provides and uploads learning event data

License

Notifications You must be signed in to change notification settings

elimu-ai/analytics

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

elimu.ai Analytics πŸ“Š

Android application which collects, provides and uploads learning event data.

Software Architecture

Software Architecture

Learning Events

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

Assessment Events

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

Development πŸ‘©πŸ½β€πŸ’»

Compile APK:

./gradlew clean build

Install APK:

adb install app/build/outputs/apk/debug/ai.elimu.analytics-<versionCode>-debug.apk

Utils Library πŸ“¦

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.

Utils Usage Sample

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:

Database Migration πŸ”€

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:

  1. Add the new/modified @Entity to app/src/main/java/ai/elimu/analytics/entity/
  2. Include the entity in the entities section of the @Database in app/src/main/java/ai/elimu/analytics/db/RoomDb.java
  3. Bump the @Database version in app/src/main/java/ai/elimu/analytics/db/RoomDb.java
  4. Build the code with ./gradlew clean build
  5. Open the new database schema generated at app/schemas/ai.elimu.analytics.db.RoomDb/<version>.json
    • Under entities, find the matching tableName and copy its SQL script from the createSql property.
  6. 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 in RoomDb.java.
  7. To run the database migration, launch the application on your device.
  8. 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:

Database Inspector


elimu.ai - Free open-source learning software for out-of-school children βœ¨πŸš€

Website 🌐 Β β€’Β  Wiki πŸ“ƒ Β β€’Β  Projects πŸ‘©πŸ½β€πŸ’» Β β€’Β  Milestones 🎯 Β β€’Β  Community πŸ‘‹πŸ½ Β β€’Β  Support πŸ’œ