Only an asshole of a cop would ticket a cyclist for riding on a sidewalk.
If you have to ride on a street, I’d ride against the direction of traffic. If it is safer to walk on the side opposite the flow of traffic, it’s safer to ride on that side for the same reason.
Having a freaking huge flashing red and blue light might also help.
Best decision is to ride on a dedicated bike path
"...I'd ride against the flow of traffic..."