Project: Scaling up the mobileHBS/DHIS2 Tracker and Trainer applications

@sunbiz I had submitted an MR with the latest changes from dhis2 and after getting all the changes I had re-work on them to make the dhis2 app as per our need into an mHBS app. Please go through it.

Link of MR - Pull Request #11

@sunbiz I am not understanding How you are getting the issues in the build of that MR. I had successfully build the code sent in the PR and even I had build the apk. You can check the latest apk of the mHBS app from here. Build was successful with no error and a few warning

Can you please try to build the apk from bhavesh3005sharma/dhis2-android-trackercapture at develop-mHBS (github.com) . Just clone this fork repo and I had made a new branch develop-mHBS checkout there, it should have 7966 commits then try to build the code I think it should build successfully in your system.

APK Link : mHBS.apk - Google Drive

Can you try a clean clone of this repo and see what’s causing the issue? I have tried it on different installations (SDK, JVM, AVD, Studio, Kotlin, Gradle) and still have the same issue.

  • These errors are due to the kotlin version that was used there. I had changed the things to remove these build error please try to build the project after merging or accepting my changes that will not cause these errors

  • earlier - ext.kotlin_version = ‘1.2.71’ new changed version - ext.kotlin_version = ‘1.3.72’

You can find it in the project-level build.gradle

This isn’t helping resolve the issue. May I suggest that you build it using a CI/CD and you will see that it will get these errors. I can import these projects into LibreHealth org in Gitlab

@sunbiz can we have a meeting? Where we will solve this and can discuss the other things as well related to the next tasks.

The project is building properly on my system but I am not getting why it is giving the errors on CI/CD. I had set up CI/CD on my forked repo it is showing an error there as well with the same code it is building properly on my system. Therefore to know more about the errors I had tried to build a ci/cd for dhis2/dhis2-android-capture-app from which we had prepared our code there I found that the project is not building there as well when I am trying to build using ci/cd but it gets successfully build when I cloned its code in my laptop.

Actually, to build the dhis2 code we need two things as mentioned in their wiki dhis2-android-sdk and dhis2-rule-engine ( check this ) which I had set up as stated there at the starting of this project. But in ci/cd it is giving errors like not able to find rule engine and core which are related to those two folders mentioned earlier. It is not able to find them because at both places in my repo and dhis2 repo these two folders are added manually and in commits, only their github repo links get saved not code.

And one more point, initially I had reworked the changes and don’t take into account the last 7 commits and after merging, did that changes on my own. But this time I had completely merged those changes as well so this time the MR will not show you any conflicts and can be merged easily.

Please have a look at the build outputs i got from running build over ci/cd at my forked repo of our project with merging all changes and setting ci/cd (here) and at the build output I got from the latest version of dhis2 ( here )

Link of the new branch with all merged changes on which ci/cd build tested is bhavesh3005sharma-patch-1. This branch has no conflicts with the upstream master branch and is able to merge directly. It’s code can be build on the system as well. If you got build errors like in the ci/cd then try after downloading the 2 requirements of dhis2 from here.

All these things and next tasks can be discussed much better on meet if you prefer.

@sunbiz I had submitted a new MR on our GitLab repo with all the new changes merged with older one and with CI/CD set-up Link of the MR. It is even to merge.

For the STRING_TOO_LARGE error I had created a new issue Link of the issue and will submit new MR for that as because code becomes very massive and it will become difficult to us to track the error points I had created a new issue for that and a new MR

@sunbiz I had tried with Maven Repository: javax.annotation » javax.annotation-api » 1.3.2 (mvnrepository.com) but it is not working for JDK 11 issue can you tell me where exactly to add this if it can solve the issue?

and for STRNG_TOO_LARGE I had tried finding the string too large in decompiled apk but nothing is shown there. I had tried these things -

  1. Get decompiled apk from online decompiler and then tried to find STRNG_TOO_LARGE string in the decompiled files with the help of windows grep but It shows no string found.
  2. tried Android Asset Packaging Tool as well : aapt dump --values resources dhis.apk but here also not found any string with Too large
  3. At the end I tried after removing all the string (language support strings) from app except main values string to keep the app running but in that case also it is showing the same error.

Did you know any other way to solve it?

Could you check what project you are adding this to? It might be the dhis2-android-sdk or the dhis2-rule-engine which might be requiring this. If that’s the case (and you should verify if it works), we should send a merge request to DHIS2 upstream repos of those to allow support for JDK9+

I am very surprised that this doesn’t work. I would have suggested these 3 approaches and would have assumed that the last one solves it and then work backward by adding one-one language strings at a time.

Blog of my First Week of coding phase First Week of Coding : 7June -11 June (bhavesh3005sharma-gsoc21.blogspot.com)

I will cross check the things once again regarding this issue of jdk 9+ and let you know.

@sunbiz I think the JDK version problem is with dhis2-rule-engine. It is not supported with JDK higher than 8.

And for “STRNG_TOO_LARGE” also, I think the problem is with the files of core : of dhis2-android-sdk. I had checked there’s is no files in dhis2 app that can cause this error I had verified it by-

  1. Deleting all the strings as other than main value string and even in main value string I had changed the values of each string resource as “test” that is not large to cause error.
  2. Since this error can also be because of large drawables being used in the app. I had checked this possibility as well.To check this I had removed all the large drawables and commented their uses in the app. But the results remains the same with error.
  3. I had even checked the large fonts that are being used in the app as because app uses fonts that have more than 300kb of size but even after their removal error exists.

I had checked all the possibilities that I can for these 2 errors. If you have any other ways to solve Please let me know. According to me these 2 can only be solved by dhis2 itself by solving it in it’s 2 used submodules.

1 Like

Please explain a little bit more from where the trainer app should get data for media section? Does data be fetched using this https://mhbs.info/api/documents. If yes I am unable to see document without login!

We want to use the things that are uploaded to the Resources in DHIS2 and we can get that through the endpoint that you mentioned. So, please remove that one example video from the mHBS Trainer app, and instead upload those other videos to the Resources and fetch it and show it in the Media tab.

1 Like

@sunbiz I had added some dummy data in the resources of bmgfdev instance and made the UI changes to show it but unable to login https://mhbs.info/api/documents. Can you tell me how to access these resources or the login credential of mhbs.info instance.

When I am trying to access my test video uploaded at bmgfdev instance by this method getting an unauthorized response from the server. My request format -

Get request over this “https://mhbs.info/api/documents/kOORWmWIl7r/data” URL

Authorisation ( Basic Auth ) - username : testuser & password : Admin@123

According to me, these are the credentials of bmgfdev instance how they can get data from the mhbs.info instance?? Please correct me either the end points should be different or credentials.

@sunbiz I am able to get the uploaded documents on the bmgfdev instance via request over bmgfdev instance without testuser credentials. I have some questions -

  1. I think we are unloading documents on bmgfdev instance and also able to get documents from there then What is the need for https://mhbs.info/api/documents? Did you want me to get data from the mhbs.info instance? if yes then I need credentials for this instance to upload and fetch dummy data.

yes, you should upload using the website. Then anything that’s on the website, should be playable in the media in the app.

Week 2 Blog : Second Week of Coding: 14 June-18 June (bhavesh3005sharma-gsoc21.blogspot.com)

Please use the bmgfdev instance and not mhbs.info

1 Like

Yes thanks! When I was not getting the data with mhbs.info I tried bmgfdev and able to get data.

@sunbiz can we have complete discussion of all the features and scale ups that you want me to do at a meet or something so that I got a clear idea of all the tasks. You can suggest me any time when you are free in next days and please prefer a meet if possible so that we can discuss the strategies as well.

@sunbiz I am getting all the list of uploaded documents in our app and it is displayed in this way.

But I am unable to play videos and check the pdfs. I am setting the blob URL after getting from the document to an iframe but it is not working I am not getting what’s the issue can you please check. I am trying to get the document in this way -

I had even tried to directly redirect the user to the video link but it also didn’t work for our uploaded media.

Sample document url for testing -

https://bmgfdev.soic.iupui.edu/api/documents/bjFKm2f8E85/data (uploaded as a link)

https://bmgfdev.soic.iupui.edu/api/documents/kOORWmWIl7r/data (uploaded as a file)

And can you provide me some documentation or something how to get media resources uploaded on dhis2 as I didn’t get any such documentation.

<