In a contentious hearing, a Philadelphia judge on Friday ordered up-and-coming rapper Meek Mill to attend etiquette classes and provide his probation officer with details of all travel plans.

Common Pleas Court Judge Genece E. Brinkley told Meek Mill, also known as Robert Williams, he must complete the classes before Aug. 4 and notify his probation officer, Treas Underwood, any time he wants to travel outside Pennsylvania.

Those orders came at a probation-violation hearing for Williams, who is on probation for a 2008 gun and drug conviction. He was sentenced to 11 to 23 months in prison. Williams served eight months in jail and began five years of probation in fall 2009.

Williams, a North Philadelphia native, told the judge it was difficult to detail his travel plans because many of his business activities are arranged on short notice.

"I have my own record label with seven artists. . . . I do radio. I do interviews," Williams said.

Williams, wearing a gray shirt and black jeans, was accompanied by about five casually dressed men.

Assistant District Attorney Noel Ann DeSantis told the judge Williams was prolific on Twitter and other social media. As a result of some of Williams' pronouncements, she said, his probation officer had received threats from the rapper's followers via social media.

At times, the exchanges between William's lawyer, Gary Silver, and DeSantis grew heated. At one point, the court stenographer asked them to speak one at a time.

The judge said Williams needed etiquette classes to refine his use of social media and to help him explain the nature of his business to the court.

She recommended that Philadelphia radio host Dyana Williams conduct the classes because of her knowledge of the music business.

The judge said the etiquette classes were "more important than any concerts he might have."