We often deal with that type of question over at LawTrades.
You should build trust with the firm... and then making them sign all the proper legal documents.
Stuff like non-disclosure agreements, non-compete agreements, and intellectual property assignment agreement come to mind.
Happy to learn more about your needs and give you a tailored response for protecting your idea.
The simple answer is contracts and choosing your partner well.
The long answer is more complicated. Is there anything about your app idea that is ownable defendable? Would your partner have to develop or leverage existing IP or technology in order to bring your app to market? Is there any similar competitors already in the market?
The reality is that most app developers or firms are more interested in building apps than stealing other people's ideas. Their business is app development and deployment—not managing, marketing and running a business like yours. With that being said, there are dubious people out there doing sneaky things.
Find a developer or firm with a good reputation and track record. Engage with them professionally, put the appropriate contracts and paperwork in place, and move forward. If your idea can be patented do that. But keep in mind, that many firms may have to develop code or applications to make your app a reality and depending on your contracts, that work may end up being their IP—which is not an uncommon practice.
Hope that helps, feel free to reach out if you have any other questions.