An Android Gallery app that allows users to browse and manage images on their device. Users can view all phone images, capture new photos using the camera, and set images as wallpaper.
- 📂 Display All Phone Images: Automatically loads and displays all images from the device.
- 📸 Capture Images: Opens the camera, captures images, and saves them to the device gallery.
- 🖼 Set Image as Wallpaper: Allows users to set an image as their device wallpaper.
- 📥 Persistent Image Storage: Stores image paths and reloads them on app restart.
- 🎚 Smooth User Experience: Uses RecyclerView for fast and efficient image loading.
This app requires the following permissions:
CAMERA
→ To capture new images using the device camera.READ_EXTERNAL_STORAGE
→ To read and display images from the device.WRITE_EXTERNAL_STORAGE
→ To save captured images (Required for Android versions below 10).READ_MEDIA_IMAGES
→ For Android 11+ versions.
For Android 10 (API 29) and above, MediaStore
API is used to save images directly in the Pictures
folder.
- Android Studio Installed
- Java & Kotlin Knowledge (Basic)
- An Android Device or Emulator
- Clone the repository:
git clone https://github.com/yourusername/android-gallery-app.git
- Open the project in Android Studio.
- Sync Gradle and Build the project.
- Run the app on an Emulator or a Real Device.
📦 android-gallery-app
├── 📂 app
│ ├── 📂 src
│ │ ├── 📂 main
│ │ │ ├── 📂 java/com/yourpackage/gallery
│ │ │ │ ├── HomeActivity.java # Main activity showing images
│ │ │ │ ├── CameraActivity.java # Handles camera operations
│ │ │ │ ├── GalleryAdapter.java # RecyclerView Adapter
│ │ │ │ ├── ImageViewActivity.java # Fullscreen Image View
│ │ │ ├── 📂 res
│ │ │ │ ├── 📂 layout
│ │ │ │ │ ├── activity_home.xml
│ │ │ │ │ ├── activity_camera.xml
│ │ │ │ │ ├── activity_image_view.xml
│ │ │ │ ├── 📂 drawable
│ │ │ │ ├── 📂 values
│ │ │ │ │ ├── colors.xml
│ │ │ │ │ ├── strings.xml
│ │ │ │ │ ├── themes.xml
- Ensure you're using
MediaStore
API instead ofFileProvider
. - Use
cameraLauncher
instead ofstartActivityForResult()
.
- Ensure
READ_EXTERNAL_STORAGE
permission is granted. - Check if images are being saved to
/storage/emulated/0/Pictures/
.
- Ensure
requestPermissionLauncher
handlesCAMERA
permission properly. - After permission is granted, open the camera immediately without requiring the user to click again.