ODK-X: Migrate Database & Integrate Push Notifications

Hi everyone,
My name is Vyankatesh. As a GSoC’20 student, I will be working on a project “Migrate the Database and Integrate ODK-X Push Notifications into ODK-X Tool Suite” with Open Data Kit Community.

I will like to thank my mentors @jeff.beorse and @guptaharsh615, who guided me throughout the process.

I will be using this topic to post about my work progress.

Looking forward to work with the community!! :smiley:

1 Like

[Community Bonding Period] Week 1:

The first week started with @jeff.beorse welcoming us to the community. He congratulated all the selected students and guided us about what we have to do next.

Then I had first call with mentor @guptaharsh615. During our conversation, we discussed a few points related to my proposal and its implementation details. Harsh confirmed that I have a running setup require for this project and guided me about what I should do next.

When I have done with replying to congratulations messages :grin: I started reading sync-client (which is the major part of this project ) documentation and will complete it in the next few days.

2 Likes

[Community Bonding Period] Week 2:

This week I completed reading ODK-X Sync-Client Documentation.

What is Sync-Client?
Sync-Client is a class used to communicate with the ODK applications and server database via the REST API. This class uploads data to the server and downloads data from the server. As the project involves migrating the database from the firebase to the Sync Endpoint server, Sync-client is a major part of this project.

After reading the documentation, I also tried to implement some of the methods of Sync-Client class. I was able to create a table in the server database and row in a database table to store the information. I was also able to upload and download files from the server.

Next, I will discuss with mentors some points related to Sync-Client documentation, which I didn’t understand and will work on database structuring.

2 Likes

[Community Bonding Period] Week 3:

This week I worked on database structuring. For the database, the initial plan (which I mentioned in the proposal) was to go with the same structure as in firebase. But after reading Sync-Client documentation, I realized that there are some columns in the server database (ex. date, time) whose data we don’t need to store explicitly, it will automatically get stored when we create an entry for that row unlike in firebase. So I removed those columns from my originally proposed database structure to keep database simple.

I also worked on the layout of the ServerDatabaseCommunicator class, which will be used in Desktop and Mobile applications for communication with server Database.

Here you can find the rough layout of the ServerDatabaseCommunicator class and database structure.

1 Like

[Community Bonding Period] Week 4:

This week I started working on the database migration for Desktop App(Skunkworks-Parrot).

After a discussion with mentors, we decided that to account for my university exams we should move up the timeline so that the project deadlines will not get affected. So I started working on a project a week earlier than decided.

For database migration in the Desktop App, I started working on the ServerDatabaseCommunicator class. In that, I implemented the methods for initializing the SyncClient, creating tables in the server database, and uploading notifications and groups.

Here you can find code for the same.

[Coding Phase] Week 5:

This week I continued working on the database migration for Desktop App(Skunkworks-Parrot).

For database migration, I implemented the methods for retrieving the data from the server database and integrated those methods with the Desktop App. Now the database migration part for the Desktop app is almost completed.

This week I also discussed with the mentors about the need for a local database in our project. After discussing all the aspects related to the local database, we concluded that for the Desktop app, it is not necessary to have a local database but for an Android app, we will need a local database. As the users of an Android app may not have good internet connectivity, so it is essential to maintain the local database and then sync that with the server database once users get connected to the internet.

[Coding Phase] Week 6:

This week I started working on Android application (Skunkworks-Bat) for database migration.

I completed the setup for the ODK-X services app, which is used for data synchronization between the local android directory and server database.
I faced some issues in setting up the Services app but with the help of mentors, I was able to resolve those issues.

To understand how other ODK-X android apps (ODK-X Tables, ODK-X Survey) communicate with the Services app, I am reading the source code of other ODK-X apps and trying to understand it.

[Coding Phase] Week 7:

This week I continued working on database migration for android application (Skunkworks-Bat).

I read the source code for the ODK-X Tables app to understand how to communicate with the services app. Then I created a separate class in an android application that will communicate with the server database.

In that class, I added methods for retrieving the group list from the server database, retrieving the notifications list from the server database, and for uploading user information to the server database.

Here you can find the code.

[Coding Phase] Week 8:

This week I continued working on database migration for an android app (Skunkworks-Bat).

I implemented remaining methods for retrieving and uploading data to the server from the android app and integrated those methods with the main application.
I also added the local database in the android application for displaying notifications.

Now the database migration part is almost completed for both Android and Desktop app apart from the image notification functionality, which I will implement next.

[Coding Phase] Week 9:

This week I implemented the functionality of Image notifications. Image notification functionality allows admin to send images with text notifications.

With Image notification functionality admin can send images along with the text notification.

Now Database migration part is almost completed and I will start working on the documentation of ODK-X Notify from next week.

[Coding Phase] Week 10:

This week I worked on documentation of the ODK-X Notify app. As the database migration part is complete, we decided to document everything done till now and then proceed further.

Here you can find the documentation of ODK-X Notify. Once the contents of the documentation are finalized, I will upload that documentation on the official ODK-X documentation site.

1 Like

[Coding Phase] Week 11:

This week I worked on uploading ODK-X Notify documentation on official ODK-X Notify Documentation site.

Initially, I faced some difficulties in setting up an environment for ODK-X Documentation but after that, it was an easy task.

For documentation, I learned about the reStructuredText, which is a very powerful tool for program documentation and for creating simple web pages.

1 Like

[Coding Phase] Week 12:

This week I worked on improving the existing code as suggested by mentors. I made the changes suggested by mentors in the ODK-X Notify source code as well as in its documentation.

Now, the ODK-X Notify project along with its documentation is ready to release.

From next week, I will start working on writing unit test cases for the Desktop Application (Skunkworks-Parrot).

1 Like

[Coding Phase] Week 13:

This week I worked on writing unit test cases for Desktop Application (Skunkworks - Parrot). As this is the first time I am working with unit test cases, I first checked out some tutorials on writing unit test cases.

I wrote test cases for checking functionalities like uploading Custom group and Notification on Sync-Endpoint Server.

Next week I will complete writing test cases for the Desktop App and start working on Android App.

1 Like

[Coding Phase] Week 14:

This week I completed writing unit test cases for Desktop Application (Skunkworks - Parrot).

I wrote test cases for checking initialization logic and uploading interactive and image notifications on the Sync-Endpoint Server.

Next week I will write test cases for Android application.

1 Like

[Coding Phase] Week 15:

This week I completed writing unit and instrumentation tests for Android Application (Skunkworks - Bat).

Now everything for database migration project is completed. Next, I will work with mentors to merge pull requests for both Android and Desktop applications.

1 Like

Final Evaluation:

I have penned down my GSoC experience in the above-mentioned blog, do read it.

I like to thanks my mentors @guptaharsh615 and @dexter21 and all the community members who helped me throughout this journey. :grinning:

1 Like