I think it's most likely doable in the beach and the jungle. If it's habitable place, maybe school or some abandoned place. But generally the locals are very curious about stranger :D Nonetheless, those are very useful tips. I'll try that in my future travel since I kinda miss the beach so bad :-)
Safe travels!
RE: How can a traveler spend the night in Indonesia? Hammock