title: How to fetch images and videos from firebase server to my blog application?
body: <p><a href="https://i.stack.imgur.com/UPXMB.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/UPXMB.png" alt="enter image description here"></a></p>
  
  <p>I am developing an android blog application from firebase backend server...where I am fetching images successfully to my application in ViewPager layout.Now I want to fetch videos and images both from firebase storage...please help me to implements this method. </p>
  
  <p><strong>MainActivity.java</strong></p>
  
  <pre><code>public class MainActivity extends AppCompatActivity implements IFirebaseLoadDone {
      private static final String TAG = "MainActivity";
  
      ViewPager viewPager;
      MyAdapter adapter;
      DatabaseReference movies;
      IFirebaseLoadDone iFirebaseLoadDone;
  
      @Override
      protected void onCreate(Bundle savedInstanceState) {
          super.onCreate(savedInstanceState);
          setContentView(R.layout.activity_main);
  
         BottomNavigationView navigation = (BottomNavigationView) findViewById(R.id.navigation);
         navigation.setOnNavigationItemSelectedListener(mOnNavigationItemSelectedListener);
          Menu menu = navigation.getMenu();
          MenuItem menuItem = menu.getItem(0);
          menuItem.setChecked(true);
  
  
  
          FirebaseApp.initializeApp(this);
  
          if (Build.VERSION.SDK_INT &gt;= Build.VERSION_CODES.O){
              NotificationChannel channel = new NotificationChannel("MyNotifications","MyNotifications", NotificationManager.IMPORTANCE_DEFAULT);
              NotificationManager manager = getSystemService(NotificationManager.class);
              manager.createNotificationChannel(channel);
          }
  
          FirebaseMessaging.getInstance().subscribeToTopic("general")
                  .addOnCompleteListener(new OnCompleteListener&lt;Void&gt;() {
                      @Override
                      public void onComplete(@NonNull Task&lt;Void&gt; task) {
                          String msg = "Welcome";
                          if (!task.isSuccessful()) {
                              msg = "failed";
                          }
                          Toast.makeText(MainActivity.this, msg, Toast.LENGTH_SHORT).show();
                      }
                  });
  
  
  
  
          movies = FirebaseDatabase.getInstance().getReference("Movies");
  
  
          iFirebaseLoadDone = this;
          loadMovie();
  
          viewPager = (ViewPager)findViewById(R.id.view_pager);
          viewPager.setPageTransformer(true,new DeapthPageTransformer());
  
      }
  
      private void loadMovie()
      {
  
          movies.addListenerForSingleValueEvent(new ValueEventListener()
          {
              List&lt;Movie&gt;movieList = new ArrayList&lt;&gt;();
              @Override
              public void onDataChange(@NonNull DataSnapshot dataSnapshot)
              {
                  for(DataSnapshot movieSnapShot:dataSnapshot.getChildren()) {
                      movieList.add(movieSnapShot.getValue(Movie.class));
                      iFirebaseLoadDone.onFirebaseLoadSuccess(movieList);
                  }
                  Collections.reverse(movieList);
                  adapter.notifyDataSetChanged();
              }
  
              @Override
              public void onCancelled(@NonNull DatabaseError databaseError)
              {
  
                  iFirebaseLoadDone.onFirebaseLoadFailed(databaseError.getMessage());
  
              }
          });
      }
  
      @Override
      public void onFirebaseLoadSuccess(List&lt;Movie&gt; movieList) {
          adapter = new MyAdapter(this,movieList);
          viewPager.setAdapter(adapter);
  
      }
  
      @Override
      public void onFirebaseLoadFailed(String message) {
          Toast.makeText(this, ""+ message, Toast.LENGTH_SHORT).show();
  
      }
  </code></pre>
  
  <hr>
  
  <h2>    MyAdapter.java</h2>
  
  <pre><code>public class MyAdapter extends PagerAdapter {
  
      Context context;
      List&lt;Movie&gt; movieList;
      LayoutInflater inflater;
  
  
      public MyAdapter(Context context, List&lt;Movie&gt; movieList) {
          this.context = context;
          this.movieList = movieList;
          inflater = LayoutInflater.from(context);
  
      }
  
      @Override
      public int getCount() {
          return movieList.size();
      }
  
      @Override
      public boolean isViewFromObject(@NonNull View view, @NonNull Object o) {
  
          return view == o;
      }
  
      @Override
      public void destroyItem(@NonNull ViewGroup container, int position, @NonNull Object object) {
  
          ((ViewPager) container).removeView((View) object);
  
  
      }
  
      @NonNull
      @Override
      public Object instantiateItem(@NonNull ViewGroup container, int position) {
          View view = inflater.inflate(R.layout.view_pager_item, container, false);
          final ImageView movie_image = (ImageView) view.findViewById(R.id.movie_image);
          final TextView movie_title = (TextView) view.findViewById(R.id.movie_title);
          final TextView movie_description = (TextView) view.findViewById(R.id.movie_description);
          ImageView likeImage = (ImageView) view.findViewById(R.id.img_like);
          ImageView sendImage = (ImageView) view.findViewById(R.id.img_shr);
          Picasso.get().load(movieList.get(position).getImage()).into(movie_image);
          movie_title.setText(movieList.get(position).getName());
  </code></pre>
  
  <hr>
  
  <h2>    activity_main.xml</h2>
  
  <pre><code>            &lt;android.support.v4.view.ViewPager xmlns:android="http://schemas.android.com/apk/res/android"
                  xmlns:app="http://schemas.android.com/apk/res-auto"
                  xmlns:tools="http://schemas.android.com/tools"
                  android:id="@+id/view_pager"
                  android:layout_width="match_parent"
                  android:layout_height="wrap_content"
                  tools:context=".MainActivity"&gt;
  </code></pre>
  
  <h2>                </h2>
  
  <h2>view_pager_item.xml</h2>
  
  <pre><code> &lt;ImageView
                  android:layout_width="match_parent"
                  android:layout_height="250dp"
                  android:id="@+id/movie_image"
                  android:scaleType="fitXY"/&gt;
  </code></pre>
  
  <hr>
  
  <h2>Movie.java</h2>
  
  <pre><code>public class Movie
  {
      private String name,description,image;
  
      public Movie() {
      }
  
      public Movie(String name, String description, String image) {
          this.name = name;
          this.description = description;
          this.image = image;
      }
  
      public String getName() {
          return name;
      }
  
      public void setName(String name) {
          this.name = name;
      }
  
      public String getDescription() {
          return description;
      }
  
      public void setDescription(String description) {
          this.description = description;
      }
  
      public String getImage() {
          return image;
      }
  
      public void setImage(String image) {
          this.image = image;
      }
  }
  </code></pre>