QR Code Sharing Feature does not work as expected in Android 3.0.1

Dear Community,

We are trying to use the “QR Code sharing Feature” for tracker Pograms, using Android Capture 3.0.1 and a server on 2.41.1.
Unfortunately, we face 3 main challenges, making this feature not usable at the moment:

  1. After sharing a TEI, and her enrollment, the “receiving” tablet displays the TEI correctly. However, it never appears in the Program TEI List. The only way to see the imported TEI is by making a research “Outside of the programs”. In other words, the TEI is saved on the phone, but does not display in the programs where it is enrolled.
  2. After setting up internet connexion on the receiving phone, we have always an error stating that enrollment date can not be ampty, even though the enrollment date does display on the receviing phone.
  3. Finally, the application is regularly crashing on the phone sharing the AR codes with this message:

java.lang.NullPointerException: Can’t toast on a thread that has not called Looper.prepare()
at com.android.internal.util.Preconditions.checkNotNull(Preconditions.java:167)
at android.widget.Toast.getLooper(Toast.java:274)
at android.widget.Toast.(Toast.java:259)
at android.widget.Toast.makeText(Toast.java:778)
at android.widget.Toast.makeText(Toast.java:767)
at org.dhis2.usescases.general.ActivityGlobalAbstract.displayMessage(ActivityGlobalAbstract.java:280)
at org.dhis2.usescases.general.FragmentGlobalAbstract.displayMessage(FragmentGlobalAbstract.java:69)
at org.dhis2.usescases.teiDashboard.dashboardfragments.teidata.TEIDataPresenter$onOrgUnitForNewEventSelected$1.invokeSuspend(TEIDataPresenter.kt:429)
at kotlin.coroutines.jvm.internal.BaseContinuationImpl.resumeWith(ContinuationImpl.kt:33)
at kotlinx.coroutines.DispatchedTask.run(DispatchedTask.kt:104)
at kotlinx.coroutines.internal.LimitedDispatcher$Worker.run(LimitedDispatcher.kt:111)
at kotlinx.coroutines.scheduling.TaskImpl.run(Tasks.kt:99)
at kotlinx.coroutines.scheduling.CoroutineScheduler.runSafely(CoroutineScheduler.kt:585)
at kotlinx.coroutines.scheduling.CoroutineScheduler$Worker.executeTask(CoroutineScheduler.kt:802)
at kotlinx.coroutines.scheduling.CoroutineScheduler$Worker.runWorker(CoroutineScheduler.kt:706)
at kotlinx.coroutines.scheduling.CoroutineScheduler$Worker.run(CoroutineScheduler.kt:693)
Suppressed: kotlinx.coroutines.internal.DiagnosticCoroutineContextException: [StandaloneCoroutine{Cancelling}@9e07474, Dispatchers.IO]

Are these problems related to the “QR Code” Sharing feature already known?
May be this feature was deprecated?

Many thanks for your advices on this

Hi @gregory,

the feature is not deprecated, if there is something that is not working properly we will look into it. Before that, I wanted to ask you a few things in order to have a better understanding about the context.

About the point 1, it might happen that the TEI is enrolled in an orgunit that is not in the Capture scope of the user. By default, the Program TEI list only shows the TEIs in the Capture scope. Could you check this?

Once the TEI is found by making a research “Outside of the programs”, does the TEI show the enrollment? Or just the TEI attributes?

Hi @vgarciabnz

Many thanks for your reply.

I don’t have the second device i used for testing with me anymore, but I am sure that the 2 users on the 2 devices had an access to the org unit used for the enrollment so the problem was not related to OU assignment. The second user was a copy of the first user.

I also remember that I shared the TEI and its attributes, as well as events but i am not sure whther I saw “Enrollment” on the screen during the sharing the of the TEI (between Attributes and Events).

On the device receving the shared TEI, I am sure I could see the date of the event related to enrollment stage (first stage)".

I may be able to have access to the device again during the week, but i need to borrow it again.

Hi @gregory

Were you able to get the device for testing? Any updates? Thanks!

Hi sorry, but I was not able to get the device again. I have to take care of another urging topic at the moment, so i will probably not be able to test again before at least 2 weeks. If you with to close this topic, please feel free to do so and I can open antoher one later.

@vgarciabnz

Hi,

I managed to find another second device to test again the “QR code sharing Feature” using Android Training APK V3.1.0 on both phones.

I used the same user on both phones (so same org units), and shared the TEI (containing TEI attributes, Enrollments in 2 programs, and events).

On the receiving phone, all the information from TEI attributes, TEI enrollments and TEI events is present. The only thing not working is that the TEI is not displayed in the list of the 2 programs where there are active enrollments.

However, if I search the TEI Outside of the program, I can retrieve the TEI, and i even see the enrollments after clicking on “Program enrollment”.

I think the only issue is that the TEI is not displayed in the program List, even though the enrollment for this program is registered on the TEI after fining it through the “search outside of the program”.

Please let me know if you need Print screens. I have a Screen recorder to share but mp4 is not allowed as attachment. I can share it by PM if necessary.

Thanks in advance

Hi,

Was anyone from the Android team able to have a look at this post and see if I am doing something wrong or if this is an issue with the Sharing feature on Android 3.01 version?

This would be important for our project to have this feature working.

Thanks

1 Like

Hi

Thank you for the follow-up. Would you kindly share the mp4 file by uploading it to this link: https://dhis2.padlet.org/gassim/submission-request/jA7rbnomMYEGz498

Thank you for your patience.

Hi @Gassim ,I just shared the screen recorder. Thanks for the follow-up and have a very good day

1 Like

Yes, thank you! I’m looking at it now and following up with the @dhis2-android team.

For the time being, I’ll close the ‘upload’ option in the link above. Let me know if you want me to reopen it. Thanks!

1 Like

@gregory Would you please double check that the ‘capture scope’ for this user that you are using to search for the TEI?
In both programs check:

Check that the TEI is enrolled in an OU that the user has ‘capture’ access to:
image

Thanks!

Hi @gassim
As mentioned, I used the same user on both phones to make sure the Capture org units were not a problem.

If I managed to enroll the beneficiary on the the sharing phone, this means that the receiving phone had the same org unit in his capture scope (as it is the same user).

However, I alway leave the search “Orga units” and “Data output analysis” org units empty, as from what I understood, this keep the same OU as capture by default.

I also leave the option “Maximum organisation unit level for data output” unchecked.

I will try to test this afternoon to select the same OU for search as for the capture for my user, and see if I can see the TEI in the program list, but I have little hope as I can find the TEI when searching out of the program.

Edit: I checked in the program access and the user has “Capture and view” for data and “can view only” for metadata.
Capture d'écran 2024-10-28 112234

Hi,

After updatting the search scope of the user, my phone also synced the data with the server, from the receiving phone.

After this sync, I was able to see the TEI in the program list.

This confirms (IMHO) that the issue is only related to the treatment of th TEI after receiving it by QR code (and before syncing to the server to receive the TEI from the server).

In other terms;
If i receive the TEI aftr syncing with the server, I can see it in the program list.
If i receive the TEI by QR code (without Sync), I can only access it by searching outisde of the program.

Besides, as i was able to find the TEI by searching outside of the program, I think the issue was not related to the search scope of the user.

Please let me know if you need futher info (or if I need to open a Jira ticket).

Thanks and have a very good day

1 Like

Good morning Gregory,

We’ve been able to reproduce the error and have created a ticket in JIRA to further investigate and fix it.

You can track the progress using this link. Please take into account that we are in the last days of a release process so some delay on addressing the issue may be expected.

Thank you for your help and patience, let us know if you have further comments on this,

have a great day!

1 Like

Hi @Daniel_Tari
Thanks for this. On Jira, I see that you only mention the App crashing, but there is also the fact that, even without crasing, Ythe imported TEI does not show in the program lists.

But may be the 2 aspects are related?

Thanks

1 Like

Hi @gregory ,

I suspect the issues are related because it seems that the source TEI org id may not being shared through the QR codes. We have reproduced the issue on our development versions and got a crash, so the consequences may be slightly different. We’ll make sure that your specific case is also solved when we address the issue, thank you for clarifying!

Kind regards.

1 Like