Ujjwala

Ujjwala

I'm not getting permission to access full storage, although I added all permission requirements in manifest file. I'm using android 14 version(API 34)

I’m developing an Android application in which I need to add functionality to automatically read a CSV file from a file manager, parse it, and store the data in a database.

I have added all permissions but it says permission denied.

private void requestPermission() {
ActivityCompat.requestPermissions(this, new String{Manifest.permission.READ_EXTERNAL_STORAGE}, REQUEST_CODE_READ_EXTERNAL_STORAGE);
}

@Override
public void onRequestPermissionsResult(int requestCode, String[] permissions, int[] grantResults) {
    super.onRequestPermissionsResult(requestCode, permissions, grantResults);
    if (requestCode == REQUEST_CODE_READ_EXTERNAL_STORAGE) {
        if (grantResults.length > 0 && grantResults[0] == PackageManager.PERMISSION_GRANTED) {
            Toast.makeText(this, "Permission Granted", Toast.LENGTH_SHORT).show();
        } else {
            Toast.makeText(this, "Permission Denied", Toast.LENGTH_SHORT).show();
        }
    }
}

Most Liked

johnfisher

johnfisher

Starting with Android 14, READ_EXTERNAL_STORAGE is replaced by READ_MEDIA_* for media files. For non-media files, use the Storage Access Framework (SAF) or request MANAGE_EXTERNAL_STORAGE. Add it to your manifest and guide users to enable it via Settings.ACTION_MANAGE_APP_ALL_FILES_ACCESS_PERMISSION. Note: Google Play restricts MANAGE_EXTERNAL_STORAGE.

Popular Android topics Top

First poster: bot
The Kotlin Foundation was created by JetBrains and Google with the mission to protect, promote and advance the development of the Kotlin ...
New
Exadra37
I am in the process of research for my next technical blog about bypassing certificate pinning with Frida, thus I need to find some open ...
New
big_f
I am making an app with Nativescript-vue and I would like to have an event where I click on an icon and then a new box appears. For the i...
New
Prosper226
Hi guys, I’m trying to do multi ussd with java on android, I can’t do it. I looked at the documentation of telephonyManager on android, ...
New
AndroidMan
I’ve tried signing up for Airnow as I used to do very well when they were Airpush, but i haven’t used them in years. I went through the s...
New
cajasigwe
Hi, Please I need help to get DHIS2 Capture working in Android Tablet Phone desk ( KT5-3C) Android Version: 10. Build: KT5-3C_LTE05M0_K...
New
cve60069
Hello I am starting the tearning curve to writing an app for my galaxy phone. Me and my friens play a lot of “Texas Hold-Em” and, for t...
New
JesperBlom
Hi Hope it is a simple question :slight_smile: I am planning to use a new PC for making my enterprise app. Everything works perfect, b...
New
codergrid
I’m new to Android Studio, and curious about how long you’ve been using your Android Studio IDE. I read on Wikipedia that this year, Andr...
New
nihar-gingercube
We have developed a audio/video calling functionality using opentok sdk, now we want to integrate speech recognizer for transcribing voic...
New

Other popular topics Top

PragmaticBookshelf
A PragProg Hero’s Journey with Brian P. Hogan @bphogan Have you ever worried that your only legacy will be in the form of legacy...
New
Exadra37
Please tell us what is your preferred monitor setup for programming(not gaming) and why you have chosen it. Does your monitor have eye p...
New
New
Exadra37
On modern versions of macOS, you simply can’t power on your computer, launch a text editor or eBook reader, and write or read, without a ...
New
New
Exadra37
I am a Linux user since 2012, more or less, and I always use Ubuntu on my computers, and my last 2 laptops have been used Thinkpads, wher...
New
AstonJ
This looks like a stunning keycap set :orange_heart: A LEGENDARY KEYBOARD LIVES ON When you bought an Apple Macintosh computer in the e...
New
AstonJ
Saw this on TikTok of all places! :lol: Anyone heard of them before? Lite:
New
AstonJ
Biggest jackpot ever apparently! :upside_down_face: I don’t (usually) gamble/play the lottery, but working on a program to predict the...
New
AstonJ
This is cool! DEEPSEEK-V3 ON M4 MAC: BLAZING FAST INFERENCE ON APPLE SILICON We just witnessed something incredible: the largest open-s...
New

Latest in Android

View all threads ❯