-1

Here is the Screenshot of Firebase Storage :

here is my java code :

 public View onCreateView(@NonNull LayoutInflater inflater,
                         ViewGroup container, Bundle savedInstanceState) {

    View root = inflater.inflate(R.layout.fragment_tools, container, false);

    recycler_view = root.findViewById(R.id.recycler_view);
    recycler_view.setHasFixedSize(true);

    FirebaseStorage storage = FirebaseStorage.getInstance();
    StorageReference storageReference = storage.getReference("Quotes");
    Log.e("STORAGE REF : " , String.valueOf(storageReference));


    String arr[] = new String[]{};
    for (int i =0;i<= Integer.parseInt(storageReference.getPath());i++){
    }

    ((MainActivity) getActivity()).getSupportActionBar().setTitle("Quran Quotes");

    final ProgressDialog pd = new ProgressDialog(getActivity());
    pd.setMessage("Loading");
    pd.show();
    final LinearLayoutManager linearLayoutManager = new LinearLayoutManager(getActivity());
    recycler_view.setLayoutManager(linearLayoutManager); // set LayoutManager to RecyclerView
    quotesModelList = new ArrayList<>();

I have got the Reference of Storage in the Logcat :

 E/STORAGE REF :: gs://mosque-614df.appspot.com/Quotes
Hemant N. Karmur
  • 840
  • 1
  • 7
  • 21
Zed
  • 57
  • 9
  • you cannot get all at once you can download each file using task in a loop and you have to know the path and file name: https://firebase.google.com/docs/storage/android/download-files – Elias Fazel Dec 21 '19 at 03:18
  • Is there a way to show all the Images inside a recyclerView ? it will be very helpful – Zed Dec 21 '19 at 03:20
  • Yes as you download each file you can add it to a data holder/adapter. and here is a library to download image from url https://github.com/bumptech/glide keep in mind first read firebase document to understand how to get downloadUrl of file then put it in Glide. – Elias Fazel Dec 21 '19 at 03:22

1 Answers1

0

Firstly you have to store image download URL into firebase-database when you upload any image to firebase-store.(When you upload any image to firebase-store, you will get image download URL on success of image upload.)

So to display list of images into recyclerView, you just have to call reference of firebase-database and you will get all images at once.