Getting shot at by Taliban fighters and need to call an air strike? There's an app for that.
Tactical Nav can be downloaded to a smartphone to figure out where an enemy is firing from, and to call in an air strike or covering fire.
It was created by US army captain Jonathan Springer after two of his comrades were killed in a rocket attack.
He says it is as accurate as any technology currently in use for the same purpose, and far cheaper too.
Captain Springer is back in his Indiana home after a 12-month tour in Afghanistan with the 101st Airborne.
Over a beer, he remembers fallen comrades - and two in particular.
"Specialist Plunk and Specialist Thompson. We were in the Pesh River Valley. They took a rocket. Died instantly."
Those deaths, he said, got him thinking.
"What can I do to help prevent something like this in future?"
His answer was to create the Tactical Nav app, which troops can download to their smartphones.
"It combines three components," he said.
"A compass, a map, and a camera. It's pretty simple - but obviously it does a little more than that."
He said he's tested his app against everything currently in use in Afghanistan - and claimed it is just as accurate.
The app is designed to give soldiers exact co-ordinates for where enemy fire is coming from.
They can then send that information to their command centre, who will decide whether to call in an air strike, or send a rescue helicopter to help wounded troops.
"The first time I tried it for real," he said, "I sighed with relief.
"I could have got into trouble - but it worked.
"As a fire support officer, I take into battle a compass, binoculars, a map, a protractor, a GPS device - a secondary GPS device in case one fails - and batteries.
"What this does is, it combines all these components, and throws it into just the one app," he said.
But Captain Springer said he'd been disappointed that his US army bosses hadn't taken more of an interest in the idea.
He said he had spent about £20,000 (more than $30,000) of his own money - and that he asked the military for financial support.
"I emailed the army saying, 'I'm not looking for a pay-cheque, but are there any kind of grants or anything you can help me with?'
"They said, 'sorry, we don't have the funds right now'."
Captain Springer said he was "very frustrated" by that response. He called it "a slap in the face".
"It really hurts because I'm doing something for the troops. But it just motivates me to continue."
The US military didn't respond when Newsbeat asked them for a comment.
In the UK, the Ministry of Defence says it's "actively exploring" ways to use smartphones in recruitment and training, as well as on the battlefield.
Now, Captain Springer is selling his app to anyone that wants it - on the iPhone's app store.
"I only sell it to try to make back the money I invested - I don't see dollar signs. I see soldiers' lives," he said.