Introduction The Android media viewer read permission tutorial series describes how to implement permission to access external read storage for both marshmallow devices and older. Get Code The code can be found on github from the following instructions below https://github.com/mobapptuts/media-thumbnail-viewer.git Tag media-viewer-permissions or you can run this command git clone https://github.com/mobapptuts/media-thumbnail-viewer.git –branch media-viewer-permissions This video describes how […]

Read more

This android tutorial describes the steps involved for the android camera2 api capture still image. Get Code You can get it from here https://github.com/mobapptuts/recyclerview_image_gallery.git Tag camera2-still-capture or else run this command git clone —branch camera2-still-capture https://github.com/mobapptuts/recyclerview_image_gallery.git Code Samples Clean up the ImageReader resource when the application is closed private void closeCamera() { if(mCameraCaptureSession != null) […]

Read more

In part 7 of the android performance optimisations for recyclerview image galleries we will be using android glide image library to compare image gallery scrolling performance against the other solutions in this tutorial series. ADD GRADLE DEPENDENCY FOR GLIDE dependencies { compile fileTree(dir: 'libs', include: ['*.jar']) compile 'com.android.support:recyclerview-v7:22.0.+' compile 'com.github.bumptech.glide:glide:3.6.0' compile 'com.squareup.picasso:picasso:2.5.2' } CALL GLIDE […]

Read more

In the Android performance with inBitmap tutorial we add the BitmapFactory.Option’s inBitmap flag which can be used for bitmaps that have been evicted from the memory cache but not yet deallocated. This is only supported for android versions Honeycomb or later. Implementation Create a Set of SoftReferenced Bitmaps CamaraIntentActivity private static Set<SoftReference<Bitmap>> mReuseableBitmap; Initialise the […]

Read more

This android video tutorial explains how to create memory cache for android. Using this method will have a dramatic effect on performance for android applications. Implementation Create LruCache final int maxMemorySize = (int) Runtime.getRuntime().maxMemory() / 1024; final int cacheSize = maxMemorySize / 10; mMemoryCache = new LruCache<String, Bitmap>(cacheSize) { @Override protected int sizeOf(String key, Bitmap […]

Read more