This would have been the best way. Nobody can hope to capture Dumbledore and force the secret out of him. It's not about the Potters' preference. Surely the best person for the job would have been Dumbledore?
3 Answers
He offered to do so:
“James Potter told Dumbledore that Black would die rather than tell where they were, that Black was planning to go into hiding himself… and yet, Dumbledore remained worried. I remember him offering to be the Potters’ Secret-Keeper himself.”
— Prisoner of Azkaban, chapter 10 (The Marauder’s Map)
Apparently James and Lily preferred one of their friends (or so they believed) to be their Secret-Keeper over Dumbledore, but I don’t think we get any reason why. Here’s a few that I thought of:
Dumbledore was already a high-profile target, and was near the top of Voldemort’s hit list. They probably wanted somebody more low-profile and less likely to draw attention.
Perhaps they weren’t sure about Dumbledore. Shortly before they went into hiding, he’s brought Snape (the former Death Eater and schoolyard rival) into the folds of the Order. As we learn at the end of Deathly Hallows,
Snape comes to Dumbledore when he learns that Harry is the target, and asks Dumbledore to hide them. Presumably this is what motivated the Fidelius Charm – thus Snape would have been accepted before they went into hiding.
I don’t think either of them were too keen on Snape at this point. They wouldn’t be the only people to doubt Dumbledore’s judgement about Snape, and maybe that was a deciding factor.
Dumbledore may not have agreed with the Potters over who to allow to know, and kept them from seeing their friends. (Or they may have worried that this would be the case.)
As for “It's not about the Potters' preference”, are you suggesting that Dumbledore force them to use him as Secret-Keeper? Coercion isn’t really his style, and that would be a great way to ensure they never trust him again.
According to the Harry Potter wiki http://harrypotter.wikia.com/wiki/Secret_Keeper, Dumbledore offered but the Potters refused as they preferred instead to trust their friends. Originally Sirius Black was supposed to be the Secret Keeper, but he suspected Voldemort was onto him so he passed the responsibility on to Peter Pettigrew (who betrayed them to Voldemort). A more realistic explanation would be that there wouldn't be much of a story otherwise: Dumbledore wouldn't have given up the secret, the Potters wouldn't have been murdered, and all the rest wouldn't have followed from it, or at least not in the same way. See also, Why wasn't James Potter his own Secret Keeper?, it mentions that Harry finds this out in The Deathly Hallows book talking to Remus Lupin.
Bernard gave a great answer at "Why wasn't James Potter his own Secret Keeper?" which applies to this question as well:
“You think I'm a fool?" demanded Harry.
"No, I think you're like James," said Lupin, "who would have regarded it as the height of dishonor to mistrust his friends.”
― J.K. Rowling, Harry Potter and the Deathly Hallows
I don`t think the book mentions why, but the above quote shows that James trusted his friends implicitly which is why he probably thought the secret was just as safe with his friends as with himself.
It was more important to James that he can trust his secret on his friends than to trust it on the wizard with the most experience who is the least likely to be captured.