ODK: New Widget Framework for Collect

Hi all! I’m Saumia Singhal, a final year student at IIT Roorkee, India. I have been accepted as a GSOC 2020 student. I’ll be working on updating the widget framework for the Collect App of ODK Community.

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

I would like to thank my mentors @jeff.beorse and @seadowg, who helped me in writing the proposal.

I’m really excited to work with ODK during the summers.:smiley:


[Community Bonding Period] Week 1:

During the first week, I had the first call from my mentor @seadowg. We discussed the proposal all over again, focussing on the deliverables, mentioned in the proposal. We are yet to decide on the first widget to start the work with.

@seadowg suggested that I should take a course and study more on TDD (Test Driven Development). I’m really excited to work for the first time as a TDD developer. Currently, I’m carrying on with my work on the issues that I was already involved with before getting selected for GSOC. What new is, that this time, I’m trying to come out with proper tests for whatever new code I add to the already existing codebase.


[Community Bonding Period] Week 2:

Last week, me and my mentor @seadowg, decided that I should first finish off the dialog issue and then start my work by writing the new framework for non-heirarchical widgets.

All my pull requests that direct the dialog issue are listed here. Apart from that, I shifted the UI of the URL widget to xml file and wrote tests for the same. I have opened a draft PR for the same. Next, I will discuss with my mentor about the test coverage of the widget, and most excitedly how much we can iterate over the UI. :smile:

We have decided that the month of May would be the learning phase for me. So, we plan on doing a TDD exercise using ping pong pairing. Really thanks to @seadowg, for such engagement.


[Community Bonding Period] Week 3:

This week, I started the TDD exercise with my mentor @seadowg. The purpose is to get me familiar with TDD so that I can implement it while I am rewriting the widgets of Collect.

I worked on reworking the Geowidgets and will be opening a draft PR for the same for later discussions. Meanwhile, as everyone is excited about the new release Collect -v1.27. I also worked on some side issues and submitted PRs.

1 Like

[Community Bonding Period] Week 4:

This week, I started my work ahead on expanding the test coverage of URL and Geo Widget. Here you can find my draft PRs for URL widget, and for Geo Widget. My mentor @seadowg reviewed my PR, and suggested how can I improve the tests.

We are still working on the TDD exercise, and it is helping me a lot. We decided to have a design review for the URL widget next week, as it would be great to have some UI modifications in widgets in Collect 1.28.

Everyone in the community is very excited about the realease of Collect 1.27, and its ever increasing reach to users, all over the world! :smiley:

[Coding Phase] Week 5:

This week I finished rewriting the tests for GeoPoint widget. Now, I will be moving on to writing the tests for the other Geo widgets. Once I am done with it, and have proper unit tests in place, I can rework the widgets following the new framework.

I worked on other issues as well, and I am happy to see many of my PRs got tested and merged. The added test coverage for the GeoPoint widget can be found here.

[Coding Phase] Week 6

This week I almost finished the work on GeoWidgets. I have to document the code properly, extract out helper methods, once the code and unit tests impelmenntation is finalized. I plan to work on other widgtes starting next week.

I also started working on the UI changes in the URL and Geo widgets. After discussing with my mentor, I plan on opening a topic in forum and discuss the changes there, so that I can later on implemt them in the app.

[Coding Phase] Week 7

This week I started on my work on other widgets including Rating and Range widget. I posted the UI changes in the URL and GeoWidgets on the forum and plan to implement them once we are done with the discussion part.

I plan on writing test coverage and extracting out UI in XML files for all other non-heirarchical widgets by the end of the next widgets. So that I can move on to working on other heirarchical widgets later.

[Coding Phase] Week 8

Last week I finished working on Rating Widget. Here’s my PR for the same. I added Robolectric test coverage for the widget. I also started working on Range hierarchy widgets.

Now that almost all non-heirarchical widgets are done, I’ll move onto the hierarchical ones next.

[Coding Phase] Week 9

This week I finished working on Range widgets heirarchy. I finished writing up proper test coverage and rewriting the framework for the mentioned widgets. My PR for the same can be found here:

Also, my mentor and I discussed the changes in my work on migrating to androidx library, and finalized the PR:

1 Like

[Coding Phase] Week 10

This week I finished writing proper test coverage for Range Picker Widgets. My mentor and I had proper discussions on how to improvise on the code that I have already written, and I started working on the same.

Next, I have to work on improvising the Espresso test, I have opened an issue for proper discussion about it here:

Also, we plan on revising the margins and padding in all the widgets.

1 Like

[Coding Phase] Week 11

This week I finished working on updating the espresso test for Collect. Apart from this I fixed the code for the Range Widgets

Next, we plan on working the Date Time Video and Audio widgwts and writing proper test coverage for the same.

1 Like

[Coding Phase] Week 12

This week, I was working on improving my existing PRs and I submitted a PR for reworking date and time widget (here).

Next week, I’ll be working on implementing the Dependency Inversion Principle to mock the static methods by converting them into method objects, and use them to refactor the test coverage of widgets. I’ll also start my work on other Binary widgets from next week.

1 Like

[Coding Phase] Week 13:

This week, I worked on implementing Dependency inversion Principle, to mock static methods and expand the test coverage for widgets. I moved on to implemnting viewmodel for Date time and Range Widgets, as this is a better approach than having a callback to the main activity. I also worked on writing test coverage for Audio and Video Widgets.

Next, I’ll start on writing tests for all the other widgets which implemet BinaryDataReceiver.

1 Like

[Coding Phase] Week 14:

This week I worked on improving the code structure of File Widgets inluding Audio, Video and Arbitrary FileWidgets. Also I worked on pulling out other image widgets from heirarchy of the widgets.

Next I’ll be adding mosre unit tests and also update the UI of the Url Widget as discussed.

1 Like

[Coding Phase] Week 15

This week I worked on reframing the structure of FileWidgets. Also I worked on updating the UI of other widgets. The pulling out of image widgets from the heirarchy is done.

Next I’m going to work on other heirarchy of widgtes, and will rework the framework on any other independent widgets left.

1 Like

[Coding Phase] Week 16

This week I finished rewoking barcode, osm and bearing widgets (basically the widgets, that were not part of heirarchy). Currently, I’m working with my mentor to get already filed PRs merged.