Few time saving tips on Android Studio
Some developers may already be using these methods to save some time. So if you haven’t, it may save a few minutes of your time.
Generate Getters and Setters in Android Studio
If you are creating a model class to store data with large number of variables, you may have manually created getters and setters for all those variables. This may help you to save some time.
Right click anywhere inside the class. Select
Generate -> Getter and Setter
Now select the variables for which the getters and setters should be generated. Now Android Studio automatically generates it for you.
Shortcut Key
Alt + Enter -> Generate -> Getter and Setter
Implement Methods
Unimplemented methods in a interface can be implemented by using the shortcut key,
Ctrl + I Command + I (Mac)
A dialog pops up. Then select OK.
Override Methods
To override a method from Super class you can use the shortcut key,
Ctrl + O Command + O (Mac)
Creating Singleton Class
Right click on the package name. Select New ->Java Class
Select Kind as Singleton. Then enter a name and select OK.
Some developers may already be using these methods to save some time. So if you haven’t, it may save a few minutes of your time.
Generate Getters and Setters in Android Studio
If you are creating a model class to store data with large number of variables, you may have manually created getters and setters for all those variables. This may help you to save some time.
Right click anywhere inside the class. Select
Generate -> Getter and Setter
Now select the variables for which the getters and setters should be generated. Now Android Studio automatically generates it for you.
Shortcut Key
Alt + Enter -> Generate -> Getter and Setter
Implement Methods
Unimplemented methods in a interface can be implemented by using the shortcut key,
Ctrl + I Command + I (Mac)
A dialog pops up. Then select OK.
Override Methods
To override a method from Super class you can use the shortcut key,
Ctrl + O Command + O (Mac)
Creating Singleton Class
Right click on the package name. Select New ->Java Class
Select Kind as Singleton. Then enter a name and select OK.
GOOD LUCK
Comments
Post a Comment