-1

Suppose I have 5 audio files in Firebase Storage and I want to retrieve those 5 audio files and display them in a list view. As I click on any of 5 files then they should be downloaded to local phone memory?

Frank van Puffelen
  • 565,676
  • 79
  • 828
  • 807
shrishyl47
  • 161
  • 1
  • 1
  • 13

1 Answers1

0

Get the list of your 5 songs on your refernece.then add this list to adapter

            your_ref.addListenerForSingleValueEvent(new ValueEventListener()     {
             @Override
            public void onDataChange(DataSnapshot dataSnapshot) {


            songslist= new ArrayList<String>();

            Toast.makeText(DataFromFirebase.this, "number of songs are " + dataSnapshot.getChildrenCount(), Toast.LENGTH_LONG).show();
            //String value = (String) dataSnapshot.getValue();
                sizetemp=dataSnapshot.getChildrenCount();
            // Result will be holded Here
            for (DataSnapshot dsp : dataSnapshot.getChildren()) {
                songslist.add(String.valueOf(dsp.getKey())); //add result into array list

            //NOW YOU HAVE ARRAYLIST WHICH HOLD RESULTS




        }

        @Override
        public void onCancelled(DatabaseError firebaseError) {

        }


    });
Narender Reddy
  • 463
  • 6
  • 18