June 2014

MediaCodec: Decoding AAC android

Read Time 2 minutes Encoding/Decoding for various audio/video formats is now possible in android since JellyBean. Sample code below shows AAC decoding using MediaCodec API provided in android JellyBean and above. Sample InputFile Sample input file, songwav.mp4 is also created using MediaCodec and MediaMuxer. Songwav.mp4 file AAC encoded file with following parameters:   MediaFormat outputFormat = MediaFormat.createAudioFormat( “audio/mp4a-latm”, 44100, 2); …

MediaCodec: Decoding AAC android Read More »

Scaling images in onCreate: Android

Read Time 2 minutes Android developers mostly face out of memory error when loading images into imageView. Primarily this error is raised because we try to load very large image and there is not much memory available. To prevent this, this is good idea to scale down the image according to imageView height/width. setScaledAvatar() method is doing this scaling. …

Scaling images in onCreate: Android Read More »