android Programming Glossary: readdata
Setting Ringtone in Android [duplicate] http://stackoverflow.com/questions/1986756/setting-ringtone-in-android soundFile try soundFile mCr.openAssetFileDescriptor mUri r catch FileNotFoundException e soundFile null try byte readData new byte 1024 FileInputStream fis soundFile.createInputStream FileOutputStream fos new FileOutputStream newSoundFile int.. FileInputStream fis soundFile.createInputStream FileOutputStream fos new FileOutputStream newSoundFile int i fis.read readData while i 1 fos.write readData 0 i i fis.read readData fos.close catch IOException io Then you can use the previously posted.. FileOutputStream fos new FileOutputStream newSoundFile int i fis.read readData while i 1 fos.write readData 0 i i fis.read readData fos.close catch IOException io Then you can use the previously posted solution ContentValues values..
How to read a text file from “assets” directory as a string? http://stackoverflow.com/questions/4866746/how-to-read-a-text-file-from-assets-directory-as-a-string BufferedReader new FileReader filePath char buf new char 1024 int numRead 0 while numRead reader.read buf 1 String readData String.valueOf buf 0 numRead fileData.append readData buf new char 1024 reader.close return fileData.toString But it.. char 1024 int numRead 0 while numRead reader.read buf 1 String readData String.valueOf buf 0 numRead fileData.append readData buf new char 1024 reader.close return fileData.toString But it cast a null pointer exception... the file is called origin..
|