1

I have a few files as resources in the android app.

On the other hand I have some methods that require a "File" object as an argument.

How can I bridge the two?

Edit: I need some way to have a "File" object and not to read the file as an inputstream. thank you!

A S
  • 2,924
  • 5
  • 22
  • 27

1 Answers1

0

You could copy the file to external storage (reading from your raw resource's InputStream and writing to a new file) and then open it as a File from there. That's kludgy, but I'm pretty sure there's no way to get the resource as a File directly.

Darshan Rivka Whittle
  • 32,989
  • 7
  • 91
  • 109