I’m working on a small project where I’m making a compass that is going to be used on top of a MapView. Everything works just fine when running the program (compass part) within its own activity (not on the MapView), but because the compass has to be integrated into another package containing the Activity that holds the MapView, I want my compass code to be accessed from that package.
The problem is that I don’t know to initialize the sensors from the other package or if I have to do it from the Activity itself and then somehow pass the instance of the SensorManager to the compass package.
I hope that my question is specific enough, but if not, I’ll gladly post some of my code 🙂
If you have a valid Context you can start the sensor manager from another package.