7

I think this is a pretty basic question.

I am currently writing a file like this:

File output = new File("exampleout.mid");

Now, I want to write the file to ../myproject/res/raw

I read I could do it by putting the complete url in the "". BUT. Since this is an Android app. What is the full url? I don;t have to write /home/.../myproject/...?

Is the solution:

File output = new File("/res/raw/exampleout.mid");

Or do I need a higher url structure?

Sorry about asking this simple question, but since I use an Android emulator, I cannot check if the file is actually in the right place.

dorien
  • 5,265
  • 10
  • 57
  • 116

2 Answers2

11

You cannot write a file to raw folder. Its read-only. Precisely you can't modify anything contained within "Res" folder on the fly.

Check this out, https://stackoverflow.com/a/3374149

Community
  • 1
  • 1
Andro Selva
  • 53,910
  • 52
  • 193
  • 240
  • Ok thanks! The thing is that I want to playback this file with MediaPlayer and MediaPlayer want the files to be in /res/raw. Any idea on how to solve this? – dorien Jul 24 '12 at 10:21
  • But you can use MediaPlayer to play sound from any directory rite? – Andro Selva Jul 24 '12 at 10:23
  • 1
    I didn't know that. Let me examine further. Is there a directory you can recommend for that and how would I write to that? – dorien Jul 24 '12 at 10:23
0

If you want to use iText on Android or the Google App Engine, you need to use iTextG.

dependencies {
    compile 'com.itextpdf:itextg:5.5.10'
}

Source: iText Official Site

Djib2011
  • 6,874
  • 5
  • 36
  • 41
Moreno
  • 171
  • 1
  • 9