Learning goals

Master the installation and use of two plug-ins, able to achieve code generation function.

Android generated plug-in Code Generator is a Code, to help speed up the development of the app, as long as good layout XML files, can help you to the Activity/fragments/Adapter files are generated.

LayoutCreator allows you to automatically generate layout-related initialization code such as findViewById in your Activity/Fragment.

Android Studio install plugin method

Go to File->Settings->plugins, download and install the plugins in Settings, and then restart Android Studio.

Search in Respositories /Browse Respositories can be used to find a plugin that is not installed locally. Select install and restart Android Studio to complete the plugin installation process. Then, if you want to continue downloading, you can query it. Finally, restart Android Studio.

supplement

The Code Generator will only declare controls with IDS for you, and will report errors when text characters are present in THE XML. We can change encoding to GBK, and then change GBK back to UTF-8 after the activity is generated.

The above is a few more practical plug-ins, if you have a better solution, welcome to discuss.

conclusion

  • This article describes the installation and use of Code Generator and LayoutCreator, a plug-in developed by Android, to improve your development efficiency. If you have a better understanding, welcome to communicate
  • Positioning: SharingAndroid&JavaKnowledge points, interested can continue to pay attention to