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?
Asked
Active
Viewed 1,724 times
-1

Frank van Puffelen
- 565,676
- 79
- 828
- 807

shrishyl47
- 161
- 1
- 1
- 13
-
just not able to display in list view.. – shrishyl47 Aug 23 '16 at 11:28
-
can you show your data strucutre – Narender Reddy Aug 23 '16 at 11:30
-
What you are asking for now is a request forsomeone to do everything. Edit the post and show us what you have tried. So we can guide you. – Jemil Riahi Aug 23 '16 at 11:30
-
There is no API to retrieve a list of the files in Firebase Storage. See http://stackoverflow.com/questions/37335102/how-to-get-an-array-with-all-pictures/37337436#37337436 – Frank van Puffelen Aug 23 '16 at 13:54
-
Thanks Frank van Puffelen.. Will use Database for storing file details. Now able to solve the problem.. – shrishyl47 Aug 23 '16 at 14:24
1 Answers
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