Search code examples
androiddatabasereal-timestore

How to Link a Databse to my Android App?


I'm developping a store app and i encounter a problem regarding the real time refresh .

Let me explain it better , This app is a clothes store and everytime my friend adds a new collection i have to update the app.

But the thing is that every image of the products (let's say , jeans, t shirt, etc..) are stored in drawable folder of the app , and at last the aplication itself grow huge .

This issue cause several problem , the first one is that every image are stored Inside drawable folder , the second one is that everytime my friend adds a new collection i have to updade the application (and add the new collecion to drawable folder) .

I know this ain't the best way to store data so i would like to set up a database with SQL , so my friend could add it's collection throught it and my app will grab it in realtime so i do not need to store data inside the app and i don't need to update it every week

I would like to know if it is possible and if so, how am i supposed to do ?

Let's say my friend has 3 new Jeans to add in it's collection, i create a RecyclerView w/ Cardview to Display the original Jeans Collection, Now how am i supposed to do to make it grabbing from the Database and adding to the RecycleView the 3 new Jean of the collection?

Thanks

PS :I'm sorry for my english


Solution

  • Instead of setting up your own server, you can use Firebase Database to store your data.

    Basically, you will need to store the description of each item as well as its image (so that you won't have to update your app every time an image is added / modified).

    For storing the images you can use Firebase Cloud Storage.

    The documentation is really great, it should be able to guide you from here.