How to write a file in Android to the raw folder?

Viewed 11996

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.

2 Answers

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

Related