Skip to content

Software Development at Program Tom LTD

Place for coding, programming, development and software in general.

Menu
  • Blog
  • PDF Booklets
  • Dev Utils & Content
  • Java Spring Boot Or Web Apps
  • English
    • български
    • English
    • Español
    • Português
    • हिन्दी
    • Русский
    • Deutsch
    • Français
    • Italiano
    • العربية
  • About Us
Menu
Android Camera Users Permission Required

Android Camera Users Permission Required (Update)

Posted on August 19, 2025 by Toma Velev

You can make the CAMERA permission optional, so the app continues to function even if the user denies it. The key is to:

✅ 1. Declare the Permission in the Manifest (but don’t make it required):

<uses-permission android:name="android.permission.CAMERA" />

This only informs the system that your app might request the camera—it doesn’t force the app to crash if not granted.


✅ 2. Request the Permission at Runtime (for Android 6.0+):

You must check and request the permission at runtime before accessing the camera.

Example in Kotlin:

if (ContextCompat.checkSelfPermission(this, Manifest.permission.CAMERA)
    != PackageManager.PERMISSION_GRANTED) {
    
    ActivityCompat.requestPermissions(this,
        arrayOf(Manifest.permission.CAMERA),
        CAMERA_PERMISSION_REQUEST_CODE)
} else {
    // Permission already granted, proceed with camera
}

✅ 3. Handle Denial Gracefully:

If the user denies access, don’t crash or force close the app. Instead, show a message or disable camera features:

override fun onRequestPermissionsResult(requestCode: Int, permissions: Array<out String>, grantResults: IntArray) {
    if (requestCode == CAMERA_PERMISSION_REQUEST_CODE) {
        if ((grantResults.isNotEmpty() && grantResults[0] == PackageManager.PERMISSION_GRANTED)) {
            // Permission granted — open camera
        } else {
            // Permission denied — disable camera feature or show explanation
            Toast.makeText(this, "Camera permission denied. Some features may not work.", Toast.LENGTH_SHORT).show()
        }
    }
}

✅ 4. (Optional) Use <uses-feature> if You Want to Make It Optional for Play Store Filtering

In your AndroidManifest.xml, add:

<uses-feature android:name="android.hardware.camera" android:required="false" />

This tells Google Play that your app can still run on devices without a camera.

📌 Summary:

Feature Required? Notes
Declared, but not enforced Needed to allow requesting at runtime
Runtime Permission Yes (API 23+) Request manually and handle denial
Optional (set required=”false”) Ensures Play Store doesn’t filter out devices without a camera

I have but the store still complains. what to do with uses-permission

✅ Problem:

You set:

<uses-feature android:name="android.hardware.camera" android:required="false" />

…but you’re still getting Google Play warnings like:

Your app uses the camera hardware feature but does not declare it as optional.

❗ Why?

Google Play automatically infers that your app requires the camera if:

  • You use <uses-permission android:name="android.permission.CAMERA" />, and
  • You don’t clearly make the permission optional in both features and permissions.

✅ Solution:

To make Google Play understand that the camera is optional and your app supports devices without a camera:


✔️ 1. Keep this in your AndroidManifest.xml:

<uses-feature android:name="android.hardware.camera" android:required="false" />

✔️ 2. Do NOT remove <uses-permission>, but that’s NOT enough — so:

Use a conditional permission request (already good).


✔️ 3. Add a comment or metadata if using libraries like CameraX

If you’re using CameraX, it might be triggering extra feature detection. To avoid this, also exclude unnecessary features using:

<uses-feature android:name="android.hardware.camera.autofocus" android:required="false" />

OR explicitly exclude all advanced camera features as optional:

<uses-feature android:name="android.hardware.camera.front" android:required="false" />
<uses-feature android:name="android.hardware.camera.any" android:required="false" />

✔️ 4. Final AndroidManifest.xml example:

<uses-permission android:name="android.permission.CAMERA" />

<uses-feature android:name="android.hardware.camera" android:required="false" />
<uses-feature android:name="android.hardware.camera.front" android:required="false" />
<uses-feature android:name="android.hardware.camera.any" android:required="false" />
<uses-feature android:name="android.hardware.camera.autofocus" android:required="false" />

✅ Summary

 

Element Action
<uses-permission android:name="android.permission.CAMERA" /> ✅ Keep it
<uses-feature android:name="android.hardware.camera" android:required="false" /> ✅ Required
Additional <uses-feature> entries for front camera, autofocus, etc. ✅ Optional but recommended to stop Play Store warnings
✅ Required for Android 6.0+

 

✅ Your app can still work if you remove:

<uses-permission android:name="android.permission.CAMERA" />

But only if:

  • Your app doesn’t access the camera directly via Camera, Camera2, or CameraX APIs, or
  • You only launch the system camera app using an Intent, like:
val intent = Intent(MediaStore.ACTION_IMAGE_CAPTURE)
startActivityForResult(intent, REQUEST_IMAGE_CAPTURE)

🔸 In this case, the system camera app handles the permission, not your app. So you don’t need the CAMERA permission.


❌ NO, your app will NOT work properly without the permission if:

  • You use APIs like:
    • Camera.open()
    • CameraManager
    • CameraX
    • Any library that accesses the camera stream directly
  • You expect to access the camera feed inside your app

In these cases, removing the permission will cause:

  • SecurityException
  • Blank camera preview
  • Or outright crashes

✅ Recommended: If You Want Optional Camera Use

If your app can run without a camera, but has optional features using it:

  1. Keep the permission:
    <uses-permission android:name="android.permission.CAMERA" />
    
  2. Declare camera features as not required:
    <uses-feature android:name="android.hardware.camera" android:required="false" />
    
  3. At runtime:
    • Check for camera availability
    • Request permission dynamically
    • Gracefully degrade if camera isn’t available or permission is denied

(Update) Last minute Camera Permission Fix

There is newer tag that fixes the requirement of the permission:

<uses-permission-sdk-23 android:name="android.permission.CAMERA"  />

https://developer.android.com/guide/topics/manifest/uses-permission-sdk-23-element It takes care of targeting the requirement of the permission – according the the version of the underlying OS.

  • Prompt-to-Production: How AI is Forcing Us to Build Higher Quality Software
  • Debug Web View Flutter App
  • Skipping AI? You’re a Relic – Time to Evolve or Perish!
  • 2026 Flutter Launch Blueprint: Your 10-Step Checklist to App Store Domination
  • Product Requirements Document – for different software development levels

Categories

  • Apps (25)
  • ChatGPT (27)
  • Choosing a Framework (38)
  • Flutter (281)
  • Graphical User Interface (14)
  • Marketing (119)
  • Software Development (292)
  • Spring (45)
  • StartUp (22)
  • Uncategorized (14)
  • Uncategorized (4)
  • Vaadin (16)

Tags

Algorithms (9) crypto (29) flutterdev (39) General (86) Java (7) QR & Bar Codes (3) Software Dev Choices (33) Spring Boot (1) standards (1) Theme (3) User Authentication & Authorization (9) User Experience (10) Utilities (19) WordPress (11)

Product categories

  • All Technologies (87)
    • Flutter Apps (26)
    • GPT (4)
    • Java (39)
    • Native Android (3)
    • PHP (9)
    • Spring (Boot) / Quarkus (36)
    • Utils (15)
    • Vaadin 24+ (28)
    • Vaadin 8 (1)
  • Apps (18)
    • Employees DB (1)
    • Notes (6)
    • Personal Budget (1)
    • Recipes Book (1)
    • Stuff Organizer (1)
    • To-Do (2)
  • PDF Books (3)
  • Source Code Generators (8)

Recent Posts

  • Prompt-to-Production: How AI is Forcing Us to Build Higher Quality Software
  • Debug Web View Flutter App
  • Skipping AI? You’re a Relic – Time to Evolve or Perish!
  • 2026 Flutter Launch Blueprint: Your 10-Step Checklist to App Store Domination
  • Product Requirements Document – for different software development levels

Post Categories

  • Apps (25)
  • ChatGPT (27)
  • Choosing a Framework (38)
  • Flutter (281)
  • Graphical User Interface (14)
  • Marketing (119)
  • Software Development (292)
  • Spring (45)
  • StartUp (22)
  • Uncategorized (14)
  • Uncategorized (4)
  • Vaadin (16)