We’re porting an application from the iPhone to Android.
Is there a way to have a static class for preferences which does not need an Android Context object passed in?
In the iPhone version we have a static Settings class which has some logic, but also handles getting and setting user choices. It can be called by services and other non UI elements.
Any language answer is fine, but we use MonoTouch and MonoDroid to leverage .NET.
No, there is no way to do that. The preferences are package-specific, and the package is represented by the Context.
In your Service you can use the service itself as a context, or you can create a preference activity in your package that you launch from any other app.