How to reference a File in raw folder in Android
问题 I just want to create a File object like this File myImageFile = new File ("image1") ; but it is giving me exception of FileNotFoundException How can i reference a file inside my raw Folder EDIT: Actually i wanted to do something like this MultipartEntity multipartEntity= new MultipartEntity(HttpMultipartMode.BROWSER_COMPATIBLE); multipartEntity.addPart("uploaded", new FileBody(new File("myimage"))); 回答1: here are 2 functions. one to read from RAW and one from the Assets /** * Method to read