As a Native android developer, it is very difficult to parse a complex JSON in our application. Normally the rest api json structure is much complex to parse it using functions as getObject(), getString(), getBoolean() etc. So, In order to overcome this problem also for save time we use GSON. Many developers already know that, but here I give you a simple and short solution that, you can convert JSON to Kotlin Model class for any complex JSON within 5 seconds. So Just follow the guidelines- Okay, First you can add the gradle dependency of GSON implementation 'com.google.code.gson:gson:2.8.6' Now I can take a sample JSON, which I make model class and then parse. Below I mentioned the sample json- { "problems" : [ { "Diabetes" : [ { "medications" : [ { "medicationsClasses" : [ { "className" : [ { ...
In every single android application, we need to make many number of recycler-view adapter. So every time you create a blank adapter and modify it as per your requirements. But it is very boring and as well as time taking. So here I give you a solution that you can create any recyclerview adapter within 5 seconds using file template in Android Studio. So, Lets read this full article- First we open android studio and create a project. After project creation Open File->new->Edit File Template... Follow this below screenshot Okay, After click on "Edit File Template" a popup is open "File and Code Template", Now click on the " + " icon and set set your template name. Now set your template name, template extension and template body. after doing everything click on "Apply" and then click on "OK" The template body I after after the screenshot Template Body Copy this code and paste it on the template body section, which I marked in scre...