Connecting and disconnecting has nothing to do with the app - that's between the headphones and the phone.
Are you walking too far from the phone to maintain the connection? (30 meters - around 100 feet
Do you have your body between the active part of the earphone (only one of them is active - the one you charge) and the phone? That can, depending on your body, exceed the range. (One pound of very conductive body tissue can absorb as much signal as 20 feet of air.) If that's the issue, turn the earphones around (left for right) or move the phone to your other side.
Bluetooth headphones are Class 3 - 1 mw - ~1 meter (<3.3 feet) range. Regardless of their "longer distance" claims. (People are so scared of "radiation" - but want more of it right next to their heads, to get longer range from Bluetooth. - you can't have the range without the radiation.) Some headphones are Class 2 - 10 mw - 10 meters - but the human body can still absorb all of that.