Setup Firebase Database and Retrieve data from Firebase in Android| Inshorts News App Clone PART 2 | Android Studio | Firebase

Overview

Part 1: Add the required dependencies and file in the android project for firebase.

Part 2: add some data

Part 3: Retrieve data from Firebase

  • First create an ArrayList to store data from firebase in the main activity.
  • Create Database Reference
  • Add data to arrayList, make sure all names will be the same as database
  • Now change the adapter signature, add all arrayList inside the adapter class

Part 4: Import Glide

  • now we will use Glide library to show images and set the data from array list to textView.
  • to use the glide library first adds the dependency in the build.gradle app module.
implementation 'com.github.bumptech.glide:glide:4.11.0'annotationProcessor 'com.github.bumptech.glide:compiler:4.11.0
  • now use the glide in the adapter class to retrieve image from the database and also set the data in the textViews

In the next part, we will see how to use swipe left gesture to read a full news article in the inshorts news app.

--

--

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store
Golap Gunjan Barman

Golap Gunjan Barman

Hi everyone, myself Golap an Android app developer with UI/UX designer.