Dimention and disksize for Images downloaded from web on android apps -


in app, show list of images in gird-view. these images downloaded website. when specific image selected next page shows close full-screen size version of selected image.

my plan create 256x256px images (30-40 kb) girdview , 512x512px (100-150kb)images full-screen version. not asking icon sizes(this know). related images downloaded phone or tablet.

is plan? doing wrong when different devices considered? how can improve performance, gridview images. using picasso api image download , scaling.

enter image description here

    download image , bitmap.     resize bitmap used following method per require car resize bitmap.    private bitmap getresizedbitmap(bitmap bm) {         try {             int newwidth = 0, newheight = 0;             log.i("image size", "height= " + bm.getheight() + "width= " + bm.getwidth());             if (bm.getwidth() > 400 || bm.getheight() > 700) {                 newwidth = bm.getwidth();                 newheight = bm.getheight();                 (int = 0; newwidth > 400 || newheight > 700; i++) {                     newwidth = (int) (newwidth / 1.25f);                     newheight = (int) (newheight / 1.25f);                 }                 bitmap result = bitmap.createscaledbitmap(bm, newwidth, newheight, false);                 bm.recycle();                 bm = null;                 return result;             } else {                 return bm;             }         } catch (exception e) {             e.printstacktrace();             return null;         }     } 

Comments

Popular posts from this blog

java - Static nested class instance -

c# - Bluetooth LE CanUpdate Characteristic property -

JavaScript - Replace variable from string in all occurrences -