Tenth Week of Coding 9th August — 15th August


Hey Everyone, I am back with my weekly updates about my GSoC journey😀. This amazing journey is about to its end guys, but really I never forget this great experience where I learned a lot of technologies & experienced a new tech side of android development in just a few weeks.

This week I had a meeting with my mentor where I discussed some of the UI-UX related stuff that can make the user experience much better. Hence I have improved the UI of the app, uploaded educational resources over dhis2, find out some very important bugs that need to be resolved in the scale-up version. Let’s discuss them one by one -

Segregated Media Resources into Categories-

  • Earlier all types of media files either it is pdf, video, xls file, doc., etc. everyone is present in the single page.
  • Since we have more video resources and Pdfs I have made out the filter options to view resources into 4 separate sections All Media, Videos, PDFs and Other files.
  • Related Issue: Issue #195 Related MR: MR #199
  • Media files are classified based on their mime types.
  • Segregation is done only for downloaded media files.

To Classify Documents as :

PDF — pdfMimeTypes = ["application/pdf"]

Videos — videoMimeTypes = ["video/ogg","video/webm","video/.webm","video/.ogv","video/mp4", "video/.mp4","video/.m4v","video/x-flv","application/x-mpegURL","video/MP2T","video/3gpp", "video/quicktime","video/x-msvideo","video/x-ms-wmv"]


Added Metadata of Media Resources & Improved UI-

  • Added a button to download and open media files for easy to use purposes.
  • Added Thumbnail for video resources & a default pfd icon for pdf files.
  • Added video duration in the media card.
  • Related MR: MR #200
  • Check the new UI & functionalities of the Media Page.





An issue with Cordova plugin Secure storage-

Everything is working fine and in the last few days back I updated my phone and as usual, I keep on changing the code to come up with a better solution. But after some time everything is like 😶.

Suddenly my app gets on crashing on my device and does even not get opened. I was completely clueless why it is happening where the problem is? what I had changed 🤔.

After a long time, I identified the great culprit i.e. cordova-plugin-secure-storage which is begin used in our trainer app to store the user credentials. After doing a google search, I had to find out its cause. Some of the important points regarding this issue and its fix are :

  • cordova-plugin-secure-storage has been archived and no longer maintained.
  • They are not going to solve the existing issues.
  • So I find out some of its alternatives that are cordova-plugin-secure-storage-echo which is a forked version of an earlier one with all of these fixes and being used a lot.
  • Therefore I have made the appropriate changes to shift our project from cordova-plugin-secure-storage to cordova-plugin-secure-storage-echo
  • Related Issue: Issue #196 Related MR: MR #201
  • For More info please check -

  1. Ionic Native Secure Storage Not Working on Android Q
  2. cordova-plugin-secure-storage-echo
  3. Crypho/cordova-plugin-secure-storage  — Repo with Issues & archived
  4. mibrito707/cordova-plugin-secure-storage-echo — Repo with Fix & active

Uploaded Educational Resources-

We need to upload the real educational resources in the dhis2.

Resources: https://globalhealthmedia.org/videos/

It is having a lot of media files. This week I had uploaded 60+ Media files on the dhis2 and all of these media files are being accessed through the trainer app.

Checked the possibility for opening all types of media files with the app-

It was an idea that it is better if possible to open every media file within our app. Currently, we use the cordova-file-opener2 plugin for this purpose which gives access to the supportive apps to open the file. But the interesting fact to note is that any of the apps do not have access to check the media files and play even they are not visible if we find them on the phone or any supportive app. All the media files are downloaded and saved in users internal storage in a Persistent manner and well encrypted so any of the media files can be open only from the trainer app.

But I checked for the other options -

  • We can play video files using the video HTML element.
  • The problem is with pdf and another one.
  • I checked cordova-plugin-document-viewer. But this is also redirected us to download a specific app from the play store and after that only it can open the pdf using that app. This app uses pdf.js.
  • I implemented this and tested but the problem is we need to download an open that app is being used to open pdfs.
  • Overall till now also we are using fileopener2 🤷‍♂️.

What is work done this week?

  1. Segregated the media files into pdf, video, all media and other options ( Provided filtering options ) 
  2. Added Metadata to the Videos UI like thumbnail & time duration.
  3. Added Button and smoothen the way to download and view media files.
  4. Fixed Issue with Cordova plugin Secure storage-
  5. Tested the option to open media files within the app by the cordova-document-viewer plugin & pdf.js.
  6. Uploaded Half of the Education Resources over dhis2 for training. Find & Fixed old bugs.

What do I plan to do next week?

  1. Work on final submission and improve written blogs.
  2. Finding more bugs and fix them.


Comments

Popular posts from this blog

End of this Amazing Journey: GSoC-21

Community Bonding at LibreHealth

First Week of Coding : 7June -11 June