Somehow I can't see his behavior as cheating. Worrisome, sure. What I believe this merits is a conversation with your partner. An honest conversation where you admit that your friend was "having fun" with your partner via the internet. Where you ask your partner why he downloaded the application. And about the future of your relationship. Maybe you should start by setting some basic ground rules, and not assume that everyone plays by some standard set of ideas about what constitutes a relationship.
He might lie to your face. That's one of the pitfalls of stepping off the cliff and entrusting someone else with your heart: they can break you. Your friend testing him seems like insecurity on someone's part, either yours or your friends. It isn't uncommon for your friends to be overly protective of you and your heart. Especially if they've seen you badly hurt in the past.
That your boyfriend gave someone a dick pic... meh. Stalkers can get the whole picture in a gym. Still,
we're discussing your partner's intention in doing so. Maybe he thought it just wasn't a big deal? I have, more than once, told someone what they wanted to hear, and I have, in the past, shown the whole enchilada (face and all) to an entire message board (no, so not happening here, don't ask). It didn't bother me. My partner was a little taken aback that I would be so brazen, but it was my decision and he knew that I wasn't after a random hook-up. If he had a real problem with my intent I would have backed off and acquiesced to his wishes. We would have also had a conversation about the boundaries of the possession of my body as well. See that: We talked about it.
Not everyone is as honest as I am, but that's (once again) the risk of a relationship. And by the way, relationships aren't all cotton candy and Harliqueer romance. They're supposed to be through the good and the bad. Sometimes they're so bad you have to end them, sometimes the faster the better. But not without an understanding of the issue.
Communication is the key in any good relationship. Trusting someone is the big gamble. If you put your heart out there anything can happen, good or bad, fabulous or terrifying. That is, unfortunately part of a relationship. Snap judgements, especially done in the heat of strong emotion, are generally not wise decision making process.
Just my opinion, not a ruling. Nothing works for everyone. Don't you love how the only thing absolute terms are really good for is to qualify each other?
Hoping the best for you...