寻找一种方法来阻止用户打开我从Android转移到PC的文本文件

时间:2014-09-08 08:30:20

标签: android file text-files

寻找一种方法来防止用户打开我从Android转移到PC的文本文件

通过DropBox。

将文本文件转换为bin文件将完成这项工作吗?

我可以在java(for android)中获取将文本文件转换为bin文件的任何示例代码吗?

我试试这个但是不行:

Reading the file:

File queryImg = new File(ImagePath);
int imageLen = (int)queryImg.length();
byte [] imgData = new byte[imageLen];
FileInputStream fis = new FileInputStream(queryImg);
fis.read(imgData);


Writing the file:

FileOutputStream f = new FileOutputStream(new File("/MyPath/xx.bin"));
f.write(imgData);
f.flush();
f.close();

1 个答案:

答案 0 :(得分:0)

如果我正确理解了这个问题,我建议将文件扩展名从.txt更改为其他不存在的扩展名(.gldsft或类似名称),加密或根本不使用文本文件。