Android Instance Variables <p>Are instance variables preferred over local variables or vice versa? For instance, with using <code>SharedPreferences</code>, should it be declared at the top of the class and then referenced throughout or should it just be declared in each method it is needed?</p> <p>I am wondering if there would be a large difference in memory usage since the instance variable would last as long as the activity; however, it would be cleaner since I would not need to instantiate it in every method it is used.</p>