Is there a shortcut in Android Studio for automatically generating the getters and setters in a given class?
Just in case someone is working with Eclipse
Windows 8.1 OS | Eclipse Idle Luna
Declare top level variable private String username
Eclipse kindly generate a warning on the left of your screen click that warning and couple of suggestions show up, then select generate.
As noted here, you can also customise the getter/setter generation to take prefixes and suffixes (e.g. m for instance variables) into account. Go to File->Settings
and expand Code Style
, select Java
, and add your prefixes/suffixes under the Code Generation
tab.