title: Retriving image from firebase into recycler view in android studio
body: <p>I'm trying to retrive image from firebase Database (the image is in storage ) .
  I'm unable to convert it into url to pass it to picasso to load it in a recycler view . It works if uploaded and retrieved from same device but the image isn't shown on other devices . Any help would be of almost use .
  I am trying to store and retrieve image by using Firebase. It is okay when storing an image, but I can't show it in an ImageView. It doesn't give an error so I can't understand where is the mistake.
  i gave the required permissions.</p>
  <p>Thank you in advnace.
  Mainactivity.java</p>
  <pre><code>package com.example.blogger;
  
  import androidx.annotation.NonNull;
  import androidx.appcompat.app.AppCompatActivity;
  import androidx.appcompat.widget.Toolbar;
  import androidx.recyclerview.widget.LinearLayoutManager;
  import androidx.recyclerview.widget.RecyclerView;
  
  import android.content.Context;
  import android.content.Intent;
  import android.net.Uri;
  import android.os.Bundle;
  import android.view.LayoutInflater;
  import android.view.Menu;
  import android.view.MenuInflater;
  import android.view.MenuItem;
  import android.view.View;
  import android.view.ViewGroup;
  import android.widget.ImageView;
  import android.widget.TextView;
  
  import com.firebase.ui.database.FirebaseRecyclerAdapter;
  import com.firebase.ui.database.FirebaseRecyclerOptions;
  import com.google.firebase.auth.FirebaseAuth;
  import com.google.firebase.database.DatabaseReference;
  import com.google.firebase.database.FirebaseDatabase;
  import com.squareup.picasso.Picasso;
  
  public class blogupload extends AppCompatActivity {
      private RecyclerView mBlogList;
      private DatabaseReference mDataBase;
      private FirebaseAuth mAuth=FirebaseAuth.getInstance();
      FirebaseRecyclerAdapter adapter;
      
      @Override
      protected void onStart() {
          super.onStart();
          FirebaseRecyclerOptions&lt;Blog&gt; options =
                  new FirebaseRecyclerOptions.Builder&lt;Blog&gt;()
                          .setQuery(mDataBase,Blog.class)
                          .build();
  
          adapter = new FirebaseRecyclerAdapter&lt;Blog, BlogViewHolder&gt;(options) {
              @Override
              public BlogViewHolder onCreateViewHolder(ViewGroup parent, int viewType) {
                  View view = LayoutInflater.from(parent.getContext())
                          .inflate(R.layout.blog_row, parent, false);
  
                  return new BlogViewHolder(view);
              }
  
              @Override
              protected void onBindViewHolder(BlogViewHolder holder, int position, Blog model) {
                  holder.setTitle(model.getTitle());
                  holder.setDesc(model.getDesc());
                  holder.setImage(model.getImage());
              }
  
  
          };
          adapter.startListening();
          mBlogList.setAdapter(adapter);
  
  
  
  
      }
      public static class BlogViewHolder extends RecyclerView.ViewHolder {
          View mView;
          public BlogViewHolder(@NonNull View itemView) {
              super(itemView);
  
              mView=itemView;
          }
  
          public void setTitle(String title)
          {
              TextView post_title ;
              post_title=(TextView) mView.findViewById(R.id.post_title);
              post_title.setText(title);
  
          }
  
          public void setDesc(String desc)
          {
              TextView post_desc ;
              post_desc=(TextView) mView.findViewById(R.id.post_desc);
              post_desc.setText(desc);
  
          }
  
          public void setImage(String image)
          {
              ImageView post_image;
              post_image=(ImageView) mView.findViewById(R.id.post_image);
  
              Picasso.get().load(image).into(post_image);
          }
      }
  
      @Override
      public boolean onCreateOptionsMenu(Menu menu) {
          MenuInflater inflater=getMenuInflater();
          inflater.inflate(R.menu.action_menu,menu);
          return true;
      }
  
      @Override
      protected void onStop() {
          super.onStop();
          adapter.stopListening();
      }
  
      @Override
      protected void onCreate(Bundle savedInstanceState) {
          super.onCreate(savedInstanceState);
          setContentView(R.layout.activity_blogupload);
  
          mDataBase= FirebaseDatabase.getInstance().getReference().child(&quot;blog&quot;);
  
          mBlogList=(RecyclerView) findViewById(R.id.blog_list);
          mBlogList.setLayoutManager(new LinearLayoutManager(this));
  
      }
  
      @Override
      public boolean onOptionsItemSelected(@NonNull MenuItem item) {
          switch (item.getItemId()){
              case R.id.add:
                  Intent intent = new Intent(getApplicationContext(), addpostactivity.class);
                  startActivity(intent);
                  return true;
              case R.id.logout:
                  mAuth.signOut();
                  Intent intent1 =new Intent(getApplicationContext(),MainActivity.class);
                  startActivity(intent1);
                  return true;
              default:
                  return super.onOptionsItemSelected(item);
          }
  
      }
  }
  </code></pre>
  <p>image upload activity</p>
  <pre><code>package com.example.blogger;
  
  import androidx.annotation.Nullable;
  import androidx.appcompat.app.AppCompatActivity;
  
  import android.app.ProgressDialog;
  import android.content.Intent;
  import android.net.Uri;
  import android.os.Bundle;
  import android.text.TextUtils;
  import android.view.View;
  import android.widget.Button;
  import android.widget.ImageView;
  import android.widget.ProgressBar;
  import android.widget.TextView;
  import android.widget.Toast;
  
  import com.google.android.gms.tasks.OnSuccessListener;
  import com.google.firebase.auth.FirebaseAuth;
  import com.google.firebase.database.DatabaseReference;
  import com.google.firebase.database.FirebaseDatabase;
  import com.google.firebase.storage.FirebaseStorage;
  import com.google.firebase.storage.StorageReference;
  import com.google.firebase.storage.UploadTask;
  import com.squareup.picasso.Picasso;
  
  import java.util.Random;
  
  public class addpostactivity extends AppCompatActivity
  {
  
      private static final int MAX_LENGTH = 23 ;
      ProgressBar mProgress;
      ImageView selectimage;
      TextView posttitle,postdesc;
      Button submitbtn;
      private Uri uri;
      private static final int GALLERY_INTENT=2;
      private StorageReference mStorage;
      private DatabaseReference mDataBase;
      private FirebaseAuth mAuth;
      @Override
      protected void onActivityResult(int requestCode, int resultCode, @Nullable Intent data) {
          super.onActivityResult(requestCode, resultCode, data);
  
          if(requestCode==GALLERY_INTENT&amp;&amp;resultCode==RESULT_OK)
          {
              uri=data.getData();
              Picasso.get().load(uri).into(selectimage);
  
          }
      }
  
  
      @Override
      protected void onCreate(Bundle savedInstanceState) {
          super.onCreate(savedInstanceState);
          setContentView(R.layout.activity_addpostactivity);
  
          selectimage=(ImageView) findViewById(R.id.selectimage);
          posttitle=(TextView) findViewById(R.id.posttitle);
          postdesc=(TextView) findViewById(R.id.postdesc);
          submitbtn=(Button) findViewById(R.id.submitbtn);
  
          mProgress= new ProgressBar(this);
  
          mDataBase= FirebaseDatabase.getInstance().getReference().child(&quot;blog&quot;);
  
  
          submitbtn.setOnClickListener(new View.OnClickListener() {
              @Override
              public void onClick(View view) {
                  startposting();
  
  
                  
              }
          });
          
          
          selectimage.setVisibility(View.VISIBLE);
          mStorage= FirebaseStorage.getInstance().getReference();
  
          selectimage.setOnClickListener(new View.OnClickListener() {
              @Override
              public void onClick(View view) {
                  Intent intent =new Intent(Intent.ACTION_PICK);
                  intent.setType(&quot;image/w&quot;);
                  startActivityForResult(intent,GALLERY_INTENT);
              }
          });
  
  
  
  
      }
      public static String random() {
          Random generator = new Random();
          StringBuilder randomStringBuilder = new StringBuilder();
          int randomLength = generator.nextInt(MAX_LENGTH);
          char tempChar;
          for (int i = 0; i &lt; randomLength; i++){
              tempChar = (char) (generator.nextInt(96) + 32);
              randomStringBuilder.append(tempChar);
          }
          return randomStringBuilder.toString();
      }
  
      private void startposting() 
      {
  
          mProgress.setProgress(0);
          mProgress.setVisibility(View.VISIBLE);
  
          String title_value=posttitle.getText().toString().trim();
          String desc_value=postdesc.getText().toString().trim();
          if(!TextUtils.isEmpty(title_value)  &amp;&amp;  !TextUtils.isEmpty(desc_value)  &amp;&amp;  uri!=null)
          {
              StorageReference filepath=mStorage.child(&quot;blog_image&quot;).child(random());
              //adding a picture to storage
  
              filepath.putFile(uri).addOnSuccessListener(new OnSuccessListener&lt;UploadTask.TaskSnapshot&gt;() {
                  @Override
                  public void onSuccess(UploadTask.TaskSnapshot taskSnapshot) {
                      Toast.makeText(getApplicationContext(),&quot;Uploaded&quot;,Toast.LENGTH_SHORT).show();
                  }
              });
  
  
          }
  
          DatabaseReference newPost=mDataBase.push();
          //newPost.child(&quot;uid&quot;).setValue(mAuth.getCurrentUser().getUid());
          newPost.child(&quot;title&quot;).setValue(title_value);
          newPost.child(&quot;desc&quot;).setValue(desc_value);
          newPost.child(&quot;image&quot;).setValue(uri.toString());
  
          Intent intent = new Intent(getApplicationContext(), blogupload.class);
          startActivity(intent);
      }
  
  }
  </code></pre>