As a teenager, Marcus Bullock had a lot going for him. He was raised in church by a doting mother. He was tall and sturdy, and a standout on the basketball courts in his hometown of Washington, D.C. He was a high achiever in the classroom.

Yet, he spun out of control. He smoked weed, sold crack, stole and torched cars and carried a gun. At 15, he was arrested for taking part in a carjacking and sentenced to eight years in an adult prison.

Now 37, Bullock has undergone an extraordinary transformation from gun-toting teenage drug dealer to successful painting and construction contractor and tech entrepreneur. The change was made possible, he says, by the most ordinary of things: frequent letters from his mother. That simple idea is at the heart of an app Bullock helped create to break the cycle of incarceration and rearrest that ensnares two-thirds of people released from prison.

The app, called Flikshop, is the closest thing that the nation’s 2.1 million inmates have to a social media platform. And it is catching the eye of some celebrity investors, including recording artist John Legend and former NBA star Baron Davis. Flikshop allows people to send messages and pictures to those who are incarcerated for 99 cents apiece. The messages are printed out as picture postcards and mailed to inmates at 2,200 prisons and jails around the country.

“When you are in prison, getting mail is like hitting the lottery,” Bullock said. “It is your connection to the outside world.”

For many inmates, that connection with loved ones is difficult to maintain. Friends and family members who might send hundreds of texts in a week, or post dozens of photos on Instagram, are often less likely to write letters. And phone calls for prisoners and their families can be a rip-off that costs more than $1 a minute.

Bullock sees Flikshop as not just a way to make money but as a key part of the effort to shrink the nation’s prison population. He travels the country giving talks about his own journey from prison to the world of business, and pitching potential investors. The app was launched in 2012, and his recent efforts to attract capital to scale it up have generated significant interest.

Davis, a former NBA All-Star, became an investor last year after hearing Bullock speak on a panel. Besides his equity stake, he also purchased thousands of Flikshop credits to give to people who are financially struggling. And he is working to bring other former athletes on board.

“The fact that his company was simple and solves a problem was appealing,” Davis said. “The hardest thing for people to do while in prison is to receive positive communication, and this app helps solve that problem in an organic fashion.”

Others have been similarly impressed. Flikshop won a $50,000 grant from Unlocked Futures, a business accelerator affiliated with Legend, a Grammy-winning artist who is also an advocate for prison reform. Unlocked Futures invests in social entrepreneurs who have been impacted by the criminal justice system, and Bullock was among eight grantees selected from hundreds of applicants.

Flikshop was also chosen from among thousands of applicants for a $120,000 investment from Techstars, which provides grants and consulting services for promising startups. One idea to help Flikshop grow is to reach out to nonprofits that work with citizens returning from prison so they can use it to publicize their services or send messages of support to inmates. Another idea to grow the company is to expand the Flikshop model to people who want to send holiday greetings, birthday wishes or other missives to people who are in basic training in the military services.

The Campaign for Youth Justice, which advocates against prosecuting and incarcerating juvenile offenders as adults, uses Flikshop to stay in touch with more than 400 people who were sent to adult prisons while they were still children.

“It is a wonderful service,” said Marcy Mistrett, the group’s CEO. “It is a critical, critical way for people who are incarcerated to stay connected. Connection to family and positive social networks is the single most important indicator of successful re-entry into society when people are released from prison.”

Creating a way for prisoners to maintain a connection to the outside world can help inmates resist the hopelessness that so often prevails in prison, Bullock says. For proof, he turns to his own experience.

When Bullock was arrested in 1996, he was in denial. Prosecutors and judges warned that he could face a long prison term after he was arrested with a friend for pulling a gun on a man and taking his car in the parking lot of a Northern Virginia shopping mall. But instead of taking responsibility for his crime and pondering the prospect of spending years in prison, Bullock says, he was largely concerned about getting back to his high school junior varsity basketball team. He was convinced that he had college potential as a shooting guard, and he says he at first viewed his arrest as little more than a brief detour from the road to a bright future.

“That says a lot about my thinking at 15 and 16 years of age,” Bullock said.

Reality sank in once a judge hit him with an eight-year sentence. Before long, Bullock went the way of many inmates. He was brooding and angry. He resisted the rules, fought people who even looked at him the wrong way and stuffed magazines into the lining of his jacket to fend off the shanks of his enemies.

Bullock was drowning in the chaos, hopelessness and unforgiving culture of prison. But he was saved by his mother’s determination to stay in touch. “She did something that very few people’s family members ever do in prison. She started writing me letters and sending me pictures every day,” Bullock said.

She wrote about the wallpaper in her office at work. She sent him pictures of cars she was thinking of buying, or his room in the house she had saved enough to purchase. She sent pictures of cheeseburgers, accompanied by exhaustive letters.

“She’d say, ‘Marcus, one day you will enjoy cheeseburgers when you come home from prison,’ ” he said. All of it conveyed an unmistakable message, he said: “You will not die in prison. I need you to understand this. There’s life after this.”

His mother, the Rev. Sylvia Bullock, worked 37 years for the U.S. Food and Drug Administration. She said the letters were therapy for her, too, and helped ease the pain of having a son in prison.

Bullock had provided everything she could for her son, even as she worked full time while pursuing her bachelor’s degree and later a master’s degree in divinity. She took him to church several days a week. She had him join the church choir, enrolled him in oratorical contests and cheered him on during his basketball games.

His arrest and prison sentence left her stunned. “The shock of when all this happened was a shock to me. He was living another life that I knew nothing about. It was like Dr. Jekyll and Mr. Hyde,” she said.

Writing her son and going to visit him on weekends was a way to cope. “I would just sit at my computer at work and type him letters, saying this is what happened last night. Or this is what is going on in church,” she said. “I would let him know if there were any events going on. Sometimes it would be a paragraph. Other times it would be an entire letter. I just wanted to keep him abreast of everyday life.”

Eventually, Bullock rediscovered his true self. He received a GED certificate in prison and started taking courses to learn about business and computer software. Once he was released in 2004, he applied for and was rejected for more than 140 jobs before he finally landed one with a paint retailer.

Before long, he was promoted from retail clerk to roving sales representative. After matching underemployed painters with people buying paint, he launched a painting company. Eventually, he built that firm into a contractor that won work at Baltimore/Washington International Thurgood Marshall Airport while employing a workforce composed mostly of former inmates.

Bullock was making good money, driving a BMW convertible and living in a large apartment — success he wanted to share at least in some way with his friends still in prison. He would write them encouraging letters from time to time. But he was often too busy to stay in touch as much as he would have liked.

What if there was an app that would make reaching out more convenient? he thought. Flikshop became the answer. He talked to businesspeople at informal meetups and met with app developers. Eventually, he pulled together a team that made Flikshop a reality.

“The first question people would ask me when I told them about my dream was: ‘Do you know how to build an app?’ ” Bullock said. “I was like, ‘Man, we didn’t know how to start a painting business or construction company when we started. But we’ve done it, and it came out all right.’ ”

Bullock envisions Flikshop playing a pivotal role in rehabilitating prisoners and changing how the public views returning citizens. Much of the narrative surrounding the current state of the criminal justice system is plain wrong, he noted. Most inmates are not beyond hope and rehabilitation, even though many of them committed violent crimes. To this day, Bullock wonders whether the person he robbed has post-traumatic stress from the carjacking.

Still, having inmates who made bad or even violent choices stay in touch with people outside of prison would help them more easily make the adjustment to civilian life once they are released, Bullock said.

So far, Flikshop is tapping just a tiny fraction of its potential market. But with its technical capabilities now honed and the ability to send cards to hundreds of prisons, the company is poised for growth. Bullock estimates that Flikshop sends out 10,000 cards a month, a job that his mother oversees from the industrial printer and computer link in the garage of her Washington, D.C.-area home.

The firm is looking to partner with more prisoner advocacy groups to pump up business. Meanwhile, Bullock is aiming pitches at athletes, entertainers and others concerned with prison reform for an upcoming round of financing to help Flikshop increase its marketing and production efforts. He also is working to scale up the Flikshop School of Business, which teaches basic business skills to inmates and people returning from prison. And he is working to expand the Flikshop Angels program, which allows people to donate Flikshop cards to those who cannot afford them.

“I know the potential we have because of what I’ve been through,” Bullock said. “I can personally remember every night at mail call behind those sweaty concrete walls, hoping for my name to be called, looking for a piece of love from anybody that remembered I existed.”