Tag Archives: Bitmap

How Image Loading Libraries work in Android?

By | July 14, 2018

In this article, Lets find out how the image loading libraries like Picasso, Glide and Fresco works. We know that images are the one which takes most of the space in our application either in App size or the memory at runtime. Also using large number of images often kicks off Garbage Collection (GC) Events.… Read More »

Do we need to call the Garbage Collector manually ( System.gc() ) in Android?

By | September 5, 2017

This is a common question. Eventhough the Android System calls garabage collector at appropriate times, this usually will not be adequate. Because the system calls GC at intervals, most of the time it wont work perfect and causing unnecessary pauses in the application. If these pauses are more than 16ms, then the user will notice… Read More »

Fast and Efficient way to transfer images between Activites in Android

By | July 14, 2017

We often need to transfer images between activities. Well there are many methods to transfer images. You can make the image into a Base64 String and pass it as String argument extra in a bundle between activities You can save it to a disc and read it in the other activity. Well, these methods will… Read More »

What are weak references? How it can be used to avoid memory leaks?

By | June 1, 2017

Weak reference objects, which do not prevent their referents from being made finalizable, finalized, and then reclaimed. Weak references are most often used to implement canonicalizing mappings. Suppose that the garbage collector determines at a certain point in time that an object is weakly reachable. At that time it will atomically clear all weak references… Read More »

Uploading Image to Server – Android Eclipse Version.

By | February 18, 2016

Hi all, In today’s tutorial I will show you how to send an image to server using POST method in ANDROID. If you are working in Android studio, then checkout the article here. Uploading an image to server is a basic requirement in many of our application. Sending data to server which is using a… Read More »

Faster Loading images in GridViews or ListViews in Android using Menory Caching, Complete implemenation with sample code.

By | September 1, 2013

Hi all This example shows you how to load large images in the gridview without any lag or without outofmemory error. This sample application uses the LruCache to hold the images. A cache that holds strong references to a limited number of values. Each time a value is accessed, it is moved to the head… Read More »

What is a Memory Heap Size in android? and how can use Bitmap Efficiently?

By | August 25, 2013

Memory Heap Size Android is a full multitasking system so it’s possible to run multiple programs at the same time and obviously each one can’t use all of your device memory. For this reason there is a hard limit on your Android application’s heap size: if your application needs to allocate more memory and you… Read More »

Wave Scale Animation in GridViews in Android

By | May 28, 2013

Hello all Previously I have shown many posts where we animate each row of the GridView randomly, linearly etc. GridView RandomFade animation in Android and Cascade animation in a ListView in Android. In today’s post I will show you how to create a wave scale animation in the ListViews. Please refer to my old posts… Read More »

How to create a beautiful wheel animation in android?

By | May 18, 2013

Today’s post is about animation, a beautiful animation, exploring capabilities of android. You can click on the link to download the code. Here we will have three java classes and no XML files. 1. GraphicsActivity.java 2. PictureLayout.java 3. Sweep.java At first we start with PictureLayout.java Now our second java file, GraphicsActivity.java No need to declare… Read More »

How to use ImageSwitcher in Android?

By | May 12, 2013

You can read more about ImageSwitcher here http://developer.android.com/reference/android/widget/ImageSwitcher.html Click on the link below to download the code. This is the layout that contains the ImageSwitcher What we will do is we will load some images into the Gallery and then load each image into the ImageSwitcher on clicking on each item in the Gallery. Here… Read More »

ListView Bottom to Top Animation in Android.

By | May 10, 2013

Like my previous posts animation chapter is again continued. This time the animation in on a ListView from Bottom to Top. You have already seen animations from Top to Bottom in my previous posts. See some of my posts here. All animation posts from CoderzHeaven is here Click on the download link at the bottom… Read More »

Creating a Drawable animation in Android.

By | May 3, 2013

This is a simple example of how to animate a drawable in Android. This example is from the official android demo applications. Here we have 5 java classes. AnimateDrawable.java AnimateDrawables.java GraphicsActivity.java PictureLayout.java ProxyDrawable.java AnimateDrawable.java AnimateDrawables.java GraphicsActivity.java PictureLayout.java ProxyDrawable.java Download the complete source code from here Join the Forum discussion on this post

GridView RandomFade animation in Android

By | May 1, 2013

In some of my older posts I have already showed a lot of animations on ListView and GridViews. Search coderzheaven for ListView and GridView animations if you want to see the articles and posts. This is also yet another post on animation. Here what I will do is create an animation in a GridView such… Read More »

Different types of Animation – Push Up in, Push Up Out, Push Left in, Push Left Out, HyperSpace In, HyperSpace Out in a ViewFlipper in Android.

By | April 22, 2013

Hello all…. This is going to be a big post.. Check out my previous post for a rotate3D animation between a ListView and an Image. How to create a rotate 3D Animation between a ListView and an ImageView in Android? Today I will show you different types of Animations using ViewFlipper in a textView. Here… Read More »

CoverFlow in Android – Complete implementation with source code.

By | December 17, 2012

Have you seen the coverflow in iPhone. This is the Android implementation of CoverFlow. Please leave your comments if this article is helpful for you. Let’s see how. This is the CoverFlow class that extends the Gallery. Now the main activity that implements the coverflow. OK Done. Now go on and Run your project. Download… Read More »

How to crop an Image in Android?

By | December 15, 2012

This is a sample program that launches the camera and crop the captured image. Check this link to another crop image example. http://www.coderzheaven.com/2011/03/15/crop-an-image-in-android/ This is the layout xml. activity_main.xml Now this is the Main Java File that implements the crop functionality. Here we are using the “com.android.camera.action.CROP” Intent to crop the Image passing the captured… Read More »

How to use NumberFormat Class in Android? – Rounding a number in android, formatting, getting decimal values etc in android.

By | October 14, 2012

How to Upload Multiple files in one request along with other string parameters in android?

By | August 16, 2011

Hello everyone, I have shown two methods to upload files in android. In today’s tutorial I will show another simple method to upload files. With this method you can upload multiple files in one request + you can send your own string parameters with them. Here is another method on working with uploading of images.… Read More »

ANDROID – Upload an image to Server in Android Studio

By | April 25, 2011

Hi all, In today’s tutorial I will show you how to send an image to server using POST method in ANDROID. Uploading an image to server is a basic requirement in many of our application. Sending data to server which is using a PHP Script is already explained in this example . Now in this… Read More »

Crop an Image in ANDROID.

By | March 15, 2011

Cropping an image in ANDROID programmatically has always been a problem for ANDROID developers. So Here I am putting a sample code to demonstrate this. For cropping an image in ANDROID we need a source bitmap which is our image itself, the other one is the target bitmap which we have to set the size… Read More »

Using GridView in ANDROID….

By | March 9, 2011

GridViews are those in which you can arrange elements in a two dimensional grid. It is what you see in the gallery where images are arranged. Here images are arranged in a two dimensional grid. Copy the below code and save it as “MyGridView.java” Now create another file named “Images.java” and copy the below code… Read More »

How to set wallpaper in ANDROID?

By | February 17, 2011

Following example shows how to set a Bitmap as wallpaper in ANDROID. After running this code your wallpaper on the ANDROID phone will change. Make sure that you have an image named ‘my_wallpaper’ in your drawable folder. And You have to set this permission in the Manifest.