I know that "advice" is uncountable and thus is incompatible with the article "a".
However, the phrase "Just a friendly advice" seems to be rather widespread.
Is it idiomatic, or incorrect? What is a more grammatical form?
Dear reader: I'm going to offer you a little friendly advice. When checking to see if something is "grammatical," do not rely on a Google search. Google will return hits from blogs and message boards, which are not necessarily reliable sources for determining correct English. Google will also return other odd nuggets, such as a fraction of a user's handle. Instead, use Google books, which restricts the search to published works, where the number of results will be a more reliable indicator.
For example, typing "just a friendly advice" into Google returns roughly 1,000,000 hits! Surely one million hits can't be wrong, right? Well, let's look at a few of these (the text I have bolded may help indicate the reliability of the wording):
From a message board:
Just a friendly advice!
So, here’s an advice.. Quitting is hard, but don't give up! The easily stop smoking worldwide program , Nosmoq was proven to be the easiest, most effective and possible real herbal treatment of smoking for just 4 to 7 days
From a message board:
Re: WHOA! - Just a friendly advice
IMHO, I think is more self-explanatory to show crops at 1:1 ratio. An square helps to make a difference between the original and the crop at first sight.
From a cat:
Just a friendly advice: think veeery carefully about what you're going to do next.
From a message board:
Just a friendly advice for those faulting their R6
So back when I first started riding with an 88FZ750 it always died on me. So much that I always had jumper cables and a set of tools on me. Now with my R6 I don't need the cables but I still carry a set of tools in case something does happen. Today was that day. On my way to work my bazaar unit crapped out and died leaving me with error 39 on the Side of the road. It was early morning so tech support were still sleeping. I didn't want to pay towing fees so I proceeded to remove the whole bazaar harness on the road, or just enough to get to work and home. After about 30 min I rewired the lower injectors back to stock and she fired right up! Not runnin perfect but she still gets to places. It was also 90 out at 8am so having water helps.
As for that last one, I'd love to have that guy stop to help me on the side of the road, but I wouldn't want him proofreading my term paper.
Moving the search to Google books cuts the number of results down from roughly a million to a very small handful.
Some may claim there is "nothing wrong" with it; I suppose that would depend on what was meant by "wrong." If I can say, "Just a friendly hint", shouldn't I also be able to say, "Just a friendly advice"? I suppose I could (after all, this writer did); however – discussion board titles notwithstanding – I think most hearers would find it awkward. I'd be more inclined to follow Robusto's guidance, which sounds much more natural to my ear.
On the topic of a friendly advice having 1,070,000 hits - some friendly advice gets 137,000,000 hits. In other words, the 1,070,000 million, despite the impresive number of digits, is a fraction of 1% of the total and therefore 1,070,000 mistakes.
Advice is uncountable, so it should be be "some friendly advice", which is reflected in the Ngram above.
Is "Just a friendly advice" grammatical?
Assuming you meant "grammatical" in its "grammatically correct" form, then... no. It isn't.
Advice is a non-countable noun and, as such, "an advice" is invalid. Injecting the adjective "friendly" does not change that.
Here are some correct equivalents:
The mistake you made, I think, was in trusting a Google hit count to suggest the correctness of an English phrase; a cursory glance across a few arbitrary websites indicates that this is silly.
Just a friendly advice cannot be said to be ungrammatical as advice is sanctioned as being at least pluralisable on occasion by both the AHD and Collins, and definitely count on occasion (sense 3) by Webster's.
It falls quite close, however, to Colourless green ideas sleep furiously - not breaking rules of grammar (unless context forces the usual non-count meaning of advice to be inferred) (which 'friendly' strictly doesn't) - but semantically unacceptable / needing freewheeling looseness in usage.
The Oxford English Dictionary lists advice as a count noun:
2b. As a count noun. - (a) A piece of advice (sense 2a). Now chiefly Caribbean and S. Asian.
It lists usage back to the 13th century:
1418 in R. W. Chambers & M. Daunt Bk. London Eng. (1931) 195 (MED), The same Ordynaunce turnyd in-to englysche be the Avyces of the Fraternite.
Grammatically, if a countable advice is just a bit of uncountable advice, it makes perfect sense. However, as the OED indicates, this usage is no longer current in all dialects of English, and thus will seem odd, unidiomatic, or ungrammatical.