Android app + Image storage and retrieval
-
18-06-2021 - |
Domanda
I am designing a restaurant based app which has lots of images.
Please tell me:
How should I save images in the database i.e. in which format so that time of retrieval and display in the app is minimum? (Note: This database is a MySQL and located on an external server).
How should I retrieve them, i.e. which method to go for (JSON, etc)?
Soluzione
Dont use remote database server connection from application directly it may lead to slow performance . Instead use webservices as a intermediator between the database and your application. Your app should call a webservice which will internally query your database and return you the response . First response can be XML or JSON , but i would personally recommend you for the JSON as very fast from XML . Your first webservice response will return only the urls for images that you should download asynchronously so that UI thread is not hanged up .