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.

Where Next?

Popular Android topics Top

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
CristianM92
Hi, I’m working on an app who make the conversion between decimal degrees and degrees minutes seconds. I have to make an “Export” button ...
New
mfaamir
Dear Sir, I am a beginner in Android App development and I am currently trying to establish a connection between my Android Studio Java ...
New
Shadow
Good afternoon. Brief story: My institution has several nfc tags in building which have to be scanned with specific app built and used in...
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
faust
Honest question, do companies still use Java for their new android apps? I thought everybody was using Kotlin these days.
New
Rodion
Hello everyone, I recently started learning Kotlin and downloaded Android Studio, but after writing my first code and trying to run it, I...
New
Ujjwala
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...
New
Garrett
This is a question about Android Studio. Where is the Android Studio emulator’s camera default apartment 3D model stored in Android Stud...
New
Alan
I need to create an android app to receive contactless payment from my clients. how can I start that? My clients will be phisicaly in the...
New

Other popular topics Top

Devtalk
Reading something? Working on something? Planning something? Changing jobs even!? If you’re up for sharing, please let us know what you’...
1032 17402 381
New
AstonJ
You might be thinking we should just ask who’s not using VSCode :joy: however there are some new additions in the space that might give V...
New
Margaret
Hello everyone! This thread is to tell you about what authors from The Pragmatic Bookshelf are writing on Medium.
1143 25816 759
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
foxtrottwist
A few weeks ago I started using Warp a terminal written in rust. Though in it’s current state of development there are a few caveats (tab...
New
PragmaticBookshelf
Author Spotlight James Stanier @jstanier James Stanier, author of Effective Remote Work , discusses how to rethink the office as we e...
New
Help
I am trying to crate a game for the Nintendo switch, I wanted to use Java as I am comfortable with that programming language. Can you use...
New
PragmaticBookshelf
Author Spotlight Mike Riley @mriley This month, we turn the spotlight on Mike Riley, author of Portable Python Projects. Mike’s book ...
New
PragmaticBookshelf
Author Spotlight: VM Brasseur @vmbrasseur We have a treat for you today! We turn the spotlight onto Open Source as we sit down with V...
New
PragmaticBookshelf
Develop, deploy, and debug BEAM applications using BEAMOps: a new paradigm that focuses on scalability, fault tolerance, and owning each ...
New