The investigation showed Mohamed Lahouaiej Bouhlel had trawled the internet for information on a terror attack in the US city of Orlando and on the killing of a police couple in a Paris suburb last month, Francois Molins said.
A search of his computer also found violent images "linked to radical Islam", he told a press conference in Paris.
However, he said no clear link had been established between the father of three and the Islamic State group which claimed the Bastille Day carnage.
A sea of people thronged the seafront promenade in Nice where the attack took place for an emotional minute's silence. Similar ceremonies were held across the country, accompanied by the ringing of church bells.
More From This Section
But in a sign of the anger and bitterness gripping France after its third major terror attack in 18 months, Prime Minister Manual Valls was booed as he arrived and left Nice for the tribute.
Molins said the investigation confirmed the attack was "premeditated", and said 13 victims had yet to be identified.
Photographs found on the attacker's mobile phone showed he staked out the promenade in the days before he struck, he added.
Molins painted a picture of a non-practising Muslim who ate pork, drank, took drugs and had an "unbridled sexual activity".
Interior Minister Bernard Cazeneuve defended the government efforts to halt terror attacks, calling for "dignity and truth" from critical opposition politicians as the national mood sours further nine months ahead of the next presidential election.
Former president and main opposition leader Nicolas Sarkozy said yesterday that "everything that should have been done the past 18 months was not done".
"We are at war, outright war. So I will use strong words: it will be us or them," he said.
While previous attacks saw grand displays of national unity, there was no semblance of cohesion after the Nice massacre, with Sarkozy joining a long line of opposition politicians who have accused the government of not doing enough to protect the French.