Step 1 : Add dependency
Step 2 : Add this method
Copy the following code to your MainActivity.kt file as a method
Step 3 : Use this method
Step 4 : Repository
If you want the complete code, please check this repository.
Tutorial on my Youtube channel
Thanks for reading my article, consider following me if you wanted to get notified when I write related articles.
You can contact me through LinkedIn.