Hi, merry christmas {if you're reading on post date}. I have some code, based on here: http://developer.appcelerator.com/question/125998/codeboxed-image-gallery-with-json-file . Basically, my problem is, that every time i load my app from new, it downloads all the images somewhere/somehow {i can tell, because my app become very very large over time} Is it possible to somehow use these images when booting the app from new, or to maybe delete them, i do knot know where they are located. Many Thanks for any help,
2 Answers
can u upload the screen shot for this
For caching of images I'am using the following code:
var cachedImageView = function(imageDirectoryName, url, imageViewObject, hires) { var filename = url.split('/'); filename = filename[filename.length - 1]; var file = Ti.Filesystem.getFile(Ti.Filesystem.applicationDataDirectory, imageDirectoryName, filename); if (file.exists()) { imageViewObject.image = file.nativePath; } else { var g = Ti.Filesystem.getFile(Ti.Filesystem.applicationDataDirectory, imageDirectoryName); if (!g.exists()) { g.createDirectory(); }; var xhr = Ti.Network.createHTTPClient(); xhr.onload = function() { if (xhr.status == 200) { file.write(xhr.responseData); imageViewObject.image = file.nativePath; }; }; xhr.open('GET', url); xhr.send(); };
Your Answer
Think you can help? Login to answer this question!