Skip to content

Commit 7ca0e3e

Browse files
committedSep 5, 2014
include example image by default, and set it as app icon too
This gives something to quickly click and try.
1 parent 2eea13a commit 7ca0e3e

File tree

5 files changed

+20
-0
lines changed

5 files changed

+20
-0
lines changed
 

‎res/drawable-hdpi/icon.png

1.86 KB
Loading

‎res/drawable-ldpi/icon.png

294 Bytes
Loading

‎res/drawable-mdpi/icon.png

581 Bytes
Loading

‎res/raw/alberti_cipher_disk.png

84.1 KB
Loading

‎src/info/guardianproject/iocipherexample/FileBrowser.java

+20
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@
2727
import info.guardianproject.iocipher.VirtualFileSystem;
2828

2929
import java.io.BufferedOutputStream;
30+
import java.io.FileNotFoundException;
3031
import java.io.IOException;
3132
import java.io.InputStream;
3233
import java.io.OutputStream;
@@ -76,6 +77,25 @@ protected void onResume() {
7677
if (!vfs.isMounted())
7778
vfs.mount("my fake password");
7879

80+
File sample = new File("/alberti_cipher_disk.jpg");
81+
if (!sample.exists()) {
82+
try {
83+
InputStream in = getResources().openRawResource(R.raw.alberti_cipher_disk);
84+
OutputStream out = new FileOutputStream(sample);
85+
byte[] buffer = new byte[8192];
86+
int len;
87+
while ((len = in.read(buffer)) != -1) {
88+
out.write(buffer, 0, len);
89+
}
90+
in.close();
91+
out.close();
92+
} catch (FileNotFoundException e) {
93+
e.printStackTrace();
94+
} catch (IOException e) {
95+
e.printStackTrace();
96+
}
97+
}
98+
7999
// generate some files to have something to see
80100
if (!new File("/dir0").exists())
81101
for (int i = 0; i < 4; i++)

0 commit comments

Comments
 (0)
Please sign in to comment.