This is a migrated thread and some comments may be shown as answers.

SQLLite Plugin - Store and retrieve images

2 Answers 283 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
This question is locked. New answers and comments are not allowed.
Nicola
Top achievements
Rank 1
Nicola asked on 27 Aug 2014, 07:50 AM
Hello,
I'm developing with AppBuilder an app that displays a list of products (> 30000) in a KendoUI Mobile ListView . At the first start the products are read from a server via json and stored in a local SqlLite database. The list is displayed using a datasource on the local SqlLite DB (this works very well).
The problem arises for store and retrieve the product's images.
What is the proper way to download images to show in the list ?
I have two ideas, but I would like to know, according to you, the proper procedure
1) I insert in the retrieved json file  the images (base64 converted ??) and save in database? How do I then display them in the list ?
2) I download individual image files, I memorize them in a folder on the device and then I load them at display time ? How ?
  Can you give me some examples about it?
Thank you!
Nicola

2 Answers, 1 is accepted

Sort by
0
Accepted
Tina Stancheva
Telerik team
answered on 01 Sep 2014, 09:08 AM
Hello Nicola,

The approach you can choose will mostly depend on the specifics of the app and the size and number of images you will be storing. Generally I would recommend storing them as a blob in the SQLite database but please be sure to check the Internal Versus External BLOBs in SQLite article as well.

If you go with that approach you can also have a look at the Storing Blob images in SQLite forum post and the How to Save Captured Picture into SQLite as blob and Retrieve back in Phonegap thread. You can also have a look at our Camera sample which demonstrates how to display an image from a string of Base64 encoded photo:
<img id="smallImage" src="" />     
 ...
var smallImage = document.getElementById('smallImage');
// Show the captured photo.
smallImage.src = "data:image/jpeg;base64," + imageData;

I hope this information will help you move forward with your development.

Regards,
Tina Stancheva
Telerik
 

Check out the Telerik Platform - the only platform that combines a rich set of UI tools with powerful cloud services to develop web, hybrid and native mobile apps.

 
0
Nicola
Top achievements
Rank 1
answered on 01 Sep 2014, 09:56 AM
Hello Tina,
thanks for informations and examples. I will go with storing thumbnail images in SqlLite DB and fullsize images (for the detail page) in file system.
I read useful information on links.
Regards,
Nicola
Tags
General Discussions
Asked by
Nicola
Top achievements
Rank 1
Answers by
Tina Stancheva
Telerik team
Nicola
Top achievements
Rank 1
Share this question
or