Skip to main content

Posts

Showing posts with the label whatsapp

Image Compression like WhatsApp in android

How to compress the image without loosing the quality. You can compress the image just like whatsapp like quality. File externalFile = new File(Environment. getExternalStorageDirectory () , " ProfilePic /helloimg.jpg" ) ; Uri externaluri = Uri. parse (externalFile.getPath()) ; compressImage(externaluri.toString() , "helloimg" ) ; // Method to compress Image Compress image public String compressImage (String imageUri , String imagenameName) { String filePath = getRealPathFromURI(imageUri) ; String fileName = imagenameName ; Bitmap scaledBitmap = null; BitmapFactory.Options options = new BitmapFactory.Options() ; //by setting this field as true, the actual bitmap pixels are not loaded in the memory. Just the bounds are loaded. If //you try the use the bitmap here, you will get null. options. inJustDecodeBounds = true; Bitmap bmp = BitmapFactory. decodeFile (filePath...