Android的影像保存到SQLite的或SD卡或内存 [英] Android Save images to SQLite or SDCard or memory

查看:181
本文介绍了Android的影像保存到SQLite的或SD卡或内存的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我需要获取的图像和来自服务器的一些其它数据,然后在列表显示它。但由于记录的数量可以是pretty的大,所以我不知道我是否应该图像保存到SQLite数据库或将其保存至SD卡或保存这些记忆。

I need to fetch images and some other data from server and then display it in the List. But as the number of records can be pretty large so I am not sure if I should save images to SQLite database or save it to SDCard or save those to memory.

谢谢, 无

推荐答案

总是要保存图像数据库路径的习惯。对于一个列表视图,可以肯定的只是使用这些图像的缩略图。这将帮助你快速加载列表中的这些图像。

Always make a habit of saving images path to database. For a list view, be sure just to use those image's thumbnail. This will help you in fast loading of these images in list.

 long selectedImageUri = ContentUris.parseId(Uri.parse(anniEntry.getUri()));
 Bitmap bm = MediaStore.Images.Thumbnails.getThumbnail(
                    mContext.getContentResolver(), selectedImageUri,MediaStore.Images.Thumbnails.MICRO_KIND,
                    null );

下面anniEntry.getUri()是图像uri.Now,把它放在第二codeU可根据需要获得微型或小型缩略图

Here anniEntry.getUri() is the image uri.Now,put it in second code.U can get micro or mini thumbnail according to requirement

这篇关于Android的影像保存到SQLite的或SD卡或内存的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆