Intialization of static variables in a class of utility functions
<p>For my Android application, I have written a class which is composed of utility functions which are needed at various activites in the application.In this class, I need a context variable(for working with files) and an instance of preference manager and preference editor.Also, a long integer represnting the current date as a timestamp is needed:</p>

<pre><code>private static long today;
private static Context myContext;
private static SharedPreferences sharedPrefs;
private static Editor editor;
</code></pre>

<p>Which is correct way to initialize these variables. I have tried doing it via a private constructor as shown below, but I am getting errrors.</p>

<pre><code>private NetworkController()
{
    //Getting the Unix timestamp for today
    GregorianCalendar aDate = new GregorianCalendar();
    GregorianCalendar tDate = new  
    GregorianCalendar(aDate.get(Calendar.YEAR),aDate.get(Calendar.MONTH),  
    aDate.get(Calendar.DAY_OF_MONTH), 0, 0, 0);
    today = (tDate.getTimeInMillis())/1000; 
     //The preferences manager for reading in the preferences
    sharedPrefs = PreferenceManager.getDefaultSharedPreferences(myContext);
    //The preferences editor for modifying the preferences values
    editor = sharedPrefs.edit();
}
</code></pre>

<p>One approach would be to create an instance of this class in every activity where its used but I don,t want to do that.Any other approach is possible?</p>
