How to use status folder for WhatsApp status saver app in android 11 scoped storage

0 votes
Hello, I've created a WhatsApp status-saver app. I am unable to access the user's state in the app due to Google's introduction of scoped storage in Android 11. To accomplish this, I utilized MANAGE EXTERNAL STORAGE, but I am unable to publish the app to Google Play using this. I've observed a couple of apps requesting access to the .status folder using some sort of permission. What steps should I take to do that?
Nov 7, 2022 in Android by Edureka
• 12,690 points
2,244 views

1 answer to this question.

0 votes

Request the user to give permission to the WhatsApp status storage folder.

private void checkWhatsAppPermission(){
    // Choose a directory using the system's file picker.
    Intent intent = new Intent(Intent.ACTION_OPEN_DOCUMENT_TREE);
    // Optionally, specify a URI for the directory that should be opened in
    // the system file picker when it loads.

    Uri wa_status_uri = Uri.parse("content://com.android.externalstorage.documents/tree/primary%3AAndroid%2Fmedia/document/primary%3AAndroid%2Fmedia%2Fcom.whatsapp%2FWhatsApp%2FMedia%2F.Statuses");
    intent.putExtra(DocumentsContract.EXTRA_INITIAL_URI, wa_status_uri);
    startActivityForResult(intent, 10001);
}
answered Nov 8, 2022 by Edureka
• 13,620 points

Related Questions In Android

0 votes
0 answers

How to open WhatsApp using an Intent in your Android App?

I want an Intent to take control ...READ MORE

Nov 23, 2022 in Android by Ashwini
• 5,430 points
2,918 views
0 votes
0 answers
0 votes
1 answer

Android in-app billing - How to handle refunds ?

Simply disregard the library's purchase to overcome ...READ MORE

answered Nov 10, 2022 in Android by Edureka
• 12,690 points
1,542 views
0 votes
0 answers

How to implement the system lock screen in your own android app?

How should the system lock screen be ...READ MORE

Nov 22, 2022 in Android by Edureka
• 12,690 points
679 views
0 votes
1 answer
0 votes
0 answers
–1 vote
1 answer

"Default Activity Not Found" on Android Studio upgrade

If you see that ERROR occurrence after ...READ MORE

answered Feb 11, 2022 in Others by Soham
• 9,710 points
1,233 views
0 votes
1 answer

Execution Failed for task :app:compileDebugJavaWithJavac in Android Studio

In Android Studio 3.1, you can see ...READ MORE

answered Feb 17, 2022 in Java by Aditya
• 7,680 points
13,246 views
0 votes
1 answer

How get permission for camera in android.(Specifically Marshmallow)?

To begin with, confirm that the user ...READ MORE

answered Nov 8, 2022 in Android by Edureka
• 13,620 points
3,738 views
0 votes
1 answer

How to set my Activity as main activity in android?

The "intent-filter" in "AndroidManifest.xml" allows you to ...READ MORE

answered Nov 8, 2022 in Android by Edureka
• 13,620 points
2,325 views
webinar REGISTER FOR FREE WEBINAR X
REGISTER NOW
webinar_success Thank you for registering Join Edureka Meetup community for 100+ Free Webinars each month JOIN MEETUP GROUP