teamraincoat / agricat

Enrollment application for agricultural insurance policies
0 stars 0 forks source link

Research and prototype alternative camera component integration #66

Closed j0x0j closed 2 years ago

j0x0j commented 2 years ago

We encountered a known issue when using the native camera component that causes the main application to be garbage collected by the OS. This manifests more severely in Samsung devices which are notorious for killing background apps, they do not adhere to the process management spec set by Google. Here is an article describing the issue and a workaround.

Here are some more technical posts about the issue:

This is not an issue with a particular camera library, but with react native and how specific vendor OS manage background app processes. We can see a solution with the QR code scanner we have implemented. Since the QR code scanner is a view inside the app and not a new activity in Android OS, then we never hit this issue.

I propose we explore a few libraries to see which one will have the easiest implementation while remaining as a view inside the app so that we don't send the main app into background mode.

Here are two we can look at as react-native-camera is deprecated. We need to make sure that it works well on Android.