节点文献

针对Android应用中Gallery内存溢出的解决方案

A Solution on OOM (Out of Memory) of Gallery in Android Application

【作者】 董铖

【导师】 夏小玲;

【作者基本信息】 东华大学 , 计算机软件与理论, 2012, 硕士

【摘要】 随着移动设备的迅猛发展,越来越多的开发人员选择向移动平台进军。在近两年中,Android的发展十分强势,已成功超越塞班和IOS成为市场占有率的第一名,越来越多的Android应用也如雨后春笋般出现。本文所描述的是一个在Android平台上浏览体育赛事新闻的应用。根据其特点及应用实现过程中出现的问题,提出了一种针对在Android应用中因浏览Gallery(画廊)时下载大量图片而导致应用内存溢出的解决方案。在Android应用中,用户往往需要浏览大量的图片,而Gallery提供了一个很好的机制,用户可以通过左右移动来浏览图片。如果将Gallery中所需的大容量图片都从网站上下载到内存,则有很大概率会导致应用OOM(Out Of Memory:内存溢出);而如果将图片都下载到外存(SD卡)中,却因Android旗下的手机设备参差不齐,极有可能没有任何外存设备而不可行。本文针对此背景,研究了一套可用于解决在Gallery浏览时内存溢出的解决方案:通过任务调度、缓存设立以及线程的控制,做到了既能够使之适应Android旗下各类产品,又基本避免了OOM的可能性,并通过大量的应用实验证明了其可靠性与稳定性。解决方案现已成功在应用上付诸实践,并且在安卓市场上成功上线。根据用户反馈,应用中Gallery浏览功能性能稳定,完全避免了OOM的发生,其优质的体验效果得到了用户的一致好评。

【Abstract】 With the rapid development of mobile devices, many developers choose the mobile platform as their new direction. In the recent two years, the development of Android is very fast, it becomes NO.1 after catching up Symbian and ios, and more and more Android apps appear.The paper is about an app of browsing sports news base on Android. According to its features and problems in developing, we propose a solution on OOM of downloading numerous images when a Android user browses the Gallery.In Android applications, users often browse a great quantity of images, and Gallery provides a well performed mechanism; users may browse the images by swaying. If we download all the images from Internet and send them into memory, the application may crash because of OOM(OUT OF MEMORY); And if we download the images to the SD card, it’s also infeasible because many cell phones may not have SD card.Aim at that background; we propose a solution to solve this problem. We make it possible to apply to any product of Android and avoid OOM by task scheduling, caching and thread control, and guarantee the stability of such solution through experiments.The solution has been fulfilled on the app, and we can download the app on the Android market right now. According to the feedback from users, it’s stable on Gallery browsing and it can totally avoid OOM, and The experience of high quality is highly appreciated by users.

【关键词】 Android画廊内存溢出图片
【Key words】 AndroidGalleryOOMImage
  • 【网络出版投稿人】 东华大学
  • 【网络出版年期】2012年 07期
节点文献中: 

本文链接的文献网络图示:

本文的引文网络