Upload image from gallery using android studio on button click

I am using android studio to develop my app. I want to upload image from gallery on button click and also display uploaded image in image view on that page and also save that image to project folder. how to do this activities on button click. I am running my app on emulator.