Blog

What is View Recycling

As you know android studio pretty like any software adds memory for each element that we use. “Memory Storage is full please clear some memory” is the most irritating and the most hated message that I have encountered in my device. And for the same reason, I always prefer creating apps with minimal memory usage.

 “View!”, I’m pretty sure that every Android developer, would have heard of that term. Well, if you don’t know about it, “view” is the class which helps in creating or building your User Interface.  In simple words, it’s just like a container which will hold text-fields, picture, passwords fields, etc.

Layouts are one of the most important features which contributes to the structure of the app activity. Until before I started doing Android development I used to wonder “How are chatting app maintaining the same amount of memory, regardless if you chat with more or less number of people”.  I mean, If we have a thousand friends or if you just have one contact to chat with the whole total memory of the app would remain same (I’m not including media transfers). I was about to conclude that linear layout doesn’t suck up memory space. And That’s when I got introduced to the concept of View Recycling.

So, What is View Recycling? It is a technique of reusing the same view that goes out of the screen when we scroll. In the android studio, we use the ListView and the ArrayAdapter. What really happens is the data gets changed each time instead of creating a new view each and every time. See, that’s the best part, just a limited number of views are created and it gets updated with new data.

 

 

Journey that Began on September 1998!

Well this blog post is slightly non technical. Who am I kidding, this post is made so people can know me! Obviously, had to think over a hundred time before I made the decision of revealing my true secret identity. ;-p

Continue reading “Journey that Began on September 1998!”