Do you mean Mapsforge library?
(please include library name in topic titles)
Mapsforge does not have native rotation of the vector map
elements.
Can be done externally, like in
RotateMapViewer
example in samples.
Compass is app related, can include one on top of map and find
resources online or Android documentation.
For native rotation with Mapsforge maps and more features can see
VTM
OpenGL vector map library.