Grindr, the gay dating app, is an effective way to get gay black and Hispanic men to try home H.I.V. self-testing kits, according to a recent study.

The small study was confined to Los Angeles, and fewer than 400 test kits were distributed, but the idea has broader potential. Grindr is used by at least five million men in 192 countries, according to its developer.

In the United States, young gay black and Hispanic men are the groups most likely to be infected with H.I.V. and the least likely to be tested for it, because they often lack health insurance and fear being rejected by their families.

In some other countries, gay men may be harassed, jailed or even executed.

The study used banner ads on Grindr to offer free test kits. Recipients received a kit in the mail, a voucher that could be redeemed for a kit at a pharmacy, or a code that would produce a kit from a vending machine in the parking lot of the Los Angeles Gay and Lesbian Center.