How to use wifi for a specific app and celluar data for the rest?
You can try to automate the process. The following is accomplished using Automate. There are other apps you can use to get the same results.


Create a new flow.
On the Apps category (on the drawer), select App in foreground?. Set Proceed section to When changed. On the package section, select your app. Save it. Connect it to Flow beginning block.
On the Connectivity category, select Wi-Fi set state. Save it. Set it to On'. Connect itsOKto theYes` of Step 2.
On the Connectivity category, select Wi-Fi set state. Save it. Set it to `Off'.
On the Connectivity category, select Mobile data set state. Save it. Set it to On'. Connect it to theOKof step 4 and to theIn` of Step 2.
Save the flow by pressing the back button. Give it the necessary privileges. Click on Start.


Your flow will look like the image below. When you app is in the foreground, Wi-Fi will be enabled. When your app is the background, Wi-Fi will be disabled and mobile data enabled.

Disclaimer: I am just a user of the app.