Welcome to the Treehouse Community

Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.

Start your free trial

Android

How to write a file to Android device 's directory using Inputstream ?

I have a file called "en-sent.zip" . It's from OpenNLP to select specific sentence from a paragraph . I need to write it to Android device so my app can use it . I put it to res/raw folder and renamed it to ensent.zip . Then i use :"InputStream in = getResources().openRawResource(R.raw.ensent);" to put it to an InputStream . Now i need to use outputstream to write it to Android device 's directory . But i get :"No such file or directory" error . How could i do it ? And could Android device read en-sent.zip file like my computer ?It's a .bin file .

Ok i just found a way .Thanks for reading .