保存它来自服务器的android图像的最佳方法图像、服务器、方法、android

由网友(久了就旧了)分享简介:我工作的一个应用程序,并从服务器获取产品图片。 目前,我节省了这些图像到SQLite数据库转换成字节数组,在使用时间后,我将其转换回位图。的I am working on one application and getting product images from the server. Currently I a...

我工作的一个应用程序,并从服务器获取产品图片。 目前,我节省了这些图像到SQLite数据库转换成字节数组,在使用时间后,我将其转换回位图。的

I am working on one application and getting product images from the server. Currently I am saving those images into the SQLite database after converting them into byte array and at the time of use I convert them back into bitmap.

现在我有下面两个查询:

Now I have below two queries:

什么是保存在这里我们可以将它们同步也当过需要得到应用图像的最佳方式。

What is the best way to save the images in app from where we can sync them also and get when ever required.

如何分配他们的图像视图或按钮,因为有时记忆问题的出现和应用突然停止。

How to assign them on image view or button because sometimes memory issue arises and application stop suddenly.

请指引我。任何帮助是AP preciated。

Please guide me. Any help is appreciated.

推荐答案

存储应用具体的事情上的SD卡可能不是正确的方式.. 你应该存储在

Storing app specific things on SD Card may not be the right way.. You should store images on

// it will reside in data/data/com.package.name 
String path = getApplicationContext().getFilesDir() + "/";
File imagesFolder = new File(path);
imagesFolder.mkDir();

,并把图像文件,在此文件夹..所以SD卡依赖性可以被删除。

and put image files here in that folder.. So SD Card dependency can be removed.

阅读全文

相关推荐

最新文章