Rapsssito / react-native-background-actions

React Native background service library for running background tasks forever in Android & iOS.
MIT License
818 stars 117 forks source link

Question: UI thread slows down in Android when ForeGroundService in action #230

Closed santo4ul closed 4 months ago

santo4ul commented 4 months ago

Hi,

OS: Android

I'm working on an Android application that uploads audio/video/images in background (while the user can still use the UI).

I tried this package and it works well. However, when the audio/video/image upload is going on in a ForeGroundService, the UI becomes very unresponsive.

I think this is expected as the Headless JS uses the UI thread (or the main thread).

Is there a way to get around this behaviour?

Thank you.

Rapsssito commented 4 months ago

Hi @santo4ul, you might want to take a look at https://medium.com/@slavo3dev/mastering-threads-in-react-native-boost-your-apps-performance-cd915c8fa752