Win a copy of Java Mock Exams (software) this week in the Programmer Certification (OCPJP) forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

File read write problem

 
Hardik Trivedi
Ranch Hand
Posts: 252
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi all,

I have an audio file. I am maintaining that audio file in FileDescriptor. I want to write that file in sdcard or somewhere else.
I do not know how to copy that file using filedecriptor.

What I have done so far is ..


Where memo path is just a name of file.
Can ayonr give some idea.
 
Peter Johnson
author
Bartender
Posts: 5856
7
Android Eclipse IDE Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Here are the docs on writing to the SD card: http://developer.android.com/guide/topics/data/data-storage.html#filesExternal
You will also need this permission in the manifest:


As far as reading the file when you have a FileDescriptor, several of the java.io classes take FileDescriptors as constructor parameters, including FileReader and FileInputStream.


 
Happiness is not a goal ... it's a by-product of a life well lived - Eleanor Roosevelt. Tiny ad:
the new thread boost feature: great for the advertiser and smooth for the coderanch user
https://coderanch.com/t/674455/Thread-Boost-feature
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!