I want to show the images i have uploaded in the firebase storage through the console. Is there any way I can get the image urls as a list and store it in the database through android studio. Thank you.
Till now for tried i have tried adding the urls manually to the arraylist and used glide to fetch the image, but i want to store the image urls in the database and fetch from there. The problem is I stored the images manually.
Here is my code.
public class QuotesTab extends Fragment {
private static final String TAG = "QuotesTab";
private static final int Num_Col = 2;
private ArrayList<String> mImages = new ArrayList<>();
private RecyclerView mrecyclerView;
View v;
public QuotesTab() {
}
@Nullable
@Override
public View onCreateView(@NonNull LayoutInflater inflater, @Nullable ViewGroup container, @Nullable Bundle savedInstanceState) {
Log.d(TAG, "onCreateView: Preparing Recycler View");
v = inflater.inflate(R.layout.fragment_quotes, container, false);
mrecyclerView = v.findViewById(R.id.recycler_view_quotes);
MyAdapter adapter = new MyAdapter(getContext(), mImages);
StaggeredGridLayoutManager staggeredGridLayoutManager = new StaggeredGridLayoutManager(Num_Col, LinearLayoutManager.VERTICAL);
mrecyclerView.setLayoutManager(staggeredGridLayoutManager);
mrecyclerView.setAdapter(adapter);
return v;
}
@Override
public void onCreate(@Nullable Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
Log.d(TAG, "onCreate: initbitmaps");
mImages.add("https://www.mapsofindia.com/wallpapers/tajmahal/images/taj-mahal-front-view.jpg");
mImages.add("https://images.pexels.com/photos/2466638/pexels-photo-2466638.jpeg?auto=compress&cs=tinysrgb&dpr=1&w=500");
mImages.add("https://images.pexels.com/photos/2406658/pexels-photo-2406658.jpeg?auto=compress&cs=tinysrgb&dpr=2&h=650&w=940");
mImages.add("https://images.pexels.com/photos/2385210/pexels-photo-2385210.jpeg?auto=format%2Ccompress&cs=tinysrgb&dpr=2&h=650&w=940");
mImages.add("https://images.pexels.com/photos/2462980/pexels-photo-2462980.jpeg?auto=compress&cs=tinysrgb&dpr=2&h=650&w=940");
mImages.add("https://images.pexels.com/photos/2404365/pexels-photo-2404365.jpeg?auto=compress&cs=tinysrgb&dpr=2&h=650&w=940");
mImages.add("https://images.pexels.com/photos/2404843/pexels-photo-2404843.jpeg?auto=compress&cs=tinysrgb&dpr=2&h=650&w=940");
mImages.add("https://images.pexels.com/photos/2417260/pexels-photo-2417260.jpeg?auto=compress&cs=tinysrgb&dpr=2&h=650&w=940");
mImages.add("https://images.pexels.com/photos/2407636/pexels-photo-2407636.jpeg?auto=compress&cs=tinysrgb&dpr=2&h=650&w=940");
mImages.add("https://images.pexels.com/photos/2404055/pexels-photo-2404055.jpeg?auto=compress&cs=tinysrgb&dpr=2&h=650&w=940");
mImages.add("https://images.pexels.com/photos/2405644/pexels-photo-2405644.jpeg?auto=compress&cs=tinysrgb&dpr=2&h=650&w=940");
mImages.add("https://images.pexels.com/photos/2387418/pexels-photo-2387418.jpeg?auto=compress&cs=tinysrgb&dpr=2&h=650&w=940");
mImages.add("https://images.pexels.com/photos/2407121/pexels-photo-2407121.jpeg?auto=compress&cs=tinysrgb&dpr=2&h=650&w=940");
mImages.add("https://images.pexels.com/photos/2403014/pexels-photo-2403014.jpeg?auto=compress&cs=tinysrgb&dpr=1&w=500");
mImages.add("https://images.pexels.com/photos/2403014/pexels-photo-2403014.jpeg?auto=compress&cs=tinysrgb&dpr=2&h=650&w=940");
mImages.add("https://images.pexels.com/photos/2376996/pexels-photo-2376996.jpeg?auto=compress&cs=tinysrgb&dpr=2&h=650&w=940");
mImages.add("https://images.pexels.com/photos/2440493/pexels-photo-2440493.jpeg?auto=compress&cs=tinysrgb&dpr=2&h=650&w=940");
mImages.add("https://images.pexels.com/photos/2386587/pexels-photo-2386587.jpeg?auto=format%2Ccompress&cs=tinysrgb&dpr=2&h=650&w=940");
mImages.add("https://images.pexels.com/photos/2404557/pexels-photo-2404557.jpeg?auto=format%2Ccompress&cs=tinysrgb&dpr=2&h=650&w=940");
mImages.add("https://images.pexels.com/photos/2332413/pexels-photo-2332413.jpeg?auto=compress&cs=tinysrgb&dpr=2&h=650&w=940");
}
}
I want to store the image url as shown in the image
I want to store image urls in firebase database an fetch it from there.