How to automatically generate getters and setters in Android Studio

Solution 1:

Using Alt+ Insert for Windows or Command+ N for Mac in the editor, you may easily generate getter and setter methods for any fields of your class. This has the same effect as using the Menu Bar -> Code -> Generate...

enter image description here

and then using shift or control button, select all the variables you need to add getters and setters

Solution 2:

for macOS, +N by default.

Right-click and choose "Generate..." to see current mapping. You can select multiple fields for which to generate getters/setters with one step.

See http://www.jetbrains.com/idea/webhelp/generating-getters-and-setters.html

Solution 3:

Android Studio & OSx :

Press cmd+n > Generate > Getter and Setter

Android Studio & Windows :

Press Alt + Insert > Generate > Getter and Setter