As an Android Developer in software consultant, time is the most important thing. We are always chased by “deadlines” that are impossible for everyone. But as we know there is a saying “Many roads lead to Rome”, something that seems impossible, we can solve it. The essence of the speed at which the application is made, do not repeat what we have done. Besides time, i also have to pay attention to the quality of the code and program.
This time the method that I use for making an application is using a framework and template. From my experience using framework and templates, I can save up to 30–50 minutes in making one feature, because we don’t have to recreate every function, besides that we only enter the class name, and some files will be made automatically by Android Studio. The next thing I have to do is just equalize the design and add some functions that didn’t exist before.
For installation, you can clone the framework and template from here and here. The framework uses the MVVM design pattern, I chose to use MVVM because we can directly change the appearance by simply changing the value of the variable from the Java/Kotlin class. But, I don’t judge that MVVM is powerful than any design pattern, you can also use MVP, MVC or MVW (Model View Whatever ?✌?), but i created the template compatible for MVVM.
After clone the framework and template, first you can execute install.sh (tested on mac), but if you use Windows platform, you can copy manually the folder into Android Studio template folder location ( [androidstudio-location]/plugins/android/lib/templates/other/ ), just paste all of the templates folder into that location. After copying frameworks, you can restart the Android Studio. And when the Android Studio is already running again, you can see the framework in New > Other > Choose your template.
Benefits of using templates:
- Speed up the application creation period
- Minimize errors and bugs
- Other developers are easier to read our code
- Other developers are faster learning our code.
If you choose MVVM-Fragment; Android Studio will create all MVVM files (activity, fragment, viewmodel, userActionListener, layout file), but if you choose MVVM-Fragment; Android Studio will create files without activity file, and then we have MVVM-Fragment-LIST, this template will create all MVVM with recyclerView adapter with dummy data. If you have finished making an android page using template, then you must done all TODO and register your new view model into ViewModelFactory class. After that you can redesign the layout into the application that you expect!
If you got problem when installation framework or templates, you can see these videos:
Radhika Yusuf is an Android developer.
Anda membutuhkan jasa pembuatan aplikasi Android? Silakan hubungi kami di tautan tersebut.