So I'm planning on going to Germany using a 15€ flight deal sometime this summer and I hope to spend as little as possible. I was wondering if it is legal to sleep in a park or on the streets and maybe some tips for when sleeping outside in public?
What is your citizenship? You may be required to bring money for your stay but not required to actually spend it.
If you are an EU/EEA citizen, you have rather strong rights to stay. If you need a visa, being found homeless may complicate your next application.
It is not illegal to be homeless in Germany. You may be asked to move from some places, notably rail and subway stations. Slinging a hammock in a park may damage trees, which would be a problem.
It is not pleasant or entirely safe. Some of the most likely places are used by homeless people, often people with substance abuse problems or mental issues. Taking their habitual sleeping spot could lead to quarrels.
On the other hand, your night sleep may be interrupted by people who want to check on your health, especially in areas where homeless people are not common. If you do not speak German, you might be quite awake by the time you make them understand that you need no ambulance.
Check if you qualify for stays in a youth hostel or look for a cheap backpacker hostel.
I strongly recommend not sleeping outside in larger cities. Especially not in parks, as you may become subject to attacks from youth gangs doing drugs.
It's all okay in rural areas (yes, they have parks in villages and suburbs). Technically it's not allowed to build up a hammock or tent in public space but as long you don't litter the place or camp for days no one will stop you. No cooking – that's camping and some neighbors will call the police.
Also note the weather is pretty unpredictable in Germany. There may be two weeks of sun, but two weeks of rain is much much more likely.