Android Parse JSON file from Assets

folder_openSnippets, Solutions
turned_in_not,
commentNo Comments
Under src/main add new directory named “assets“. Inside this directory add your json file. Create a Utils class to add the method that will read your json file from assets. import android.content.Context; import android.util.Log; import java.io.IOException; import java.io.InputStream; public class…
Read More

Kotlin RecyclerView with Click Listener

folder_openKotlin
commentNo Comments
Prerequisites : kotlin_version = ‘1.3.31’ In app – build.gradle: implementation ‘androidx.appcompat:appcompat:1.0.2’implementation ‘androidx.constraintlayout:constraintlayout:1.1.3’ In this post we will write in Kotlin a very simple example for RecylcerView with a click listener. activity_main.xml <?xml version="1.0" encoding="utf-8"?> <androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="match_parent" android:layout_height="match_parent"> <androidx.recyclerview.widget.RecyclerView android:id="@+id/my_recycler_view"…
Read More
Menu