Welcome!

Welcome to the official BlackBerry Support Community Forums.

This is your resource to discuss support topics with your peers, and learn from each other.

inside custom component

Native Development

Reply
Highlighted
New Developer
Posts: 19
Registered: ‎12-16-2009
My Device: 8310

save image from xml, and save image from cache to local folder

now we have a problem in resolve, display and save web image in app. 
background: we are deving a wallpaper app. we want to display and save the smoothly. 
 
now we can do as this: 
read and display an original image in about 2-3 second in the app view, which is normal and ok. when we try to save it to local folder, then we must try to read the image url again.  which is so called use webview method, which is not so smart. 
 
can we do as this: 
1. when we display the image in the app view, then we can immediately save the image from the cache/memory. and no need to do a 2nd read from the server. 
2. can we realize the image saving as this, when 1st time, i access about 30 images, then i save them locally, when 2nd time i access the same image url, then i find 4 new images, then i dont need to download the former 30 images, since my local drive already has it. and i only need to read the 4 new images.  i think use webview, we can not realize this kind experience. 
 
so is there a demo for us to reference? my chief programmer told me that we  can use attachment method. but he is in project with a BB10 company order. and my new colleague find it's hard to do. so can you share a demo if you happened to have .
 
New Contributor
Posts: 9
Registered: ‎11-08-2012
My Device: BB 10
My Carrier: Divum

Re: save image from xml, and save image from cache to local folder

Hi,

 

Check for PhotoBrowser App in BB10 App world.

New Developer
Posts: 19
Registered: ‎12-16-2009
My Device: 8310

thank you so very much.  will you be so kind pass the dem...

thank you so very much. 

will you be so kind pass the demo code, or realize method. 

New Contributor
Posts: 9
Registered: ‎11-08-2012
My Device: BB 10
My Carrier: Divum

Re: thank you so very much. will you be so kind pass the dem...

Hi unfortunately i cannot give you any code. but i will give pointers where i got started.

 

http://doc.qt.digia.com/qt/network-downloadmanager-downloadmanager-cpp.html

Above code will give you a guide to how to save a file with couple of urls pooled into a queue.

register the url for the abive object and get it downloaded to some app directory, say QDir::CurrentPath()

and after download completed u can send a signal to your main object which will call a Slot method for setting imagesource for your ImageView Object.

 

 

New Developer
Posts: 19
Registered: ‎12-16-2009
My Device: 8310

Re: thank you so very much. will you be so kind pass the dem...

thank you so very much!
Developer
Posts: 160
Registered: ‎01-27-2012
My Device: Playbook
My Carrier: Rogers

Re: thank you so very much. will you be so kind pass the dem...

Check out this sample.

 

https://github.com/blackberry/Cascades-Samples/tree/master/tldr

 

I believe this does what you were wanting.

---
If you find my post helpful please "like" it and "accept as a solution"