Moblie cam to cam
Auto Guard is an example of a dash cam app that can run in the background, and the paid version can even run at the same time as other apps.
When you place your phone into a car dock, an app with this functionality will automatically turn on and start recording.
Note that many dash cam apps can be operated when not actively in focus, meaning that they are capable of recording when there is absolutely no outward indication that your phone is recording.
This makes some of these apps suitable for use as spy cams, but completely aside from the question of whether dash cams are legal, it's important to remember that recording people without their knowledge is illegal in a lot of places.
You may even be able to have a small picture-in-picture view of Auto Guard in the corner while in other apps, depending on your hardware.
One of the main problems with dash cam apps versus hardware devices is that you have to set the app up every time.