¡@

Home 

2014/10/16 ¤W¤È 08:13:36

android Programming Glossary: fis

How to encrypt file from sd card using AES in Android?

http://stackoverflow.com/questions/10782187/how-to-encrypt-file-from-sd-card-using-aes-in-android

Here you read the cleartext. FileInputStream fis new FileInputStream data cleartext This stream write the encrypted.. fos cipher Write bytes int b byte d new byte 8 while b fis.read d 1 cos.write d 0 b Flush and close streams. cos.flush.. d 0 b Flush and close streams. cos.flush cos.close fis.close After you execute this function there should be a file..

achartengine - can't figure how to use dates as x axis - the file I save is empty

http://stackoverflow.com/questions/16014103/achartengine-cant-figure-how-to-use-dates-as-x-axis-the-file-i-save-is-empt

BufferedReader br new BufferedReader new InputStreamReader fis do s br.readLine if s null String splitLine s.split date.add.. BufferedReader br new BufferedReader new InputStreamReader fis do s br.readLine if s null String splitLine s.split first..

Android - Playing mp3 from byte[]

http://stackoverflow.com/questions/1972027/android-playing-mp3-from-byte

0x1 so using file descriptor instead FileInputStream fis new FileInputStream tempMp3 mediaPlayer.setDataSource fis.getFD.. fis new FileInputStream tempMp3 mediaPlayer.setDataSource fis.getFD mediaPlayer.prepare mediaPlayer.start catch IOException..

Setting Ringtone in Android [duplicate]

http://stackoverflow.com/questions/1986756/setting-ringtone-in-android

null try byte readData new byte 1024 FileInputStream fis soundFile.createInputStream FileOutputStream fos new FileOutputStream.. fos new FileOutputStream newSoundFile int i fis.read readData while i 1 fos.write readData 0 i i fis.read readData.. 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..

Android how to create runtime thumbnail

http://stackoverflow.com/questions/2577221/android-how-to-create-runtime-thumbnail

null try final int THUMBNAIL_SIZE 64 FileInputStream fis new FileInputStream fileName Bitmap imageBitmap BitmapFactory.decodeStream.. fileName Bitmap imageBitmap BitmapFactory.decodeStream fis imageBitmap Bitmap.createScaledBitmap imageBitmap THUMBNAIL_SIZE..

How to read text file in Android? [duplicate]

http://stackoverflow.com/questions/3344551/how-to-read-text-file-in-android

You can read a line at a time with this FileInputStream fis final StringBuffer storedString new StringBuffer try fis openFileInput.. fis final StringBuffer storedString new StringBuffer try fis openFileInput out.txt DataInputStream dataIO new DataInputStream.. out.txt DataInputStream dataIO new DataInputStream fis String strLine null if strLine dataIO.readLine null storedString.append..

How do I serialize an object and save it to a file in Android?

http://stackoverflow.com/questions/4118751/how-do-i-serialize-an-object-and-save-it-to-a-file-in-android

Loading w o exception handling code FileInputStream fis context.openFileInput fileName ObjectInputStream is new ObjectInputStream.. fileName ObjectInputStream is new ObjectInputStream fis SimpleClass simpleClass SimpleClass is.readObject is.close return..

java.lang.IllegalArgumentException: contains a path separator

http://stackoverflow.com/questions/5963535/java-lang-illegalargumentexception-contains-a-path-separator

as String NAME_OF_FILE sdcard imageq.png FileInputStream fis this.openFileInput NAME_OF_FILE 2nd line I get an error on 2nd..

Android MediaPlayer works fine in Custom audio Streaming application up to Android 2.1 but not in higher versions

http://stackoverflow.com/questions/8671479/android-mediaplayer-works-fine-in-custom-audio-streaming-application-up-to-andro

data data package cache playingMedia0.dat FileInputStream fis new FileInputStream mediaFile mPlayer.setDataSource fis.getFD.. fis new FileInputStream mediaFile mPlayer.setDataSource fis.getFD mPlayer.prepare return mPlayer Current status 1 It works.. versions like Android 2.2. 2 The mPlayer.setDataSource fis.getFD is the line which throws the error. 3 The error is Unable..

Encryption of video files?

http://stackoverflow.com/questions/9496447/encryption-of-video-files

file. Modify it as per your choice... FileInputStream fis new FileInputStream new File D Shashank inputVideo.avi File.. fos new FileOutputStream outfile FileInputStream encfis new FileInputStream outfile FileOutputStream decfos new FileOutputStream.. skey CipherInputStream cis new CipherInputStream fis encipher decipher.init Cipher.DECRYPT_MODE skey CipherOutputStream..

How to encrypt file from sd card using AES in Android?

http://stackoverflow.com/questions/10782187/how-to-encrypt-file-from-sd-card-using-aes-in-android

NoSuchAlgorithmException NoSuchPaddingException InvalidKeyException Here you read the cleartext. FileInputStream fis new FileInputStream data cleartext This stream write the encrypted text. This stream will be wrapped by another stream... the output stream CipherOutputStream cos new CipherOutputStream fos cipher Write bytes int b byte d new byte 8 while b fis.read d 1 cos.write d 0 b Flush and close streams. cos.flush cos.close fis.close After you execute this function there should.. Write bytes int b byte d new byte 8 while b fis.read d 1 cos.write d 0 b Flush and close streams. cos.flush cos.close fis.close After you execute this function there should be a file names encrypted . The file contains the encrypted characters...

achartengine - can't figure how to use dates as x axis - the file I save is empty

http://stackoverflow.com/questions/16014103/achartengine-cant-figure-how-to-use-dates-as-x-axis-the-file-i-save-is-empt

yyyy Date d new Date try d thedate.parse filename catch.. BufferedReader br new BufferedReader new InputStreamReader fis do s br.readLine if s null String splitLine s.split date.add d Double.parseDouble splitLine 0 data.add Double.parseDouble.. thedate new SimpleDateFormat dd MM yyyy Date d BufferedReader br new BufferedReader new InputStreamReader fis do s br.readLine if s null String splitLine s.split first substring is the formatted date date.add thedate.parse splitLine..

Android - Playing mp3 from byte[]

http://stackoverflow.com/questions/1972027/android-playing-mp3-from-byte

passing path directly but kept getting Prepare failed. status 0x1 so using file descriptor instead FileInputStream fis new FileInputStream tempMp3 mediaPlayer.setDataSource fis.getFD mediaPlayer.prepare mediaPlayer.start catch IOException.. status 0x1 so using file descriptor instead FileInputStream fis new FileInputStream tempMp3 mediaPlayer.setDataSource fis.getFD mediaPlayer.prepare mediaPlayer.start catch IOException ex String s ex.toString ex.printStackTrace share improve..

Setting Ringtone in Android [duplicate]

http://stackoverflow.com/questions/1986756/setting-ringtone-in-android

mUri r catch FileNotFoundException e soundFile null try byte readData new byte 1024 FileInputStream fis soundFile.createInputStream FileOutputStream fos new FileOutputStream newSoundFile int i fis.read readData while i 1 fos.write.. byte 1024 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.. 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 new ContentValues..

Android how to create runtime thumbnail

http://stackoverflow.com/questions/2577221/android-how-to-create-runtime-thumbnail

share improve this question My Solution byte imageData null try final int THUMBNAIL_SIZE 64 FileInputStream fis new FileInputStream fileName Bitmap imageBitmap BitmapFactory.decodeStream fis imageBitmap Bitmap.createScaledBitmap imageBitmap.. int THUMBNAIL_SIZE 64 FileInputStream fis new FileInputStream fileName Bitmap imageBitmap BitmapFactory.decodeStream fis imageBitmap Bitmap.createScaledBitmap imageBitmap THUMBNAIL_SIZE THUMBNAIL_SIZE false ByteArrayOutputStream baos new ByteArrayOutputStream..

How to read text file in Android? [duplicate]

http://stackoverflow.com/questions/3344551/how-to-read-text-file-in-android

issue Regards Sunny. android share improve this question You can read a line at a time with this FileInputStream fis final StringBuffer storedString new StringBuffer try fis openFileInput out.txt DataInputStream dataIO new DataInputStream.. You can read a line at a time with this FileInputStream fis final StringBuffer storedString new StringBuffer try fis openFileInput out.txt DataInputStream dataIO new DataInputStream fis String strLine null if strLine dataIO.readLine null.. StringBuffer storedString new StringBuffer try fis openFileInput out.txt DataInputStream dataIO new DataInputStream fis String strLine null if strLine dataIO.readLine null storedString.append strLine dataIO.close fis.close catch Exception e..

How do I serialize an object and save it to a file in Android?

http://stackoverflow.com/questions/4118751/how-do-i-serialize-an-object-and-save-it-to-a-file-in-android

os new ObjectOutputStream fos os.writeObject this os.close Loading w o exception handling code FileInputStream fis context.openFileInput fileName ObjectInputStream is new ObjectInputStream fis SimpleClass simpleClass SimpleClass is.readObject..

java.lang.IllegalArgumentException: contains a path separator

http://stackoverflow.com/questions/5963535/java-lang-illegalargumentexception-contains-a-path-separator

contains a path separator I have a filename in my code as String NAME_OF_FILE sdcard imageq.png FileInputStream fis this.openFileInput NAME_OF_FILE 2nd line I get an error on 2nd line 05 11 16 49 06.355 ERROR AndroidRuntime 4570 Caused..

Android MediaPlayer works fine in Custom audio Streaming application up to Android 2.1 but not in higher versions

http://stackoverflow.com/questions/8671479/android-mediaplayer-works-fine-in-custom-audio-streaming-application-up-to-andro

MediaPlayer mPlayer new MediaPlayer example of mediaFile data data package cache playingMedia0.dat FileInputStream fis new FileInputStream mediaFile mPlayer.setDataSource fis.getFD mPlayer.prepare return mPlayer Current status 1 It works fine.. data data package cache playingMedia0.dat FileInputStream fis new FileInputStream mediaFile mPlayer.setDataSource fis.getFD mPlayer.prepare return mPlayer Current status 1 It works fine from Android 1.6 to 2.1 but not in the higher versions.. 1 It works fine from Android 1.6 to 2.1 but not in the higher versions like Android 2.2. 2 The mPlayer.setDataSource fis.getFD is the line which throws the error. 3 The error is Unable to to create media player Other Solution tried I tried below..

Encryption of video files?

http://stackoverflow.com/questions/9496447/encryption-of-video-files

easily. I wrote a sample program to encrypt and decrypt a video file. Modify it as per your choice... FileInputStream fis new FileInputStream new File D Shashank inputVideo.avi File outfile new File D Shashank encVideo.avi int read if outfile.exists.. if decfile.exists decfile.createNewFile FileOutputStream fos new FileOutputStream outfile FileInputStream encfis new FileInputStream outfile FileOutputStream decfos new FileOutputStream decfile Cipher encipher Cipher.getInstance AES.. SecretKey skey kgen.generateKey Lgo encipher.init Cipher.ENCRYPT_MODE skey CipherInputStream cis new CipherInputStream fis encipher decipher.init Cipher.DECRYPT_MODE skey CipherOutputStream cos new CipherOutputStream decfos decipher while read..