I'm also 17, and my main way of stimming is flapping my hands and pacing up and down the room. At home I can stim all I want, every ten seconds or so. But in public I can control myself and not do it at all (although the feeling of restraining myself is very uncomfortable).
Whenever I feel like I desperately need to stim in class, I have found a way to do it discreetly - I wring my hands quietly under the table, or fiddle with a pencil or rubber. For me, learning how to suppress my stimming wasn't an immediate thing that came instantly; it took quite a bit of practice, patience and perseverance, but in the end it paid off.
Oh, and by the way, if the friends you have made dump you simply because you flap your hands, then they are petty and not actually friends at all. True friends will respect you for who you are and always try to understand.
_________________
I'm sailing across Spectrum Sea, in my little boat.
The waters of the port were choppy. After I set off, there was a long, massive storm.
Years later, however, the sea calmed. I'm still on tranquil sea, but I'll never reach the Neurotypical Beach.