There are two movies running in tandem in “Hitch,” and they both star Will Smith. In one of them, a rather delightful buddy comedy, he’s a professional date adviser who coaches a schlubby man toward dating success. In the other one, a run-of-the-mill romantic comedy, he mishandles his own personal life but eventually gets the girl. More of the former and less of the latter would have been ideal, but when dealing with Will Smith films I have come to expect less-than-ideal circumstances.

Smith plays himself, of course, though this version of himself is named Alex “Hitch” Hitchens. Hitch lives in New York (as do all romantic-comedy characters) and makes a living as the Date Doctor, helping men woo the women of their dreams. He gives advice on dating techniques once it comes to that, and he is not above manipulating events so the woman will notice the guy in the first place. For example, when a man is smitten with a woman who loves her little dog, Hitch arranges it so the guy can save the dog’s life.

Hitch prefers to remain anonymous as the Date Doctor, and he operates on the down-low so thoroughly that women think he’s an urban legend. Yet he still makes a fabulous living at it, apparently, given the state of his apartment and his well-tailored clothing.

His greatest challenge comes in the form of Albert (Kevin James), a slightly fat man who, in the tradition of all slightly fat men in movies, often spills food on himself and is known to be something of a klutz. (These are also the traits of all movie men, both fat and thin, who are socially inept. Somehow being nervous around strangers makes them sloppy even when they’re alone. Have sociologists studied this?) Albert works for a financial planner and is in love with the company’s richest client, the beautiful Allegra Cole (Amber Valletta). Hitch helps Albert get noticed by Allegra and subsequently coaches him on every aspect of their budding relationship.

Meanwhile, Hitch himself meets Sara (Eva Mendes), a gossip columnist who is jaded toward love yet who finds Hitch intriguing. He keeps his profession a secret from her, presumably so she can find out later, misunderstand it, and become angry with him, thus giving the plot a climax.

The joke is that Hitch the Date Doctor keeps screwing things up with Sara, attempting romantic maneuvers that backfire, accidentally knocking her into rivers, that sort of thing. Hitch’s ineptness is a much subtler irony than the film’s zany commercials make it out to be, for which I am grateful.

Kevin James, star of TV’s “King of Queens” (which I have not seen), is the film’s greatest asset by far. He demonstrates a flair for good-natured, non-frantic slapstick, falling around not with the reckless abandon of a Chris Farley, but with the comic grace of a Steve Martin. Some of his scenes with Will Smith are wonderfully played gems. The bit where he shows Hitch his awful dance moves is great, but I think I found the other highlight — where Hitch shows him the right way to get a kiss on the doorstep — to be even funnier.

Smith, let it not be forgotten, once starred in a sitcom, too, and is eminently more capable as a comedian than as an action hero. That said, even his comedy now has a certain sameness to it, and he needs strong co-stars like Kevin James to keep him afloat. Eva Mendes can do the funny when she needs to, but this film doesn’t let her. Her and Smith’s part of the movie lurches along amiably but unremarkably. Whenever they are on the screen, you wish Kevin James would show up again.

Eventually, the two plotlines must meet, and given director Andy Tennant’s schlocky track record — “Fools Rush In,” “Ever After,” “Sweet Home Alabama” — you can guess how it’s going to go down. You know it’s going to be a trainwreck, with someone stupidly misunderstanding someone else and everyone getting broken up and a sad song playing on the soundtrack until they get back together. I was hoping the highly entertaining Will Smith/Kevin James buddy comedy would take over, but in the end it’s the generic romantic comedy that wins out. Which is sorta like life, you know?

Still, that buddy comedy is real corker. James has the talent; if he can get a few good scripts, he might become a bona fide movie star. Let’s just hope he sticks to comedy, because I do not want to see him killing aliens. Well, OK, maybe just a little.

B- (1 hr., 55 min.; PG-13, one F-word, scattered other profanity, some vulgarity.)