By Ryan J. Foley

Associated Press

IOWA CITY, Iowa — An Iowa man's use of a smartphone application to get legal help in the middle of the night proved key in getting his drunken driving conviction overturned.

Davenport police violated Craig Hermann's rights during his 2014 arrest, when a breath test showed that his blood-alcohol content was more than twice the legal limit, the Iowa Court of Appeals ruled Wednesday.

A West Des Moines law firm, Rehkemper & Lindholm, developed the Oh Crap! App to allow users to know their rights during traffic stops and other police encounters. In addition to providing tips such as be polite and remain silent, the application allows users to record audio of their interactions with officers and to contact an on-call lawyer in their area.

Hermann used the application's "contact a lawyer" function to reach one of the firm's on-call junior associates after he was pulled over and arrested at 1 a.m. on Oct. 4, 2014, said one of the app's creators, attorney Bob Rehkemper. The ruling is the first documented case in which the app, which was launched in Iowa in 2014 and has been expanded nationwide, has helped a user avoid conviction, he said.

"We're thrilled with it," he said. "It's nice to see it working out in the field for people."

Law enforcement officials have criticized the free app, saying they fear it will promote drunk driving by giving users the impression they can always get out of legal consequences. It has been downloaded to more than 100,000 phones.

Police officers stopped Hermann for driving without his headlights on, then arrested him after noting he had bloodshot eyes and smelled of alcohol.

After getting advice through the app, Hermann invoked his right to request an in-person consultation with an attorney or family member, as allowed under Iowa law. He told an officer that such a person was on the way, but the officer said "there was no time to wait" and that Hermann needed to decide whether to submit to a breath test. The officer had other service calls holding and wanted to return to patrol.

A judge upheld the officer's actions and found Hermann guilty.

But the appeals court reversed those decisions Wednesday, throwing out the results of the breath test and Hermann's conviction. The court noted that when Hermann invoked his right for an in-person consultation, police still had an hour to give him a breath test before a two-hour window for administering such tests ended. Not giving him more time violated his rights, the court said.

Copyright 2016 The Associated Press