TORONTO -- A new smartphone app aims to offer byte-sized legal advice as well as other protections to people randomly stopped and questioned by police.

Called Legalswipe, the free app comes amid emotional debate over "carding" and similar practices in which officers ask for information unrelated to a criminal investigation. Critics argue young black men and other visible minorities are disproportionately singled out for the stops.

Law school grad Christien Levien, who said he has had his own unpleasant police encounter, said he saw a genuine need for his app.

"The community at large is concerned about their legal rights," Levien said Monday. "Especially marginalized communities perceive that the police have been violating their legal rights."

Applicable to both Canada and the United States, the advice comes by way of a series of brief questions and answers.

The initial question: "What is the officer attempting?" allows users to choose options such as: "Obtain identification" or "Engage in a search."

It then suggests questions to ask: "Why are you requesting my ID?" or "Am I under arrest?" and offers talking points and advice on what information you must provide.

"If you are not being arrested or detained, then you are not required to show ID," the app states.

Other functions allow users to video an encounter and send the recording to a remote server, and to send geo-tagged email messages.

Desmond Cole, whose account of more than 50 police stops appeared in Toronto Life magazine in May, said such encounters spark fear and confusion. The app, he said, can act as a rights "refresher," while the video feature can be invaluable in documenting situations.

"What people face on a regular basis from police as far as being stopped and not being told the reason why, being asked to produce identification for no apparent reason, these things are quite damaging," Cole said.

Toronto police spokesman Mark Pugash said officers are under unprecedented scrutiny due to changing technology. The app is part of that change, he said.

"I don't see it as provocative," Pugash said. "As long as the public doesn't interfere in a police officer trying to do his or her job, if they're recording it, they're entitled to do that."

A few years ago, Levien, 28, said an officer asked him for ID. When he asked why, a second officer slammed him from behind into the ground, bloodying his face, and then placed him in the back of a cruiser, he said. "I was scared; I didn't know what to do." They released him without charge or explanation, he said.

Levien, who is studying for his bar exams, said he spent several years pursuing a formal complaint that led to one of the officers being reprimanded.

Although the advice function works, the email broadcast and video functions are having teething problems. Still, the app, available for Apple and Android devices, has been downloaded about 2,000 times in just a couple of days.

Levien is trying to raise $140,000 via crowdfunding to further develop the program -- adding other languages is a priority.

Alvin Curling, the only black person to serve as Speaker of the Ontario legislature, said in a statement that legal-rights education is "essential to a working democracy."