Android IDE (AIDE) Support Forum

How to use FileProvider class from androidx package?

Hello,

I am running AIDE on Android 10 and trying to use the FileProvider class. For this i tried writing

import androidx.core.content.FileProvider;

The androidx imports are not added to the file when I use the “organize imports” AIDE option.

How do I use classes belonging to an androidx library in AIDE? Do I need to install a Jetpack library, and if so, how do I do it?

Thanks.

Can someone tell me how to fix this code:


can’t get FileProvider to work in AIDE.

To use the file provider class you need to use appcompat in your project. Import implementation ‘com.android.support:appcompat-v7:27.1.1’

But since Android 10 has scooped storage you need to do the following things:
Take the picture then using an Input stream copy the file to the scooped app internal folder, then do whatever you want with de copied file. Don’t forget to clean the copied file cause it will grow your cache folder.