I'm no expert but the case could be made that because you don't stay in a hotel, your friend is therefore financially sponsoring you, by providing you with a place to stay.
Also, if I remember correctly from my days of travelling with a weak passport, the invitation letter is not just a handwritten letter, but an official document your host will have to get from the immigration office, fill out, and send to you. It's straightforward but not be hassle-free, as they will have to provide a proof of address, bank statements etc, to get one issued. (Find more information here 🇩🇪)
That's why it's sometimes easier just to book a hotel room for the duration of your stay, and cancel after you get your visa. You still take the hotel reservation with you, for when you go through immigration at the airport, in case they ask you to show a proof of accommodation, but don't worry, they won't call the hotel to check.
this territory is moderated