android-file Questions

5

Solved

In order to save a picture on the SD card, I currently use the function File.createTempFile: File imageFile = File.createTempFile(imageFileName, MyApplication.JPEG_FILE_SUFFIX, MyApplication.getAlb...
Distiller asked 17/6, 2013 at 14:56

6

Solved

How can I upload a File (graphic, audio and video file) with Android using the Dropbox API to Dropbox? I followed the tutorial on the Dropbox SDK Android page and could get the sample to work. But ...
Cytoplast asked 22/3, 2012 at 9:52

9

Solved

On the emulator, I downloaded an image from Google. I can find the image on the emulator, but I have no idea what the file location of the image is. To debug my app I need to know where that image ...
Sump asked 26/10, 2012 at 23:28

7

Solved

I need the name (String) of all files in res/raw/ directory. I tried: File f = new File("/"); String[] someFiles = f.list(); It looks like the root directory is the root of the android ...
Philharmonic asked 30/6, 2011 at 18:57

6

Solved

I'm trying to save a bitmap to file and a specific directly using a function I've created. It's not working. It crashes after bitmap.compress part (before here3). File dir = new File(filepath); ...
Grous asked 30/6, 2012 at 14:9

4

Solved

Read that Android 11 has scoped storage, but I can't find any information, how can I create and use folder in /storage/emulated/0/ ? Old methods works only on api 29 and below :(
Dareen asked 22/9, 2020 at 19:42

6

Solved

I want to pick image from gallery and copy it in to other folder in SDCard. Code to Pick Image from Gallery Intent photoPickerIntent = new Intent(Intent.ACTION_PICK); photoPickerIntent.setType("...

1

In Android you can use getFilesDir() to get a path to your internal /files/ folder, whereas getCacheDir() gets you a path to your internal /cache/ folder. Is the only functional difference between...
Birdie asked 9/4, 2016 at 20:56

8

Solved

I'm trying to implement a File Picker in my Android project. What I've been able to do so far is : Intent chooseFile; Intent intent; chooseFile = new Intent(Intent.ACTION_GET_CONTENT); chooseFile....

15

Solved

I need to show an image by using the file name only, not from the resource id. ImageView imgView = new ImageView(this); imgView.setBackgroundResource(R.drawable.img1); I have the image img1 in t...
Esdras asked 15/11, 2010 at 5:53

3

Solved

I have a database file in my assets that I copy in the app database folder. After the copy (it works), I want to encrypt the copied database with SQLCipher. For some reason, I get this error: Dat...
Stradivari asked 14/9, 2016 at 16:50

16

Solved

I'm driven crazy with this: Log.d("STATE", Environment.getExternalStorageState()); File f = new File(Environment.getExternalStoragePublicDirectory(Environment.DIRECTORY_DCIM), "work_data"); Log.d(...
Humberto asked 27/8, 2011 at 4:33

4

I have an app which records videos to shared MOVIES folder. I can delete those files on Android 11 (API 30) with contentResolver.delete(uri, null, null) method in my recorded videos activity. But i...
Miltonmilty asked 28/10, 2020 at 22:33

1

I place all the files in assets folder and use following functions to open them: fun Fragment.openAssetsFile(fileName: String) { val file = getAssetsFile(fileName) val fileUri = FileProvider.getU...

7

Solved

I have a very simple mediaplayer that play background. It calls file from the apk, but I want it to play from any directory like as music or sdcard. Here is my code: private MediaPlayer mpintro; ....
Manstopper asked 23/5, 2013 at 13:18

8

Most of the new android devices have an internal sdcard and an external sdcard. I want to make a file explorer app but I can't find out how to get the path to use in my app because File file = En...
Lessen asked 13/11, 2012 at 12:46

11

Solved

The following code which consists of downloading a file from a server and save it in the storage works fine when the device has an internal storage. But when I tried it with a device with no intern...
Ay asked 9/7, 2013 at 5:38

3

Solved

I have the following operation which runs every 3 seconds. Basically it downloads a file from a server and save it into a local file every 3 seconds. The following code does the job for a while. p...
Lemkul asked 5/6, 2013 at 1:8

3

I need to write an Android app that observes when a file is modified by another app and then reads data from it. The file is chosen by the user. So I want to use Intent and what ever file chooser i...
Hughey asked 27/1, 2018 at 7:19

11

Solved

I am trying to open the pdf file which I downloaded & saved in external storage. But When I open my app its gets crashed and showing following error; 08-31 00:58:31.304 1807-1807/? E/AndroidRu...
Luxury asked 31/8, 2017 at 5:22

23

Solved

The app is crashing when I'm trying to open a file. It works below Android Nougat, but on Android Nougat it crashes. It only crashes when I try to open a file from the SD card, not from the system ...
Syntactics asked 5/7, 2016 at 9:51

5

Solved

My goal is to create a XML file on internal storage and then send it through the share Intent. I'm able to create a XML file using this code FileOutputStream outputStream = context.openFileOutput...
Orphaorphan asked 29/8, 2012 at 3:11

4

Solved

For Android, the following code returns a Uri that can be used to create DocumentFile corresponding to a directory. Intent intent = new Intent(Intent.ACTION_OPEN_DOCUMENT_TREE); startActivityForRes...
Fascicule asked 19/9, 2016 at 16:20

6

Solved

I am using this code to save Bitmap in External Storage but it does not create the folder if it not exists: String path = Environment.getExternalStorageDirectory().toString(); OutputStream fOutpu...
Bradytelic asked 27/12, 2012 at 10:42

6

Solved

I am creating a directory in internal memory of device for storing files for application use.I am using: File dir = context.getDir(userfavorites, Context.MODE_PRIVATE); The above code will creat...
Cateyed asked 17/10, 2012 at 6:21

© 2022 - 2025 — McMap. All rights reserved.