Today
we will talk about a feature in Android Studio that is not known to
many. It is a feature of Live Templates that saves you time and effort
while writing the code and makes you write faster, even though Android
Studio has the Auto-Complete feature where you start typing a word. Toast, but the Live Templates take us beyond that, such as shortening
the code of several lines you wrote yourself to one word you write only
then shows you the full code you want
Let's have a look at them1- Open Android Studio, go to Preference, and then search Live Templates2- Search for live template on Android Studio3- Here you will find Live Templates divided into sections, including what is dedicated to Android, including C ++, including the xml, but what matters to us and we will use more is what won the Android category4-When you open Android, you'll find lots of shortcuts ready
5- You will find the code abbreviation and describe the shortcut in yellow and when pressed, you will find the code to be executed when using this shortcut
1 - is a shortcut that you can use when writing the code and then press Tab to write the full code here to implement this shortcut only write const then press the Tab key in the keyboard. 2. Description of the abbreviation describes exactly what this abbreviation does. 3- The code to be written when executing the shortcut. 4. Some options such as reformat the code when adding it.6- Navigate between different shortcuts and try them out and enjoy! .How to add new shortcut code7- To add a new code you will click the + button on the top right8- Add shortcut code live template
9- A new shortcut has been created and you must fill in the data such as the abbreviation and description of the shortcut as well as the bottom of the language setting where you can make shortcuts in xml or in another language while writing10- Add a new Live Template for Android Studio11- Then do a save and go to the Android Studio and experience
Sure, the method will make a big difference when you shorten a lot of the methods you use consistently and will code much faster and this was the goal of today's post
Let's have a look at them1- Open Android Studio, go to Preference, and then search Live Templates2- Search for live template on Android Studio3- Here you will find Live Templates divided into sections, including what is dedicated to Android, including C ++, including the xml, but what matters to us and we will use more is what won the Android category4-When you open Android, you'll find lots of shortcuts ready
5- You will find the code abbreviation and describe the shortcut in yellow and when pressed, you will find the code to be executed when using this shortcut
1 - is a shortcut that you can use when writing the code and then press Tab to write the full code here to implement this shortcut only write const then press the Tab key in the keyboard. 2. Description of the abbreviation describes exactly what this abbreviation does. 3- The code to be written when executing the shortcut. 4. Some options such as reformat the code when adding it.6- Navigate between different shortcuts and try them out and enjoy! .How to add new shortcut code7- To add a new code you will click the + button on the top right8- Add shortcut code live template
9- A new shortcut has been created and you must fill in the data such as the abbreviation and description of the shortcut as well as the bottom of the language setting where you can make shortcuts in xml or in another language while writing10- Add a new Live Template for Android Studio11- Then do a save and go to the Android Studio and experience
Sure, the method will make a big difference when you shorten a lot of the methods you use consistently and will code much faster and this was the goal of today's post
EmoticonEmoticon