Question: Below is my code. On clicking imageview camera will open and we will capture image. In the below onActivityResult the image size come as the size of thumbnail. I want the actual image size. How to do?

```
protected void onActivityResult(int requestCode, int resultCode, Intent data) {
    if (requestCode == CAMERA_REQUEST && resultCode == Activity.RESULT_OK) {
        Bitmap photo = (Bitmap) data.getExtras().get("data");
        if (CAMERA_REQUEST == 1) {
            ivBeforeLoading.setImageBitmap(photo);
            ivBeforeLoading.setBackgroundResource(0);
            imgBefLoad = photo;
        }
    }
}

```

Answer: 
-You need to get the full image path , not only the data from the intent extra , and then get your file from that path , only then you can get the real size of the picture .
-you can use some picker library or you can just check this link 

[Dialog to pick image from gallery or from camera](https://stackoverflow.com/questions/10165302/dialog-to-pick-image-from-gallery-or-from-camera)

you will find what you are looking for
Try this ([how do I get file size of temp file in android?](https://stackoverflow.com/questions/10202805/how-do-i-get-file-size-of-temp-file-in-android))

```
File file = new File(selectedPath);
int file_size = Integer.parseInt(String.valueOf(file.length()/1024));

```